Repository navigation
docs: add snapshot update guidance for CLI help text changes - #1529
Conversation
The mention bot (run 23096056615) edited `after_long_help` in `src/cli/mod.rs` but didn't run the help snapshot tests before pushing, causing a preventable CI failure. It then tried 7 different approaches to update the snapshot before finding `INSTA_UPDATE=always`. Add explicit guidance in both CLAUDE.md and tests/CLAUDE.md so bots know to run `INSTA_UPDATE=always cargo test ... "test_help"` after editing help text, and to never manually edit .snap files. Co-Authored-By: Claude Opus 4.6 <[email protected]>
| use `INSTA_UPDATE=always`: | ||
|
|
||
| ```bash | ||
| INSTA_UPDATE=always cargo test --test integration "test_help" |
There was a problem hiding this comment.
cargo insta test --accept?
we should ensure cargo-insta is intalled in CI
There was a problem hiding this comment.
Good call — updated both files to use cargo insta test --accept instead. It's already installed in CI via the claude-setup action and ci.yaml, so no additional setup needed.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Looks good — clear, well-motivated docs addition. The bot's 7-attempt struggle in the #1521 run is good justification for adding this. One minor observation: the |
Two behavioral issues observed in the past hour's CI runs: 1. Triple approval on PR #1531 — each of 3 commits triggered a new review run, and each re-approved despite the prior approval covering the same PR. The trivial-change exit path said "skip steps 2-3" but didn't explicitly block step 4 (approval), so the bot re-approved on trivial incremental changes. 2. Self-approval attempts on PRs #1521 and #1529 — the bot attempted `gh pr review --approve` on its own PRs before discovering GitHub rejects self-approvals. The authorship check was buried in step 4 instead of being caught in pre-flight. Fixes: - Add IS_SELF_AUTHORED check to pre-flight (step 1) so the bot knows before reaching step 4 - Make trivial-change exit path explicitly skip steps 2, 3, AND 4 - Update step 4 self-authored guidance to reference the pre-flight flag Co-Authored-By: Claude Opus 4.6 <[email protected]>
Summary
INSTA_UPDATE=always cargo test ... "test_help"guidance to both CLAUDE.md and tests/CLAUDE.md for updating help snapshots after editingafter_long_helptext.snapfiles (they contain ANSI escape sequences)Evidence
In run 23096056615, the mention bot edited
after_long_helpinsrc/cli/mod.rsfor PR #1521 but only rancargo test --lib --binsbefore pushing. Thehelp_switch_longsnapshot test failed in CI, requiring a second commit.The bot then struggled through 7 approaches to update the snapshot:
cargo insta test --accept(didn't work for file-based snapshots in this context)sedcat -Ato examine raw bytesEditof the snapshot file (couldn't reproduce ANSI escapes)UPDATE_SNAPSHOTS=1(wrong env var name)INSTA_UPDATE=always(correct — finally worked)The
tests/CLAUDE.mdonly mentionedcargo insta test --acceptfor first-time inline snapshot creation. There was no guidance for updating existing file-based snapshots, and CLAUDE.md didn't mention the need to update help snapshots after editing help text.Test plan
INSTA_UPDATE=always cargo test --test integration "test_help"works as documented🤖 Generated with Claude Code