Skip to content

fix(ci): recover promotion of manually merged release PRs - #1992

Merged
gerchowl merged 4 commits into
devfrom
bugfix/1990-promote-merged-release-pr
Nov 3, 2026
Merged

gerchowl merged 4 commits into
devfrom
bugfix/1990-promote-merged-release-pr

Conversation

@gerchowl

@gerchowl gerchowl commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Recover promote-release when an approved release PR was merged manually and its branch deleted. Both devkit gates prefer an open PR, then accept exactly one merged PR only after verifying approval and that its merge commit and release tag are ancestors of main. Recovery works when dispatched from main or dev.

Type of Change

  • fix -- Bug fix

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • Share the PR lookup and merged recovery checks between validate and merge.
  • Require an approval on the final head when merged PR reviewDecision is empty.
  • Skip mergeability and pending checks for merged PRs; retain failed and successful CI checks and all other validation.
  • Skip the completed merge while keeping merge success and cleanup scheduling.
  • Document recovery, including the instruction to avoid manual release PR merges.
  • Scope workflow changes to devkit; consumer gates retain their separate protection-aware behavior.

Changelog Entry

Fixed

  • Recover promotion after a manually merged release PR (#1990)
    • Verify approval and main ancestry, skip the completed merge, and allow recovery from main or dev after branch deletion.

Testing

  • Tests pass locally (targeted workflow suites; no full local suite)
  • Manual testing performed (describe below)

uv run --with pytest-xdist pytest tests/test_ci_green_gate.py tests/test_workflow*.py tests/test_github_expression.py tests/test_promote*.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1990: 766 passed, exit 0, including 31 recovery cases covering the shared script and both workflow gates.

Committed RED first: the initial recovery suite failed with exit 1 (four failures). The tests execute the shared gate and both workflow step bodies with isolated GitHub responses.

The first CI run exposed an isolated CI-gate fixture missing PR_STATE; the fixture now supplies it and explicitly tests merged PR pending/failed verdicts.

actionlint .github/workflows/promote-release.yml, shellcheck .github/scripts/find-release-pr.sh, and repository commit hooks pass, exit 0.

Manual Testing Details

Read-only GitHub queries confirm PR #1969 is merged and approved, its merge commit is on main (identical), and tag 1.18.1 is an ancestor of main (ahead). No workflow was dispatched.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • I have updated CHANGELOG.md in the Unreleased section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

The changelog mirror is generated by the required sync-manifest hook. No merge or workflow dispatch is part of this PR.

Refs: #1990

@gerchowl
gerchowl requested a review from c-vigo as a code owner November 3, 2026 09:16
@gerchowl
gerchowl force-pushed the bugfix/1990-promote-merged-release-pr branch from 10439e3 to 305497a Compare November 3, 2026 09:24
@gerchowl
gerchowl merged commit f00c430 into dev Nov 3, 2026
16 checks passed
@gerchowl
gerchowl deleted the bugfix/1990-promote-merged-release-pr branch November 3, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant