Skip to content

Automate component versioning to eliminate PR version conflicts #5001

Description

@JC-wk

Is your feature request related to a problem? Please describe.
I'm always frustrated when updating versions in PRs to keep them updated every time code it merged to main & handling changelog conflicts. Open Pull Requests frequently fail CI checks with Code update without version change (stale versions) whenever another PR modifying the same component or template lands on main.

Describe the solution you'd like
An automated way to manage component versions removing the requirement for developers to manually manage version numbers in PR branches (and possibly changelog conflicts) where possible.

Describe alternatives you've considered

Proposed Pre-Merge Automation Strategies:

  1. Option A: GitHub Merge Queue Auto-Bump (Recommended)
    * Enable GitHub Merge Queue. When a PR is queued for merge, GitHub creates a temporary merge branch combining main + PR.
    * A pre-merge workflow step detects modified component/template paths and automatically bumps _version.py or porter.yaml to main_version + 1 on the merge branch before running final CI validation.

  2. Option B: Open PR Auto-Update Bot (Background Action)
    * When main receives new commits, a GitHub Action runs on push: main.
    * It identifies all open PRs touching the modified components (api_app/, templates/workspace_services/guacamole/, etc.).
    * The bot automatically checks out the open PR branches, calculates main_version + 1, and pushes a version bump commit back to the PR branch.

  3. Option C: Dynamic PR Build Tags + Automated Release Bumping
    * PR builds use dynamic ephemeral version tags (e.g., 0.25.29-pr452.a1b2c3) injected into Docker and Porter builds via --build-arg VERSION.
    * Remove mandatory static version file diff checks in PR CI.
    * Official SemVer bumps (_version.py, porter.yaml, CHANGELOG.md) are applied automatically upon merge to main.

  4. Option D: PR Slash Command (/bump)
    * Add a GitHub Action triggered by a PR comment (/bump or /bump minor). The bot automatically calculates the required bump relative to current main and commits
    it to the PR.

Please suggest any other solutions
---

### Managing Major vs. Minor vs. Patch Bumps for Components & Porter Bundles                                                                                              
                                                                                                                                                                          
Porter bundles (`porter.yaml`) and Python/Docker components use standard Semantic Versioning (`MAJOR.MINOR.PATCH`). Version bump types will be determined via:            
                                                                                                                                                                          
1. **Conventional Commits** (Fully Automated):                                                                                                                            
   * `fix:` $\rightarrow$ **PATCH** bump (`0.14.2` $\rightarrow$ `0.14.3`)                                                                                                
   * `feat:` $\rightarrow$ **MINOR** bump (`0.14.2` $\rightarrow$ `0.15.0`)                                                                                               
   * `feat!:` or `BREAKING CHANGE:` $\rightarrow$ **MAJOR** bump (`0.14.2` $\rightarrow$ `1.0.0`)                                                                         
2. **PR Labels** (Manual Override):                                                                                                                                       
   * `bump:patch` (default), `bump:minor`, or `bump:major`.                                                                                                               
                                                                                                                                                                          
---                                                                                                                                                                       
                                                                                                                                                                          
### Acceptance Criteria                                                                                                                                                   
                                                                                                                                                                          
- [ ] Developers no longer need to manually edit `_version.py`, `version.txt`, or `porter.yaml` of package.json / package-lock.json when submitting PRs.                                                      
- [ ] PR CI pipelines do not fail with "stale version" errors when rebasing against updated `main`.                                                                       
- [ ] Pre-merge automation (Merge Queue, PR update bot, or dynamic build tags) handles version calculation automatically prior to landing on `main`.                      
- [ ] Versioning rules (Patch/Minor/Major) apply consistently across both Python/Docker services and Porter bundle templates under `templates/`.        

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Up Next

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions