Skip to content

Fix version stripping workflow to auto-merge and skip tests #118

@neuromechanist

Description

@neuromechanist

Problem

The ensure-stable-version.yml workflow has issues that cause dev suffix stripping commits to appear in feature branches:

  1. Manual PR merge required: The workflow creates a PR to strip dev suffix, but requires manual merge. This delays releases and creates manual work.

  2. Test overhead: The version-only change runs full test suite unnecessarily, wasting CI resources.

  3. Version leakage: When these PRs (chore: strip dev suffix for stable release 0.5.3 #109, etc.) merge to main → develop → feature branches, the stripped version leaks into development branches where it shouldn't be.

Current Workflow

.github/workflows/ensure-stable-version.yml:

  • Triggers on push to main when src/version.py changes
  • Creates branch bot/strip-dev-suffix-X.Y.Z
  • Strips dev suffix
  • Creates PR to main
  • Requires manual review and merge
  • Runs full test suite

Proposed Solution

Modify the workflow to:

  1. Create PR with version strip
  2. Add comment explaining tests aren't needed (version-only change)
  3. Skip CI tests or mark as not required for this automated change
  4. Auto-merge the PR using --admin flag or enabling auto-merge on the repo
  5. Close issue Auto-select Anthropic provider for Anthropic models #116 automatically after merge

Implementation Details

Option 1: Skip Tests for Bot PRs

Add to .github/workflows/test.yml:

on:
  pull_request:
    branches: [main, develop]

jobs:
  test:
    if: github.actor \!= 'github-actions[bot]' || \!contains(github.head_ref, 'bot/strip-dev-suffix')

Option 2: Auto-merge with Admin Override

In ensure-stable-version.yml:

- name: Auto-merge PR
  run: |
    gh pr merge $PR_NUMBER --squash --admin --delete-branch

Option 3: Use Auto-merge Feature

Enable auto-merge on the repo and use:

- name: Enable auto-merge
  run: |
    gh pr merge $PR_NUMBER --squash --auto --delete-branch

Expected Outcome

  • ✅ Version stripping happens automatically
  • ✅ No manual intervention required
  • ✅ Tests skipped for version-only changes
  • ✅ No version leakage into develop/feature branches
  • ✅ Faster release process

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1: Critical, fix as soon as possiblebugSomething isn't workingoperationsOperations, monitoring, and observability

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions