Skip to content

fix(roadmap): roadmap-service automated release cutting fails on protected release branch #1280

Closed

Description

@dan-petty

Summary

roadmap-service runs the periodic closure job in the homelab cluster. When all deliverables in the active milestone are delivered and closed, plan_close schedules a release cut and invokes cut_release. However, the automated release process fails because cut_release attempts to push directly to release/vX.Y.Z (git push --force-with-lease -u origin release/vX.Y.Z), which is blocked by GitHub ruleset 23059172 requiring all changes to release/* to be made via pull request (GH013).

Details & Root Causes

  1. Direct Push Blocked by Ruleset 23059172:
    GitHub branch ruleset 23059172 enforces pull request requirements on refs/heads/release*/**/*. Direct pushes from automated background jobs fail with remote: error: GH013: Repository rule violations found for refs/heads/release/vX.Y.Z. Changes must be made through a pull request.
  2. Missing Changelog Collation in Cut Sequence:
    _apply_cut_modifications bumps versions across pyproject.toml, __init__.py, k8s/devops/kustomization.yaml, and uv.lock, but does not collate changelog.d/ fragments into CHANGELOG.md.
  3. Repository Invariant Alignment:
    AGENTS.md enforces that all changes intended for main or release/* branches must be committed via pull requests. Automated release choreography should adhere to this or support proper release bot credentials/bypass.

Acceptance Criteria

  • roadmap-service and cut_release automate release preparation (version bump, changelog fragment collation, service image tag pinning, docs sync) without violating branch protection rules.
  • If branch protection requires PRs on release/*, automated release preparation creates a dedicated preparation PR or uses an authorized bypass actor.
  • The release pull request from release/vX.Y.Z into main is reliably created by roadmap-service once the release branch is ready.

Update 2026-10-08: owner decision, reduced scope

Decision (owner, 2026-10-08): ruleset bypass, not a preparation PR.

Person step, done once by the owner:

  • In Settings → Rules → Rulesets, open the ruleset that covers release* (ruleset 23059172) and add a bypass entry for the repository role the machine account holds (Write), mode Always.
  • A user can't be listed by name on a personal repository's ruleset. So every Write collaborator can bypass; today the machine account is the only one.

Reduced acceptance criteria (code side):

  • Every way the cut can fail raises a typed DevOpsCLIError that names its cause, so the Service's failure record says why instead of a bare typer.Exit(1): the push, the fetch, _verify_clean_tree, the missing-ref rev-parse in _fetch_remote_release_tip, and PR creation.
  • A push refused by a ruleset (GH013) gets its own message: it names the ruleset refusal and the bypass step above.
  • Docs are in sync with the decision: HELP.roadmap.close and the README and docs pages generated from it, the close and cut messages, RELEASE_CYCLE.md or k8s/README.md where the Service's release cut is described (the bypass requirement), and changelog.d/1124.md's note that deferred the push target to this item.
  • Tests are offline: a real-git test where a local pre-receive hook prints a GH013-style refusal shows the typed error and message. Each call phase stays under 1 s, uv run devops ci passes, and changelog.d/1280.md records the change.
  • Pending a person, after the bypass is set and the Service runs an image with this fix: the next automatic cut pushes release/vX.Y.Z, and Loki shows no GH013.

Out of scope: making Static Analysis and Tests & Coverage required checks on the rulesets is #842's owner step, not this item's.

Activity

  1. added this to the v0.2.29 milestone on Oct 7, 2026
  2. added
    bug
    scope/k8s
    priority/p1-high
    type/bug
    on Oct 7, 2026
  3. dan-petty-bot commented on Oct 7, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item kept in v0.2.29: a person placed it in v0.2.29, and that placement stands.

    • Priority: P2-Medium. It blocks the entire automated release-cutting path, but a manual workaround (creating the PR by hand) exists, so it is not a P1 outage.
    • Value: High. Automated release cutting is a core workflow; without it every release requires manual intervention.
    • Effort: Medium. Requires reworking cut_release to open a preparation PR (or use an authorized bypass actor) and updating roadmap-service choreography, plus changelog collation.
  4. dan-petty commented on Oct 7, 2026

    @dan-petty
    OwnerAuthor

    Solution Design: Standard Branch Flow & PR Gate Alignment

    To resolve the automated release cutting failure without violating GitHub ruleset 23059172 (which blocks direct pushes to release/*), the following changes are planned:

    1. Exempt Release Preparation PRs in PR Readiness ():

      • Update CONST_RELEASE_PROCESS_BRANCH_RE in src/devops_cli/config/constants.py to match both cycle-open and preparation branches:
        CONST_RELEASE_PROCESS_BRANCH_RE: Final[re.Pattern[str]] = re.compile(
            r"chore/(?:open|prepare)-v(?P<version>\d+\.\d+\.\d+)(?:-[^/\s]+)?"
        )
      • This allows devops pr check-readiness to recognize chore/prepare-vX.Y.Z targeting release/vX.Y.Z as an authorized process PR, exempting it from single-issue grounding (Closes #N) and permitting updates to CHANGELOG.md and ROADMAP.md.
    2. Refactor cut_release / roadmap-service Release Choreography:

      • Instead of checking out release/vX.Y.Z and attempting git push --force-with-lease origin release/vX.Y.Z, cut_release will:
        1. Checkout topic branch chore/prepare-vX.Y.Z from origin/release/vX.Y.Z.
        2. Collate changelog.d/*.md into CHANGELOG.md and delete fragments.
        3. Bump version in pyproject.toml, uv.lock, and k8s/devops/kustomization.yaml.
        4. Sync docs freshness (devops docs generate --sync-readme).
        5. Commit and push chore/prepare-vX.Y.Z to origin.
        6. Open a pull request targeting base release/vX.Y.Z with title chore(release): prepare vX.Y.Z.
      • Once merged into release/vX.Y.Z, the clean release PR from release/vX.Y.Z into main (feat(release): vX.Y.Z) is created.
    3. Documentation Updates:

      • Align RELEASE_CYCLE.md and docs/ROUTINE_TASKS.md to document this explicit lifecycle.
  5. removed this from the v0.2.29 milestone on Oct 8, 2026
  6. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Moved to the backlog: it was New, not Ready, when v0.2.29 started. (devops roadmap reprioritize)

  7. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Evidence from Loki for the 48 h to 2026-10-08 01:18 UTC: 23 Roadmap job close failed records end in typer.exceptions.Exit: 1. cut_release prints the push error and raises typer.Exit(1) (commands/release.py:1197-1198), so the error that matters appears only as an unstructured console line ('Failed to push ... to origin'), with no level, repository or job. Proposed addition to this item: when cut_release runs in the close job, it raises a DevOpsCLIError that carries the push error, so the Service's failure record names it (#1365 carries each job's error into that record).

  8. added this to the v0.2.29 milestone on Oct 8, 2026
  9. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Placed in v0.2.29 by the owner on 2026-10-08. The owner's instruction was to pull every issue that keeps the roadmap service from working into the current milestone and complete them. This is a person's placement and should stay in the release (#1349). Implementation started the same day, so the board Status is In Progress.

  10. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Assigned to the Gemini agent on 2026-10-08 for v0.2.29. Build the reduced scope in the "Update 2026-10-08: owner decision" section at the end of the body; the drafted designs in earlier comments are superseded by it. One PR into release/v0.2.29 that closes only #1280, with its task file and changelog.d/1280.md, and uv run devops ci passing.

  11. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1410, merged into release/v0.2.29 as 05e9388.

    Resolves #1280

    15 file(s) changed.

    How it was verified

    Check runs at 72586ea:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1280-roadmap-release-cut-ruleset-bypass.md:

    • Every failure mode in cut_release raises a typed DevOpsCLIError subclass naming its cause: dirty working tree (ReleaseWorkingTreeDirtyError), remote fetch failure (ReleaseRemoteFetchError), missing tracking ref (ReleaseBranchMissingError), ruleset push refusal (ReleasePushRefusedError), general push failure (ReleasePushError), and PR creation failure (ReleasePRCreationError).
    • Push refused by repository ruleset (GH013) raises ReleasePushRefusedError and diagnoses the refusal, naming the Write role bypass requirement on ruleset 23059172 in Settings → Rules → Rulesets.
    • Documentation in sync: HELP.roadmap.close and generated reference docs, RELEASE_CYCLE.md, k8s/README.md, and changelog.d/1124.md updated with the ruleset bypass architecture.
    • Offline tests with real git pre-receive hook simulating GH013 ruleset refusal verify the typed error, message diagnostics, and timeout boundaries (< 1 s per call phase).
    • All 14 checks in uv run devops ci pass with 100% success.
    • Pending a person: In Settings → Rules → Rulesets, open ruleset 23059172 covering release* and add a bypass entry for the repository role the machine account holds (Write), mode Always. Verify that the next automated cut pushes release/vX.Y.Z without ruleset refusal.
  12. added a commit that references this issue on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority/p1-highscope/k8stype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions