Add landing orchestration workflows#42
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1867aebd3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79b517c2b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d2c86fe6e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if landing.LandingPRNumber > 0 { | ||
| pr, err := runtime.GitHub.ViewPR(runtime.Context, landing.LandingPRNumber) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return []store.PullRequest{pr}, nil |
There was a problem hiding this comment.
Re-resolve landing PR when recorded PR number is stale
When LandingPRNumber is set, resolveLandingPRs returns that PR unconditionally and never falls back to head-branch discovery. If the recorded PR was closed/replaced (a common recovery path), queue, supersede, and closeout will operate on or block on the stale PR even when a unique open PR exists for the landing branch, which breaks the main landing workflow until users manually edit local state.
Useful? React with 👍 / 👎.
| if !ticketRefPattern.MatchString(trimmed) { | ||
| return nil, fmt.Errorf("invalid ticket reference %q", trimmed) | ||
| } | ||
| normalized := strings.ToUpper(trimmed) |
There was a problem hiding this comment.
Enforce full ticket token validation in --ticket parsing
parseTicketRefs uses ticketRefPattern.MatchString, which accepts partial matches, then stores the full token. Inputs like ABC-123/extra or fooABC-1 pass validation and are persisted as ticket refs, so closeout metadata can contain malformed ticket IDs even though the command claims to validate explicit ticket references.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02909ed732
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pr, err := runtime.GitHub.ViewPR(runtime.Context, number) | ||
| if err != nil { | ||
| return supersedePlan{}, err | ||
| } | ||
| plan.SupersededPRs = append(plan.SupersededPRs, pr) |
There was a problem hiding this comment.
Validate superseded PRs belong to landing source branches
buildSupersedePlan accepts any PR numbers passed via --prs and records them as superseded without checking that their heads are among the landing record’s SourceBranches. In this flow, a typo or stale PR number is treated as valid, and closeout --apply later uses that recorded list to close those unrelated open PRs automatically. Add a guard here to reject PRs whose HeadRefName is not part of the composed source branch set before persisting supersede metadata.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2fbc0475df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pr := prs[0] | ||
| return queuePlan{}, false, fmt.Errorf("branch %q is part of landing batch %q; queue landing PR #%d instead and keep source PRs out of the merge queue", branch, landingBranch, pr.Number) |
There was a problem hiding this comment.
Skip historical landing batches when queueing source branches
buildSourceLandingQueuePlan always rejects queueing a source branch once it appears in any landing record, even when the only landing PR is already MERGED/CLOSED. Because landing records are persisted and never pruned in this commit, a branch that later gets new commits and a new PR remains permanently blocked with "queue landing PR" guidance that can be impossible to follow; this prevents normal queue handoff after a completed or abandoned landing batch.
Useful? React with 👍 / 👎.
Summary
stack composeable to push and open or refresh the landing PR, and makestack closeout --applyclose superseded PRs after landing mergestack queuelanding-aware and verification-aware so source PRs stay out of queue once a landing batch existsVerification
mise exec -- go test ./...mise exec -- go build ./...mise exec -- go run ./tools/gendocsscripts/sandbox/seed-fixtures.sh && scripts/sandbox/run-live-queue.sh && scripts/sandbox/report-fixtures.shwithGH_TOKENpinned toroodboi