Skip to content

fix(workspace): restructure into a true sibling Cargo workspace - #77

Merged
jpage-godaddy merged 1 commit into
mainfrom
fix/monorepo-sibling-layout
Aug 3, 2026
Merged

fix(workspace): restructure into a true sibling Cargo workspace#77
jpage-godaddy merged 1 commit into
mainfrom
fix/monorepo-sibling-layout

Conversation

@jpage-godaddy

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes the recurring release-please bug where cli-engine-macros's version gets silently force-synced to match cli-engine's, even with zero commits of its own (seen again in chore: release main #74, after fix(workspace): drop redundant "." self-reference from workspace members #75's "." self-reference fix only removed a warning, not the actual behavior).
  • Root cause, confirmed by reading release-please's own source (src/strategies/rust.ts) and tracing two consecutive release-please-action run logs: any time the manifest release-please reads for a release path has both [package] and [workspace] in the same file, it unconditionally forces every [workspace] members entry's version to match — regardless of commits, regardless of the cargo-workspace plugin, regardless of release-please-config.json's independent per-package versioning. Our root Cargo.toml was exactly that shape (cli-engine's own package + [workspace] members = ["cli-engine-macros"]), so this fires on every release.
  • Fix: move cli-engine's package into its own cli-engine/ subdirectory as a true sibling of cli-engine-macros/, and make the repo root a pure virtual [workspace]-only manifest. Traced Rust.buildUpdates() for a manifest with no [workspace] section — it takes the safe "single crate found, updating Cargo.toml" branch; the buggy branch can no longer trigger.

