Skip to content

test(native): move pinned-tool snapshots to a new version without a native build - #1719

Draft
Martin Torp (mtorp) wants to merge 1 commit into
v1.xfrom
martin/retag-coana-snapshots
Draft

Martin Torp (mtorp) wants to merge 1 commit into
v1.xfrom
martin/retag-coana-snapshots

Conversation

@mtorp

Copy link
Copy Markdown
Contributor

LLM Description written by Claude Code:claude-opus-5-5

Every Coana bump needs the three Coana help snapshots refreshed, because they show the pinned Coana version and native CI fails until they match. pnpm snapshots:update:dep coana does that with a full native build. The automation that opens the Coana bump PRs here can't run that build.

This adds scripts/test/swap-snapshot-version.mts:

node scripts/test/swap-snapshot-version.mts --dep coana --from 15.15.0

It reads the new version from the pin and swaps the old version for it in the dependency's snapshots. It keeps each 140-column row its width by taking or giving spaces from the row's padding. The native test compares rendered pixels, so the result matches a real capture. It edits nothing when a snapshot doesn't show the old version or a row has no room. It finishes with the existing staleness check, which points at snapshots:update:dep on failure.

Also:

  • readPinnedVersion is pulled out of findStaleSnapshotDependencies so both use it.
  • /bump-coana runs the script as a step and stages the snapshots.

The automated Coana bump PRs will run the script too.

Ran: the unit tests in test/unit/scripts/test/ (29 tests), pnpm check:tsc and pnpm lint. Lint's biome lane fails on 12 files that are already unformatted on v1.x. None of them are new here. I also ran the script on a checkout with the pin at 15.16.0. It moved all three snapshots and passed the staleness check. I did not run the native screenshot test locally. This PR's native CI covers the unchanged snapshots, and the next Coana bump PR will cover the swap.

Expected reviewer effort: High-level design decisions

…ative build

The Coana help snapshots show the pinned Coana version, so every Coana
bump needs them refreshed. `pnpm snapshots:update:dep coana` needs a full
native build, which Coana's release automation can't run.

`scripts/test/swap-snapshot-version.mts --dep coana --from <old>` edits
the version text instead. It keeps each row's width, so the rendered
pixels match a real capture. It edits nothing if a snapshot lacks the old
version or a row has no room, and then points at snapshots:update:dep.

/bump-coana now runs it as a step.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant