Skip to content

feat(cli): add snapshot command for PR preview versions - #1356

Merged
BryanFRD merged 2 commits into
mainfrom
feat/snapshot-releases
Oct 27, 2026
Merged

BryanFRD merged 2 commits into
mainfrom
feat/snapshot-releases

Conversation

@BryanFRD

Copy link
Copy Markdown
Contributor

Closes #495

ferrflow snapshot --tag <suffix> [--from-zero] [--no-git] [--run-hooks] stamps every package with pending changes with <next>-<suffix>.<short-sha> (or 0.0.0-<suffix>.<short-sha> with --from-zero), writes the versioned files and prints a JSON report for CI. No changelog, commit, tag or push.

  • Reuses the check --json plan (plan_json_at), with recoverMissedReleases forced on so a PR whose last commit only touches docs still counts every commit since the last release.
  • --no-git skips the clean working tree check. HEAD is still read for the sha.
  • --run-hooks fires pre_publish for every package, then post_publish, with FERRFLOW_NEW_VERSION set to the snapshot version and FERRFLOW_CHANNEL to the suffix. Configured publishers are deliberately not run: the npm publisher defaults to --tag=latest and docker expands major/minor tags, so a PR preview could move a stable tag. CI publishes from the JSON instead.
  • The suffix is validated as a semver pre-release. A numeric short sha with a leading zero gets a g prefix to stay valid semver.
  • Global --dry-run computes and prints without writing.
{"tag":"pr-123","commit":"abc1234","dry_run":false,"packages":[{"name":"cli","version":"1.3.0-pr-123.abc1234","previous_version":"1.2.0"}]}

Docs: reference/cli.md (en, fr).

Signed-off-by: Test <test@test.com>

@ferrfleet-interne ferrfleet-interne Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking. The plan reuse through plan_json_at, the semver handling (the leading-zero numeric sha gets a g prefix, build metadata is dropped) and the dirty-tree guard all look right, and the tests cover the important paths. One nit inline, about lockfiles.

Comment thread src/monorepo/snapshot.rs Resolved

@ferrfleet-interne ferrfleet-interne Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lockfile nit is fixed in 242ffac. refresh_lockfiles is now gated on effective_update_lockfiles, the same way cascade.rs gates it, and the cargo test checks that Cargo.lock carries the snapshot version. Nothing new to flag.

@BryanFRD
BryanFRD merged commit 188783c into main Oct 27, 2026
35 checks passed
@BryanFRD
BryanFRD deleted the feat/snapshot-releases branch October 27, 2026 18:43
ferrflow Bot added a commit that referenced this pull request Oct 27, 2026
## [7.35.0] - 2026-10-27

### Features

- feat(cli): add snapshot command for PR preview versions (#1356)
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.

feat(cli): snapshot/canary releases for PR previews without git tags

1 participant