What moved / changed

  • src/, tests/, examples/, docs/, CHANGELOG.md, Cargo.toml → all moved into cli-engine/ via git mv (100% renames, history preserved).
  • New root Cargo.toml: workspace-only, resolver = "3" (a virtual workspace doesn't auto-infer this from an edition-2024 member the way a non-virtual root does — verified in a scratch workspace, confirmed the warning/behavior change), [workspace.lints.*] moved here verbatim.
  • cli-engine/Cargo.toml: cli-engine-macros path dependency → ../cli-engine-macros (sibling, not nested); readme../README.md (verified Cargo packages a readme outside the crate directory correctly).
  • cli-engine/LICENSE: copied so cargo publish still bundles a license file (previously implicit since LICENSE and Cargo.toml shared a directory).
  • release-please-config.json / .release-please-manifest.json: package key ".""cli-engine" (component/tag name unaffected — releases still tag as cli-engine-vX.Y.Z).
  • .github/workflows/ci.yml and release.yml: the two cargo publish steps that ran at repo root now use -p cli-engine explicitly (a virtual workspace has no default package to publish; verified cargo publish with no -p in a multi-member virtual workspace would otherwise try to publish every member in one shot). Other steps (fmt --all, check/clippy/test/doc --all-targets) are left as bare workspace-wide commands — cli-engine-macros now gets covered by them too, which it silently wasn't before.
  • Doc wording in AGENTS.md, README.md, CONTRIBUTING.md, and cli-engine/docs/design.md updated to describe the new workspace shape and fix relative links.

Test plan

  • cargo generate-lockfile reverted (it does a full fresh resolve, not what we want) — used cargo check instead; confirmed Cargo.lock has zero diff (path deps don't encode filesystem paths)
  • cargo fmt --all --check
  • cargo clippy --all-targets -- -D warnings (+ --features pkce-auth)
  • cargo test --all-targets (+ pkce-auth) — all passing, 0 failures
  • RUSTDOCFLAGS='-D warnings' cargo doc --no-deps (+ pkce-auth) and cargo test --doc (+ pkce-auth)
  • cargo rustdoc --lib -p cli-engine -- -W missing-docs — zero missing docs
  • cargo package --list -p cli-engine — confirms LICENSE and README.md (via ../README.md) are correctly bundled
  • cargo publish --dry-run -p cli-engine and cd cli-engine-macros && cargo publish --dry-run — both succeed, correctly resolving the path dependency
  • After merge: watch the next release-please Action run's log for the Rust strategy trace — should now show "single crate found, updating Cargo.toml" for cli-engine instead of "found workspace with N members, upgrading all"

🤖 Generated with Claude Code

release-please's built-in Rust strategy unconditionally force-syncs the
version of every `[workspace] members` entry whenever the manifest it
reads for a release path declares both `[package]` and `[workspace]`
in the same file (src/strategies/rust.ts: "found workspace with N
members, upgrading all"). PR #75 removed the redundant "." self-
reference from that array, which fixed a warning, but the very next
release PR reproduced the identical bug (cli-engine-macros silently
bumped to match cli-engine's version with no corresponding commits,
changelog, or manifest entry) — confirmed via two consecutive
release-please-action run logs.

The only way to stop it: the manifest release-please reads for
cli-engine's path must not declare `[workspace]` at all. Move
cli-engine's package into its own `cli-engine/` subdirectory as a true
sibling of `cli-engine-macros/`, and make the repo root a pure virtual
`[workspace]`-only manifest.

- `Cargo.toml` (root): now workspace-only, with `resolver = "3"`
  (virtual workspaces don't auto-infer this from an edition-2024
  member the way a non-virtual root does — verified in a scratch
  workspace) and the `[workspace.lints.*]` tables moved here verbatim.
- `cli-engine/Cargo.toml`: everything else from the old root manifest;
  `cli-engine-macros` path dependency updated to `../cli-engine-macros`
  (now a sibling, not nested); `readme` points at `../README.md`
  (verified Cargo packages a readme outside the crate directory
  correctly).
- `cli-engine/LICENSE`: copied so `cargo publish` still bundles a
  license file, matching today's behavior (previously implicit since
  LICENSE and Cargo.toml shared a directory).
- `release-please-config.json` / `.release-please-manifest.json`:
  package key `"."` renamed to `"cli-engine"` (component/tag name
  unaffected).
- CI/release workflows: the two `cargo publish` steps that ran at repo
  root now need an explicit `-p cli-engine` (a virtual workspace has no
  default package to publish). Other steps are left as bare
  workspace-wide commands — cli-engine-macros now gets covered by them
  too, which it silently wasn't before.
- Doc wording in `AGENTS.md`, `README.md`, `CONTRIBUTING.md`, and
  `cli-engine/docs/design.md` updated to describe the new workspace
  shape and fix relative links.

Verified locally end-to-end: fmt, clippy, test, doc, and doctest all
pass (both default and pkce-auth feature sets), missing-docs count is
still zero, Cargo.lock is untouched (path deps don't encode
filesystem paths), and `cargo publish --dry-run` succeeds for both
crates with `cargo package --list` confirming LICENSE/README are
correctly bundled.
@jpage-godaddy
jpage-godaddy merged commit 05b8b29 into main Aug 3, 2026
2 checks passed
@jpage-godaddy
jpage-godaddy deleted the fix/monorepo-sibling-layout branch August 3, 2026 20:36
@github-actions github-actions Bot mentioned this pull request Aug 3, 2026
jpage-godaddy added a commit that referenced this pull request Aug 3, 2026
The move to cli-engine/ (#77) changed release-please's per-path
commit filtering — file diffs for commits made before the move (#72,
#73) point at the old src/ paths, not cli-engine/, so release-please's
regenerated changelog only picked up commits made after the move.
Nothing was lost from git history or the shipped code; this just
restores the visible changelog entry to the full set of changes since
0.6.0.
jpage-godaddy added a commit that referenced this pull request Aug 3, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>cli-engine: 0.6.1</summary>

##
[0.6.1](cli-engine-v0.6.0...cli-engine-v0.6.1)
(2026-08-03)


### Features

* **command:** add context-aware typed constructors and ArgGroup support
([#73](#73))
([748efc6](748efc6))
* **output:** support nested table output in human rendering
([#72](#72))
([8ca7479](8ca7479))


### Bug Fixes

* **workspace:** drop redundant "." self-reference from workspace
members ([#75](#75))
([b769528](b769528))
* **workspace:** restructure into a true sibling Cargo workspace
([#77](#77))
([05b8b29](05b8b29))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jacob Page <jpage@godaddy.com>
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.

2 participants