fix: seed hotfix resolution-PR labels before gh pr create - #199
Merged
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
The gitea e2e backend creates PR labels on demand, masking the real GitHub behavior where gh pr create --label fails on a missing label. Assert against the materialized cascade-hotfix.yaml that the apply job seeds both labels and requests issues:write, so a regression in the seed step or permission is caught by the conflict-resolution scenario. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The generated cascade-hotfix workflow opens its resolution PR on the cherry-pick conflict path with
gh pr create --label cascade-hotfix-conflict, but that label is never created.gh pr create --label Xfails hard when X does not exist, so any conflicting cherry-pick dies at the "Cherry-pick and open resolution PR" step and no resolution PR opens. The clean path (--label cascade-hotfix) had the same latent exposure: the only label seed was an operator-pasted suggestion from the plan verb, never run by the workflow itself.Fix
gh label create cascade-hotfixandgh label create cascade-hotfix-conflict(each|| truefor idempotency) before any PR is opened.issues: writeon the workflow.gh label createhits the labels API and returns 403 without it; combined with|| truethat would silently no-op and leave the bug intact.gh pr createconsumer cannot drift.Verification
go build ./...,go test ./...(1396 pass),golangci-lint run ./...clean.go build+go vetclean.TestHotfixGenerator_SeedsLabelsasserts both label seeds render and the seed step precedes the cherry-pick step; confirmed failing before the fix, green after.workflow_filesassertion in the existing conflict-resolution scenario that the materialized cascade-hotfix.yaml seeds both labels and requestsissues: write.