Skip to content

fix(ra): treat a missing ref as absent when deleting a branch - #490

Merged
hdamker merged 1 commit into
camaraproject:release-automation-refactorfrom
hdamker:fix/ra-delete-missing-branch
Oct 23, 2026
Merged

hdamker merged 1 commit into
camaraproject:release-automation-refactorfrom
hdamker:fix/ra-delete-missing-branch

Conversation

@hdamker

@hdamker hdamker commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

bug

What this PR does / why we need it:

GitHubClient.delete_branch treated only 404 / "not found" as a missing branch. GitHub answers a DELETE on a nonexistent ref with HTTP 422 "Reference does not exist", so the call raised. preserve_review_branch deletes <review>-preserved first to replace an older copy; for a snapshot id that was never discarded before, that raised, the rename was skipped (Could not rename review branch) and /discard-snapshot still reported success. The branch canary on ReleaseTest2 failed at "verify post-discard" for this reason; the earlier green run only passed because a -preserved branch already existed.

delete_branch now returns False for that response and still raises on other errors.

Which issue(s) this PR fixes:

Part of #476

Special notes for reviewers:

Targets release-automation-refactor. The same call is used when deleting the snapshot and review branches in the publish path.

Changelog input

 release-note

Additional documentation

docs

GitHub answers a DELETE on a nonexistent ref with 422 "Reference does not exist", not 404. The first discard of a snapshot id therefore failed to rename the review branch to -preserved.
@hdamker
hdamker requested review from Kevsy and rartych as code owners October 23, 2026 20:38
@hdamker
hdamker merged commit a37b33e into camaraproject:release-automation-refactor Oct 23, 2026
8 checks passed
@hdamker
hdamker deleted the fix/ra-delete-missing-branch branch October 23, 2026 20:42
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