Skip to content

Fix --convert in workspaces, tag-aware changelog links, and single project discovery - #123

Merged
lukidoescode merged 28 commits into
mainfrom
lwagner/fix-docker-release-workflow
Dec 2, 2026
Merged

lukidoescode merged 28 commits into
mainfrom
lwagner/fix-docker-release-workflow

Conversation

@lukidoescode

Copy link
Copy Markdown
Owner

Closes #77, closes #120, closes #121.

release --convert in workspaces (#120)

  • --convert now converts every crate that inherits version.workspace = true to an explicit version, then removes workspace.package.version. Before, crates that were not released were left with nothing to inherit.
  • release and --dry-run output list the converted crates.
  • Rollback restores every converted manifest byte for byte.

Changelog comparison links (#121)

  • Tag names come from a single ReleaseTagNamer strategy, shared by tag creation and changelog links, so links follow the configured tag format.
  • Workspaces always use crate-prefixed tags ([email protected]). This is now documented in the README, the release action docs, the CLI help and the init prompt.
  • The root changelog link points to the highest new version.
  • comparison-links-template is now honoured. ChangelogConfig selects the URL formatter.

Single project discovery (#77)

  • ProjectProvider is split into ProjectLoader, ChangesetDirectoryProvider, AdditionalPackageDiscoverer and DependencyGraphProvider.
  • A new LoadedProject is loaded once per command and passed to every operation, so the type system rules out discovering the project twice.
  • InitOperation is split by the collaborators each step needs: InitDirectoryOperation, InitOperation and InteractiveInitPlanner.

Release rollback

  • Manifests, Cargo.lock and changeset files are snapshotted before the release runs and restored byte for byte on rollback. This also covers manifest writes that fail partway. Rollback deletes a Cargo.lock that the release created.
  • The CLI reports a successful rollback only when every restore succeeded. Otherwise it lists each failed step and each file it could not restore.

Breaking API changes

These are in changeset-operations and changeset-changelog and are covered by major changesets.

  • Every operation now takes &LoadedProject.
  • LockfileUpdater now only has update_lockfile.
  • The ChangesetWriter restore methods are removed.
  • ManifestSnapshotIO is now FileSnapshotIO.
  • Changelog::add_release and ChangelogWriter::write_release take an optional comparison URL.

Known gaps

These rollback gaps existed before this PR and remain open:

  • WriteVersionTrackingStep records its backups during execute, so its compensation restores nothing.
  • The git index is not rolled back.
  • UpdateDependencyVersionsStep, RemoveWorkspaceVersionStep and MarkChangesetsConsumedStep write values back rather than restoring the original bytes.
  • On a virtual workspace root, workspace.package.version comes back at the end of the table, not in its original position.

- Remove dead `on.push.tags` trigger (tag pushes from workflows never
  trigger other workflows)
- Dispatch `docker.yml` from `dispatch-publish.sh` with tag input
- Add version resolution step to produce version-specific Docker tags
  (e.g. `0.1.6`) alongside `latest`
- Upgrade Docker actions to Node.js 24 versions:
  build-push-action v7, login-action v4, metadata-action v6,
  setup-buildx-action v4
Dispatch docker.yml from dispatch-publish.sh with --ref pointing to the
release tag so version-specific Docker tags are produced automatically.

Upgrade Docker actions to Node.js 24 versions: build-push-action v7,
login-action v4, metadata-action v6, setup-buildx-action v4.

Remove unused inputs.tag from workflow_dispatch.
AddOperation, StatusOperation, VerifyOperation, ReleaseOperation and
InitOperation take a LoadedProject instead of a start path, so each CLI
handler discovers the project and loads its configuration exactly once.
Their provider bounds no longer include ProjectDiscoverer or
ChangesetConfigLoader. InitPlan::build replaces prepare_simple and the
plan construction duplicated in the CLI.
The constructor, builder methods and execute paths now live in a single
impl block bounded by ChangesetDirectoryProvider. Methods that need the
manifest writer or the interaction provider declare those bounds at
method level. The builder methods set the declared writer and
interaction provider types instead of changing them.
…mand (#77)

PrereleaseManageOperation, GraduationManageOperation,
PrereleaseDirectOperation, GraduationDirectOperation, the
additional-package operations and the version-tracking dependency
operations no longer hold a project provider; their execute methods take
a LoadedProject. The manage and additional-packages CLI handlers load the
project once per invocation and pass it to the operation, so only
LoadedProject::load uses ProjectDiscoverer and ChangesetConfigLoader.
…lls back

Snapshot every manifest that inherits workspace.package.version while the
conversion is prepared and restore those bytes in compensation. The step
also restores already-converted manifests itself when a later manifest
fails, and keeps restoring the rest when one restore fails, reporting the
failures as typed errors.

This replaces InheritedVersionWriter and write_inherited_version, which
could only write the dotted form.
WorkspaceVersionConversion now holds each inheriting package's name,
manifest path and snapshot, and the public InheritedVersionConversion
summary is derived from it, so ReleaseContext no longer keeps a separate
list of inherited package names.

The workspace version comes from the inheriting packages, whose versions
project discovery already resolved from workspace.package.version in the
root manifest. WorkspaceVersionManager::read_workspace_version had no
remaining caller and is removed.
InitOperation now takes its manifest writer through the constructor and
only executes plans, so a config-writing init cannot run without a
writer. Directory-only initialization moves to InitDirectoryOperation,
and interactive planning moves to InteractiveInitPlanner, which is the
only type that requires an InitInteractionProvider.
LoadedProject::load is the only consumer and always needs both project
discovery and configuration loading, so the two traits become one.
…lback

The lockfile backup and the changeset-file backups were recorded during
execute, so their compensations, which receive the step's input from before
it ran, never saw them and restored nothing. A Cargo.lock created by
`cargo update` also survived the rollback.

Snapshot Cargo.lock, the pending changeset files and, when graduating, the
consumed changesets before the saga runs, and restore those bytes in
compensation. A file that did not exist is captured as FileContent::Absent,
so restoring it removes the file the release created.

ManifestSnapshotIO becomes the general FileSnapshotIO, implemented by the
manifest writer and the changeset IO, and ManifestRestoreFailure becomes
FileRestoreFailure. The lockfile and changeset restore methods it replaces
are removed.
…artway

WriteManifestVersionsStep left the manifests it had already written when a
later manifest failed, and its compensation rewrote versions instead of
restoring the original files.

A new SnapshotReleaseManifestsStep runs right after the inherited-version
conversion and records, for every manifest the release writes, its target
and the bytes before WriteManifestVersionsStep runs. That step's input is
what compensation receives, so the snapshots reach it. WriteManifestVersionsStep
restores the manifests it touched before returning an error, and its
compensation restores every snapshot and reports each failed restore.

Because the snapshots are taken after the conversion, each step restores
the state from before itself, and rolling back both reproduces the
original files exactly.

InheritedVersionConversionRollbackFailed becomes the general
StepRollbackFailed, which both steps report when undoing their own partial
changes fails.
The CLI printed "Rollback completed successfully" for every failed step,
even when the failed step could not undo its own changes
(StepRollbackFailed), and listed compensation failures without the files
that were left modified.

RollbackOutcome decides from the saga error whether the rollback was
complete, and collects for each step that could not be undone the files it
did not restore. The error formatter only renders that outcome: success
when complete, otherwise each step, its error and every unrestored path.
Errors are now printed through CliWriter.
Clippy 1.100 adds assert_is_empty, which flags assert!(x.is_empty()).
Replace those assertions with assert_eq!/assert_ne! against an empty
value so failures print what was actually there.
cargo-changeset, changeset-core, changeset-parse and changeset-version
did not opt into [workspace.lints], so clippy pedantic and unwrap_used
never ran there. Enable them and satisfy every finding: expect() in
tests instead of unwrap(), # Errors docs, #[must_use] on bump_version,
flag groups via clap flatten to stay under the bool-field limit,
Display-based plain-text formatters instead of format!-then-push_str,
and long PTY/integration tests split into per-phase helpers. Also
converts the assert_is_empty sites in these crates.
@lukidoescode
lukidoescode merged commit fea3581 into main Dec 2, 2026
16 checks passed
@lukidoescode
lukidoescode deleted the lwagner/fix-docker-release-workflow branch December 2, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant