fix: sync_branch_protection_contexts never falls back to (push) suffixes #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/fix-branch-protection-push-suffix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary\n\nFixes the branch protection sync function that would write
(push)suffixed check names when a branch had no(pull_request)contexts. This created a deadlock: PRs report(pull_request)checks but protection requires(push)checks, so auto-merge can never fire.\n\n## Root Cause\n\nWhensync_branch_protection_contexts()ran on a branch that had only been pushed to (no PRs yet), thepr_contextsfilter returned empty, and the fallback wroteraw_contexts(which included(push)suffixes) to branch protection.\n\n## Fix\n\nReturn early withreason=no_pull_request_contexts_on_headwhen no(pull_request)contexts exist, instead of falling back to(push)contexts. Branch protection gates PRs, not pushes, so(push)contexts are never correct.\n\n## Impact\n\n- bug-reporter: 9 PRs stuck for 3 days (branch protection patched manually)\n- heyco: branch protection patched manually\n- Fleet-wide: prevents recurrence on any newly wired repo\n\nBumps haskytech-forgejo to 0.1.1.