Skip to content

fix(ci): refresh.sh resets the train's worktree before checking out the next PR - #338

Merged
DrunkOnJava merged 1 commit into
mainfrom
fix/refresh-clean-worktree
Oct 26, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
fix/refresh-clean-worktree

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

A dry refresh, or a refresh that fails after regenerating tools/corpus/baseline.tsv or docs/spec-coverage.md, leaves those files modified in the train's worktree. git merge --abort only undoes a merge in progress, so the next git checkout --detach origin/<branch> refuses whenever the next PR differs in one of those files, and the train stops on that PR with exit 2. The worktree belongs to the train (TRAIN_WORKTREE), so refresh.sh now runs git reset --hard there before every checkout. Fixes the first #298 review thread; the other two are in #336.

Spec reference

None; repository tooling (merge train, #298).

Test plan

  • bash -n tools/maintainer/train/refresh.sh.
  • E2E in a throwaway worktree at origin/main with ARCHITECTURE.md and baseline.tsv modified, as a dry refresh leaves them. Without the reset, checking out origin/fix/71-leader fails: "Your local changes ... would be overwritten by checkout: ARCHITECTURE.md". With git merge --abort; git reset --hard first, the checkout succeeds (head 1afeacb, 0 dirty files).

Source-provenance declaration

Written for this repository; no external source consulted.

…he next PR

A dry refresh, or one that failed after regenerating the baseline or the
coverage page, left those files modified, and git merge --abort does not
touch them; the next checkout then refused (#298 review).
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 26, 2026 17:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T17:57:54.157092Z 9fc8f9d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DrunkOnJava
DrunkOnJava merged commit b611074 into main Oct 26, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/refresh-clean-worktree branch October 26, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant