fix(scripts): never abandon a detached local commit; model the dry-run relock after a nested server bump - #1450
Conversation
…n relock after a nested server bump Follow-up to #1447 (Codex findings that landed after the merge): - a clean submodule detached at a commit not on origin/master was flagged DIVERGED in the preflight table ("will NOT be moved") but ff_master only checked the local master branch, so `checkout master` abandoned the commit. ff_master now refuses any HEAD with commits outside origin/master. - under --dry-run, a nested pointer bump inside aw-server-rust means the real run relocks aw-tauri to a server commit that does not exist yet; the preview reported the old lock as aligned and omitted both the lock commit and the aw-tauri pointer. It now says so and counts aw-tauri as moved. Verified on a scratch clone: aw-core detached on a local commit is left alone; a synthetic aw-webui commit under aw-server-rust yields "would relock" and a 2-pointer bundle plan. The real bundle moves nothing.
|
@greptileai review |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 111485560e
ℹ️ 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 [ "$PAIR_FIXED" = 1 ]; then | ||
| echo " aw-tauri or aw-server-rust is skipped/held; judging the lock at the pointers to be committed (aw-tauri ${TAURI_REV:0:7}, aw-server-rust ${SERVER_SHA:0:7})" | ||
| if lock_at_server; then LOCK_ALIGNED=1; echo " aligned"; fi | ||
| elif [ "$DRY" = 1 ] && dry_bumped aw-server-rust; then |
There was a problem hiding this comment.
Honor --no-push when previewing nested server bumps
When the script is invoked with both --dry-run and --no-push, a nested change in aw-server-rust enters this branch before the existing PUSH=0 check. It therefore reports that the lock and aw-tauri pointer would be committed and marks the pair aligned, while an actual --no-push run skips relocking because the newly created server commit is local-only, leaving both bundle pointers out. Require pushing in this branch or process the PUSH=0 case first so the preview matches the requested mode.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in f517178: the preview branch now also requires PUSH=1, so --dry-run --no-push falls through to the existing "cargo can only relock to a revision on GitHub" warning, matching what the real --no-push run does. Verified on the scratch clone in both modes.
There was a problem hiding this comment.
Correction to my previous reply: f517178 was not enough — with the preview branch skipped, the chain reached lock_at_server (judged at the old origin/master revision) and reported "already aligned", while the real --no-push run fails alignment against the new local commit and withholds both pointers. 01ce54e handles a dry-bumped aw-server-rust before that check in both modes: with pushing, "would relock"; under --no-push, the same refusal the real run gives, and both pointers stay out of the plan. Verified on the scratch clone: --dry-run --no-push now shows the warning and no bundle commit; --dry-run shows the relock and a 2-pointer plan.
|
| elif [ "$DRY" = 1 ] && dry_bumped aw-server-rust; then | ||
| # Step 1 would commit a nested pointer in aw-server-rust, so the real | ||
| # run relocks to a commit that does not exist yet. | ||
| echo " [dry-run] aw-server-rust would get a new commit (nested bump); would relock aw-tauri to it and commit the lock" | ||
| LOCK_ALIGNED=1 | ||
| DRY_BUMPED="$DRY_BUMPED aw-tauri" |
There was a problem hiding this comment.
No-push preview overstates changes
When --dry-run and --no-push are combined with a nested aw-server-rust bump, this branch marks the lock aligned and aw-tauri moved before considering that pushing is disabled. The preview therefore includes both pointers, while the equivalent real run skips relocking and excludes them, making the plan inaccurate.
| elif [ "$DRY" = 1 ] && dry_bumped aw-server-rust; then | |
| # Step 1 would commit a nested pointer in aw-server-rust, so the real | |
| # run relocks to a commit that does not exist yet. | |
| echo " [dry-run] aw-server-rust would get a new commit (nested bump); would relock aw-tauri to it and commit the lock" | |
| LOCK_ALIGNED=1 | |
| DRY_BUMPED="$DRY_BUMPED aw-tauri" | |
| elif [ "$DRY" = 1 ] && dry_bumped aw-server-rust; then | |
| # Step 1 would commit a nested pointer in aw-server-rust, so the real | |
| # run relocks to a commit that does not exist yet unless pushing is disabled. | |
| if [ "$PUSH" = 0 ]; then | |
| warn "skipped: cargo can only relock to a revision on GitHub, and --no-push would leave the new aw-server-rust commit local-only" | |
| else | |
| echo " [dry-run] aw-server-rust would get a new commit (nested bump); would relock aw-tauri to it and commit the lock" | |
| LOCK_ALIGNED=1 | |
| DRY_BUMPED="$DRY_BUMPED aw-tauri" | |
| fi |
There was a problem hiding this comment.
Fixed in 01ce54e: a dry-bumped aw-server-rust is handled before the lock check in both modes — with pushing, "would relock aw-tauri"; under --no-push, the same refusal the real run gives (cargo can only relock to a revision on GitHub) and both pointers stay out of the plan. Verified on a scratch clone with a synthetic nested aw-webui commit: --dry-run --no-push shows the warning and no bundle commit.
…ng, like the real relock Under --dry-run --no-push a nested aw-server-rust bump previewed a lock commit and an aw-tauri pointer move that a real --no-push run cannot make (cargo can only relock to a revision on GitHub). The preview now falls through to the same warning.
… the relock refusal, not the stale lock The previous commit only skipped the relock preview; the chain then reached lock_at_server, judged at the old origin/master revision, and reported the lock as already aligned. The real --no-push run relocks against the new local commit, fails, and withholds both pointers. The preview now says the same.
|
@greptileai review |
Follow-up to #1447 for the two Codex findings that arrived after it merged.
origin/masteras DIVERGED and promised not to move it, butff_masteronly checked the localmasterbranch —git checkout masterthen dropped the commit. Now refuses any HEAD with commits outsideorigin/master.Verified on a scratch clone (aw-core detached on an empty local commit → left alone; synthetic aw-webui commit under aw-server-rust → "would relock", 2-pointer bundle plan) and on the real bundle (every submodule HEAD identical before/after
--dry-run).