fix(ci): rebase merge actualizations - #200
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb4e1208fc
ℹ️ 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".
| } | ||
| trap rollback EXIT | ||
|
|
||
| git push --force-with-lease="refs/heads/main:$EXPECTED_MAIN_SHA" origin "$UPSTREAM_SHA:refs/heads/main" |
There was a problem hiding this comment.
Avoid pushing the bare upstream tree to main
On every actualization this force-push exposes the bare UPSTREAM_SHA as main, so GitHub processes a real push against upstream's workflow tree before the rebase merge restores the fork CI layer. At the recorded upstream base 08c715ed, .github/workflows/deploy-relay.yml contains an unconditional push-to-main production deployment, whereas the fork replacement at .github/workflows/deploy-relay.yml:18-20 deliberately disables it; the GitHub App installation token used here does not suppress workflow-triggering events. An actualization can therefore enqueue fork-disabled production automation from the transient commit, and neither the subsequent merge nor rollback cancels those jobs. Avoid making the bare upstream tree observable at main, or explicitly prevent its workflows from running during this move.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 85de6ea. Promotion now moves main to the first fork automation commit, after verifying that it replaces upstream .github content and that later commits do not change .github. The bare upstream workflow tree is never exposed on main.
| if [[ "$base_moved" == true ]]; then | ||
| if git push --force-with-lease="refs/heads/main:$UPSTREAM_SHA" origin "$EXPECTED_MAIN_SHA:refs/heads/main"; then | ||
| gh pr ready "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --undo || true |
There was a problem hiding this comment.
Restore draft state when the base move fails
If the leased push fails—for example, because another main update wins after the earlier SHA check—the PR has already been made ready, but base_moved is still false, so this trap skips gh pr ready --undo. The local gh pr ready --help documents that the command marks a PR ready and that --undo converts it back to draft; consequently another /promote is rejected by the draft guard at line 45 until someone manually converts the PR. Track readiness separately and undo it on every pre-merge failure.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 85de6ea. Readiness and the base move are tracked separately, so every failure after marking ready returns the PR to draft, including a leased base-push failure.
fb4e120 to
85de6ea
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85de6ea704
ℹ️ 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".
|
|
||
| gh pr ready "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" | ||
| ready_changed=true | ||
| git push --force-with-lease="refs/heads/main:$EXPECTED_MAIN_SHA" origin "$PROMOTION_BASE_SHA:refs/heads/main" |
There was a problem hiding this comment.
Prevent deployments from the transient base push
When an actualization changes any mobile path, this force-push is itself a main push from the old fork tip to the first fork-only commit. The checked .github/workflows/mobile-eas-production.yml:55-74,237-285 handles that as a non-canceling production run which may schedule store builds or publish fingerprint-matched OTAs, even though this commit intentionally precedes the remaining reviewed fork commits. The subsequent rebase merge only queues another run; it cannot stop the first run from deploying the transient tree, so gate production workflows during promotion or avoid exposing the intermediate commit as a push.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 3b9a7cc. The workflow now creates a synthetic commit with the reviewed first-fork tree, the upstream parent, and [skip ci] in its message. GitHub therefore skips push workflows for the transient base. A local seven-commit simulation dropped the equivalent first patch, rebased the remaining six commits, and produced the exact reviewed final tree.
85de6ea to
3b9a7cc
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b9a7cc7a2
ℹ️ 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".
| concurrency: | ||
| group: history-promotion | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
Serialize promotion with upstream synchronization
Because this concurrency group differs from sync-upstream-main, a sync can start as soon as the merge API closes the actualization PR and the sync gate no longer sees an open PR. It can then advance upstream/main before lines 314-319 validate against that live ref, making a valid promotion fail, or replace actualization/incoming before line 347 deletes it, causing the promotion run to delete the next actualization head. Use a shared concurrency group or validate/delete immutable recorded SHAs with leases.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 83621c5. Sync and promotion now share the fork-history-mutation concurrency group, and both use cancel-in-progress: false. A sync cannot start until promotion finishes validation and deletes the old head, and it cannot cancel an active promotion.
3b9a7cc to
83621c5
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83621c5180
ℹ️ 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".
| echo 'The first fork commit is not directly based on upstream/main.' >&2 | ||
| exit 1 | ||
| fi | ||
| if git diff --quiet "$UPSTREAM_SHA" "$first_fork_sha" -- .github; then |
There was a problem hiding this comment.
Verify the upstream workflows are actually replaced
When upstream adds a push-to-main workflow and the rebuilt first fork commit leaves it intact while changing any other .github file, this test passes because it proves only that the aggregate .github diff is nonempty, not that upstream automation was replaced. The fresh evidence after the earlier fix is that the new guard still accepts such a partial delta, allowing the final, non-skipped rebase-merge push to run the retained upstream workflow; validate the intended fork workflow tree or required removals instead.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c160698. Promotion now requires the first fork commit to preserve the exact .github/workflows tree from the recorded pre-actualization main. This rejects both newly retained upstream workflows and same-name upstream workflow contents. Later .github changes remain forbidden.
| - name: Prepare actualization PR head | ||
| if: steps.upstream.outputs.upstream_sha != steps.upstream.outputs.current_sha | ||
| run: git push --force origin "refs/remotes/origin/main:refs/heads/actualization/incoming" | ||
| run: git push --force origin "refs/remotes/upstream/main:refs/heads/actualization/incoming" |
There was a problem hiding this comment.
Point the PR head at the selected upstream SHA
When workflow_dispatch supplies a target_sha older than the live upstream tip, the workflow updates the mirror and PR marker to that selected SHA but pushes refs/remotes/upstream/main, which line 62 populated from the live tip, into actualization/incoming. The resulting PR therefore starts from a different commit than its recorded validation base and may fail promotion or rebuild against the wrong upstream revision; push $UPSTREAM_SHA as the source instead.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c160698. The incoming head is now pushed from the selected UPSTREAM_SHA output, so a pinned target_sha and the PR marker/head cannot diverge from the fetched live tip.
83621c5 to
c160698
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c160698960
ℹ️ 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".
| --repo "$GITHUB_REPOSITORY" \ | ||
| --draft \ | ||
| --base upstream/main \ | ||
| --base main \ |
There was a problem hiding this comment.
Keep conflicted actualizations eligible for CI
When an upstream update conflicts with a maintained fork patch, the rebuilt head is based on the new upstream history while main remains on the old history, so this --base main PR can remain merge-conflicted even after the rebase conflicts were resolved. GitHub does not run pull_request workflows for conflicted PRs; the inspected .github/workflows/ci.yml and .github/workflows/history-validation.yml use that event, while .github/workflows/promote-history.yml:152-172 refuses promotion without successful head checks and only moves main afterward. Such actualizations therefore cannot reach the rebase-merge step; run validation independently of PR mergeability or retarget to main only after the checks.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f664d45. Actualization PRs remain based on upstream/main for review and CI. Only after all checks and history validation pass does promotion mark the PR ready, retarget it to main, move main to the safe base, and rebase merge.
| status=$? | ||
| trap - EXIT | ||
| if [[ "$base_moved" == true ]]; then | ||
| if ! git push --force-with-lease="refs/heads/main:$PROMOTION_BASE_SHA" origin "$EXPECTED_MAIN_SHA:refs/heads/main"; then |
There was a problem hiding this comment.
Suppress production workflows on the rollback push
When the merge API fails after base_moved becomes true, this force-push restores the old main commit, whose message lacks [skip ci]. Fresh evidence after the earlier transient-base fix is this second push: the current fork stack differs from the workflow-safe first commit across apps/mobile, packages/client-runtime, and packages/contracts, so .github/workflows/mobile-eas-production.yml:55-74 treats the rollback as a non-canceling production push and may schedule store builds or OTAs even though promotion failed. Gate production automation during rollback rather than suppressing only the forward base move.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f664d45. Rollback now force-pushes a replacement commit with the exact previous-main tree and parent plus [skip ci], so rollback cannot trigger production workflows. It restores the upstream PR base and draft state, then updates the recorded main SHA for retry.
c160698 to
f664d45
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f664d45c80
ℹ️ 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".
| response="$( | ||
| gh api --method PUT "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/merge" \ | ||
| -f merge_method=rebase \ | ||
| -f sha="$HEAD_SHA" |
There was a problem hiding this comment.
Guard the base SHA through the rebase merge
If another feature merge or manual update reaches main after the leased push on line 335 but before this request, promotion can rebase onto that unexpected commit: the REST endpoint's sha field guards only the pull request head, not the base (GitHub: Merge a pull request). The shared workflow concurrency group does not serialize ordinary merges, and the subsequent validator accepts additional linear fork commits, so this can complete with history other than the reviewed stack; pin or recheck main == $PROMOTION_BASE_SHA at the merge boundary.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in cbaa718. Promotion waits until both the PR base SHA and remote main equal the synthetic safe base, then rechecks remote main immediately before calling the merge endpoint. Any mismatch enters the workflow-safe rollback path.
| - name: Verify promoted actualization history | ||
| if: steps.pr.outputs.kind == 'actualization' | ||
| run: | | ||
| set -euo pipefail | ||
| git fetch --force --no-tags origin \ |
There was a problem hiding this comment.
Preserve finalization after the merge succeeds
If this post-merge fetch or validation fails transiently, the merge has already closed the PR and line 350 has disabled rollback, but GitHub Actions skips the later finalization step; the temporary head is therefore left behind and no promotion comment is posted. Rerunning the job cannot recover because it restarts at the draft guard and rejects the already-merged PR, so cleanup should run independently after a successful merge.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in cbaa718. The finalization step now uses always() after a successful merge, reports the post-merge validation outcome, and deletes the temporary head even when that validation step fails.
f664d45 to
cbaa718
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbaa718ccc
ℹ️ 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".
| trap - EXIT | ||
| rollback_main_succeeded=false | ||
| if [[ "$base_moved" == true ]]; then | ||
| if git push --force-with-lease="refs/heads/main:$PROMOTION_BASE_SHA" origin "$ROLLBACK_SHA:refs/heads/main"; then |
There was a problem hiding this comment.
Serialize all main writers before moving the base
When a normal PR merge or allowed manual update advances main after the synthetic-base push, the Rebase merge actualization guard can detect the change and exit, but this rollback is then guaranteed to fail because --force-with-lease="refs/heads/main:$PROMOTION_BASE_SHA" requires the remote ref to remain at that exact SHA (git push -h: “require old value of ref to be at this value”). The competing commit is based on only the first fork commit, so main remains on an incomplete actualization and that competing push can run production workflows; the concurrency group serializes sync and promotion workflows but not ordinary GitHub merges, so all main writers must be excluded during this interval or the rollback must safely preserve the concurrent update.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 794e7bf by removing the intermediate main update entirely. The safe base now lives on actualization/base-; GitHub rebase-merges there first, and only the complete staged result is force-pushed to main with the recorded-main lease. A concurrent main writer therefore causes a clean lease failure while main remains complete, and the staged result is preserved.
cbaa718 to
794e7bf
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 794e7bf63e
ℹ️ 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".
| fi | ||
| promoted_sha="$(jq -r .sha <<<"$response")" | ||
| merged_to_staging=true | ||
| git push --force-with-lease="refs/heads/main:$EXPECTED_MAIN_SHA" origin "$promoted_sha:refs/heads/main" |
There was a problem hiding this comment.
Fetch the rebased commit before pushing it
After every successful rebase merge, GitHub creates the resulting commits on the remote staging branch with new SHAs, so promoted_sha is not present in this checkout; a push refspec's source must resolve in the local repository (Git push documentation). Consequently this command fails with an unknown-source/refspec error, leaving main unchanged and every actualization requiring manual recovery. Fetch $staging_ref, verify its tip equals $promoted_sha, and then push the fetched commit.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 3b7d849. After GitHub rebase-merges, promotion fetches the staging branch into a remote-tracking ref, verifies its fetched tip equals the merge API SHA, and pushes that local commit to main with the recorded-main lease.
794e7bf to
3b7d849
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b7d849ad5
ℹ️ 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".
| VALIDATION_OUTCOME: ${{ steps.actualization_validation.outcome }} | ||
| run: | | ||
| set -euo pipefail | ||
| gh pr comment "$PR_NUMBER" --body "Promoted as $PROMOTED_SHA (actualization, rebase merge; post-merge validation: $VALIDATION_OUTCOME)." |
There was a problem hiding this comment.
Run branch cleanup before the fallible comment
If posting the promotion comment fails transiently, set -e exits this finalization step before either DELETE runs, leaving both temporary branches behind. Because the PR has already been merged, rerunning /promote is rejected by the draft guard, so the workflow cannot repair the cleanup even though the maintenance contract requires both branches to be removed; perform cleanup before the comment or guarantee it with a trap.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c86f485. Finalization now attempts both branch deletions before posting the comment, reports a failure if either cleanup call fails, and cannot leave branches behind because comment creation failed.
3b7d849 to
c86f485
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c86f485771
ℹ️ 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".
| git diff --name-status "$EXPECTED_MAIN_SHA" "$first_fork_sha" -- .github/workflows >&2 | ||
| exit 1 | ||
| fi | ||
| if ! git diff --quiet "$first_fork_sha" "$HEAD_SHA" -- .github; then |
There was a problem hiding this comment.
Inspect each commit for later .github changes
When a later fork commit changes a .github file and a subsequent commit reverts it, this endpoint-tree comparison reports no difference and permits promotion even though .github changes were not consolidated into the first fork commit as required by the actualization history contract. Inspect the per-commit changes in first_fork_sha..HEAD rather than comparing only the two final trees.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 757a1af. Promotion now lists .github paths changed by every commit after the first fork commit and rejects any result, so a later change hidden by a subsequent revert is still detected.
| response="$( | ||
| gh api --method PUT "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/merge" \ | ||
| -f merge_method=rebase \ | ||
| -f sha="$HEAD_SHA" | ||
| )" |
There was a problem hiding this comment.
Reconcile merge status before deleting staging
If GitHub completes the rebase merge but the connection drops before gh api returns its response, set -e invokes the trap while merged_to_staging is still false. The rollback then deletes the staging branch containing the completed rebased history, while the PR is already merged and cannot be retried because the initial draft guard rejects it. Before taking the destructive rollback path after a merge attempt, query the PR's merge state or otherwise preserve staging when the outcome is uncertain.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 757a1af. Once a merge request begins, the trap queries the PR before cleanup. A confirmed merge preserves staging; an unavailable PR state is treated as uncertain and also preserves staging and PR state. Destructive rollback runs only after GitHub confirms the PR is still unmerged.
c86f485 to
757a1af
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 757a1af9f0
ℹ️ 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".
| elif [[ "$preserve_staging" == true ]]; then | ||
| gh pr comment "$PR_NUMBER" --body "The rebase merge result could not be confirmed. The staging branch and PR state are preserved for recovery." || true |
There was a problem hiding this comment.
Block sync while an uncertain staging PR remains open
When the merge outcome cannot be fetched, this path leaves the PR open, ready, and based on actualization/base-*. The checked sync gate at .github/workflows/sync-upstream-main.yml:43 uses gh pr list --base upstream/main (gh pr list --help: “Filter by base branch”), so it will not detect this recovery PR after the shared concurrency lock is released. For the normal actualization/incoming head, the next upstream change can therefore advance the mirror and force-push that branch at line 112, replacing the reviewed head while the merge outcome remains unknown; gate on every open actualization PR, regardless of its temporary base.
AGENTS.md reference: AGENTS.md:L3-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 5ef2c98. Sync now gates on every open PR carrying the actualization label, independent of its base branch, so an uncertain staging or recovery PR continues to freeze both the mirror and incoming head.
757a1af to
5ef2c98
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ef2c98f9f
ℹ️ 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".
| gh api --method PATCH "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER" \ | ||
| -f base="$staging_ref" >/dev/null | ||
| base_changed=true |
There was a problem hiding this comment.
Reconcile an uncertain base retarget before cleanup
If GitHub applies this base change but the response is lost or times out, base_changed remains false, so the EXIT trap skips restoring upstream/main and then deletes the staging branch. This can leave the actualization PR targeting a deleted base (or cause GitHub to close it), despite the maintenance contract requiring failed promotion to restore the original PR state. Mark the retarget as attempted before the request or query the PR state before destructive cleanup.
AGENTS.md reference: AGENTS.md:L3-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 376fc9f. The staging-created, ready-changed, and base-changed flags are now set before their respective remote mutations. A lost response therefore takes the conservative cleanup path and restores the upstream base/draft state instead of deleting a possibly active staging base.
5ef2c98 to
376fc9f
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 376fc9fb2c
ℹ️ 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 [[ "$base_changed" == true ]]; then | ||
| gh api --method PATCH "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER" \ | ||
| -f base=upstream/main >/dev/null || true |
There was a problem hiding this comment.
Preserve staging until the PR base is restored
When a pre-merge failure enters rollback after the PR was retargeted, a transient or permission failure from this PATCH is discarded by || true, and rollback still deletes $staging_ref at line 318. The PR can then remain based on a deleted branch, making /promote ineligible and violating the failed-promotion guarantee to restore upstream/main; confirm the original base was restored, or preserve staging for recovery when restoration fails.
AGENTS.md reference: AGENTS.md:L3-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in b3482aa. Rollback now tracks whether both the original base and draft state were restored. It deletes staging only after both operations succeed; any restoration failure preserves staging and posts a recovery comment.
376fc9f to
b3482aa
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
b3482aa to
69d9fb8
Compare
What Changed
upstream/mainwhile their rebuilt heads run CI.mainandupstream/mainSHAs, required checks, and candidate history.mainwith a lease, then validated and cleaned up.Why
The old workflow force-pushed the reviewed head directly to
mainand closed the PR, so GitHub never recorded the actualization as merged. The temporary base lets GitHub perform a real rebase merge without exposing an incomplete history onmain.Verification
actionlintwithshellcheckChecklist
Implemented with GPT-5.6 Sol in T3 Code.