Repository navigation
feat(workspace): adopt independent package versioning policy - #1961
josecelano merged 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR documents and codifies a shift from lockstep workspace versioning to independent per-crate versioning, including corresponding release/publish workflow documentation and CI workflow split for tracker vs. per-package publishing.
Changes:
- Adds an ADR and updates EPIC/decision logs to formally adopt independent versioning for workspace crates.
- Updates the tracker deployment workflow to publish only
torrust-trackerand introduces a new workflow for publishing individual workspace packages. - Extends release-process documentation to include a per-package publishing path and updates project spellcheck dictionary.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| project-words.txt | Adds new dictionary terms for cspell. |
| docs/release_process.md | Documents the split release model (tracker release vs. per-package publish). |
| docs/issues/open/1926-1669-si-32-define-package-versioning-strategy.md | Updates the issue spec with the independent-versioning policy and related process details. |
| docs/issues/open/1669-overhaul-packages/EPIC.md | Links the EPIC to the new ADR/issue and updates versioning-policy narrative. |
| docs/issues/open/1669-overhaul-packages/DECISIONS.md | Adds DEC-16 documenting adoption of independent package versioning. |
| docs/adrs/index.md | Registers the new ADR in the ADR index. |
| docs/adrs/20260629000000_adopt_independent_package_versioning.md | New ADR describing the independent-versioning policy and release model split. |
| docs/adrs/20260623200526_adopt_contract-first_architecture_for_rest_api.md | Adds a reference to the new ADR for “version by namespace” rationale. |
| .github/workflows/deployment.yaml | Narrows tracker deployment to releases/v* and publishes only torrust-tracker. |
| .github/workflows/deployment-packages.yaml | New workflow to publish a single crate based on releases/pkg/** branches or manual dispatch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a88721d to
4cb1889
Compare
26de059 to
8fed65f
Compare
4ed094b to
8d1db13
Compare
Define and document the policy that all workspace packages version independently, replacing the implicit shared workspace version. Includes: - Issue spec with four-tier versioning model and Appendix A - ADR documenting the decision - EPIC and DECISIONS log updates - CI workflows (deployment-packages.yaml, deployment.yaml) - Release process documentation update - Branch format validation and output injection protection - Secret scoping and review feedback from all rounds
Remove version.workspace = true from all 26 workspace Cargo.toml manifests and set explicit versions per the approved version assignment table (Appendix A in issue spec). Key changes: - Root torrust-tracker binary: 3.0.0-develop - Published crates (4): 3.0.0 (primitives, configuration, test-helpers) - Unpublished crates (23): 0.1.0 - Removed version from [workspace.package] - Updated all inter-package dependency version references - Set publish = false for unpublished tooling crates - Regenerated Cargo.lock for consistency
da13b1e to
b24149f
Compare
|
ACK d19d13a |
…ssues/open to docs/issues/closed 174904d chore(ci): point to ADR instead of closed issue spec in deployment-packages.yaml (Jose Celano) 2e2178f docs(skill): document branch-already-exists edge case in cleanup-completed-issues skill (Jose Celano) 1bfd306 chore(issues): archive closed issue specs #1447, #1459, #1505, #1926, #1938, #1944, #1959, #1964, #1965, #1969 to docs/issues/closed (Jose Celano) Pull request description: Archives the following 10 issue specs that are closed on GitHub, moving them from `docs/issues/open/` to `docs/issues/closed/`: | Issue | Title | PR | |-------|-------|-----| | #1447 | Change logging threshold for connection ID error to WARNING | #1975 | | #1459 | Docker Security Overhaul | #1958 | | #1505 | Optimize peer IP list from swarm (implementation rejected) | #1949 | | #1926 | Define package versioning strategy | #1961 | | #1938 | REST API Contract-First Migration EPIC | #1960 (SI-1→5) | | #1944 | SI-6: Align REST API client | #1968 | | #1959 | SI-7: Review tests, align v1 namespace | #1963 | | #1964 | Rename number-of-downloads BTreeMap type alias | #1972 | | #1965 | SI-34: Consolidate duplicate HTTP types | #1974 | | #1969 | SI-8: Eliminate unwraps from REST API client | #1973 | ### Changes Made - All 10 specs verified `CLOSED` on GitHub with merged PRs - Files/directories moved via `git mv` to `docs/issues/closed/` - Frontmatter updated: `status: done`, `spec-path` → closed path, `last-updated-utc: 2026-07-15` - Workflow checkpoints updated and progress log entries added - Supplementary files in multi-file directories updated with new paths - Parent EPIC specs (#1669, #1938) updated: subissue status, spec paths, and table references - Fixed stale references in `.github/workflows/deployment-packages.yaml`, `docs/adrs/`, and `docs/issues/closed/` files - Pre-commit and pre-push hooks passed (linter, tests, doc-tests, nightly checks) ACKs for top commit: josecelano: ACK 174904d Tree-SHA512: c7e38354bb5898fc5125a0b68fd61a02ca273689593638eb3b955b9176038ef82c40fc98b0a2f722eb18d8d429d2f2dbb6f205eee3061211ab9906c5be46942b
da2ce7
left a comment
There was a problem hiding this comment.
This is a post-merge review of the change from #1961 as it stands at a94c3ced8 on the default branch.
What still runs: .github/workflows/deployment-packages.yaml is the file #1961 added, with only the checkout pin (v7.0.1), its document pointers and its markers changed since. A push to a releases/pkg/<crate-name>/v<semver> branch takes the crate name from the branch, tests that crate on nightly and stable, and publishes it to crates.io from the deployment environment. .github/workflows/deployment.yaml triggers only on releases/v* and publishes only torrust-tracker. Every member manifest declares its own version, [workspace.package] declares none, and the release procedure lives in docs/release-process/workspace-packages.md and docs/release-process/tracker.md.
[Minor] A hardening gap in the release path: the published version is never compared with the version in the release branch name. .github/workflows/deployment-packages.yaml:77-78 strips /v<semver> from the branch name and discards it, and the verify-version check (lines 142-158) only confirms that the manifest does not inherit its version. Suppose the commit pushed to releases/pkg/torrust-tracker-udp-protocol/v0.2.0 declares an unpublished 0.1.1, because the wrong commit was pushed or the bump chose another number. The workflow then publishes 0.1.1 to crates.io and reports success, and a crates.io version can be yanked but never reused. If the crates.io check at docs/release-process/workspace-packages.md:108-109 is skipped, the tag from docs/release-process/workspace-packages.md:110-116 then names v0.2.0 on a commit that published 0.1.1. The required dry run (docs/release-process/workspace-packages.md:86-90) prints the packaged version, so this missing check only matters when a manual slip goes unnoticed. Smallest fix: keep the v<semver> part of the branch name as a second output of the extract-crate job, and in the publish job fail before cargo publish when it differs from the crate's version read from cargo metadata --no-deps --format-version 1.
[Minor] The ADR states the opposite of what Cargo does with path dependencies. docs/adrs/20260629000000_adopt_independent_package_versioning.md:62-64 and :108-109, and the argument for discarding the hybrid alternative at :157, say Cargo resolves the local copy of a path dependency regardless of the declared version. In fact Cargo checks a path dependency's version requirement against the local package. An incompatible bump therefore does not build until every dependent's requirement is raised. The declared requirement is also what a published dependent asks crates.io for, so a dependent that starts using a newer API but keeps the old requirement publishes a false compatibility claim. docs/release-process/workspace-packages.md:73-79 states this correctly, so the decision record and the procedure disagree. Smallest fix: rewrite the two ADR passages to say that path dependencies keep the workspace on local code, while the declared requirement must match the local version and is what consumers of the published crate receive.
[Nit] A hardening note: neither deployment workflow declares permissions: (.github/workflows/deployment-packages.yaml:32-45, .github/workflows/deployment.yaml:1-18). The GITHUB_TOKEN in jobs that check out the repository and run the build scripts of crates.io dependencies therefore gets the repository's default scopes, although .github/workflows/AGENTS.md:15 asks for least privilege. The practical exposure is small: the rulesets recorded in docs/github-rulesets.md:43-51 already limit what the workflow token can change, and nothing in these jobs needs more than read access. Smallest fix: a top-level permissions: contents: read in both files.
[Nit] The verify-version check (.github/workflows/deployment-packages.yaml:142-158) cannot fail in practice. [workspace.package] in Cargo.toml:80-91 has no version, so a member with version.workspace = true already fails to load in the test job, before this check runs. The check also matches only that one spelling (version = { workspace = true } passes), and it locates the manifest with grep -rl ... | head -1. That lookup is correct at a94c3ced8 only because every publishable crate name matches exactly one manifest. Smallest fix: replace the check with the cargo metadata version comparison suggested above.
Checked and found sound: the trigger split (releases/v* cannot match releases/pkg/...); the tracker workflow, which publishes only torrust-tracker after the full workspace tests; the per-crate versions and path requirements in every member manifest (each requirement is satisfied by the local version, no publishable crate depends on an unpublished one, and the type added with primitives 3.1.0 in 9628a06 is not yet used by any dependent that still requires 3.0.0); the container workflow, whose releases/**/* trigger also fires on package branches but whose semver check stops any image publish there; and the agreement of docs/release-process/tracker.md with deployment.yaml.
Summary
Define and implement a SemVer policy for all workspace packages, replacing the implicit "everything shares one workspace version" with independent versioning for every crate.
Issue: #1926 (SI-32) — subissue of EPIC #1669 (Overhaul: Packages)
Phase Progress
✅ Phase 1 — Policy Definition (committed)
All policy definition work is complete and ready for review:
20260629000000) documenting the independent versioning decision, alternatives considered, and rationale.github/workflows/deployment.yaml— refined to publish onlytorrust-tracker.github/workflows/deployment-packages.yaml— new workflow for per-package publishingdocs/release_process.md— split into two paths (tracker release + per-package publish)✅ Phase 2 — Version Migration (completed)
version.workspace = truefrom all 26Cargo.tomlmanifests3.0.0(already on crates.io)0.1.03.0.0-developversionfrom[workspace.package]in rootCargo.tomlCargo.lockfor consistencycargo check --workspacepasseslinter allpassescargo test --doc --workspacepasses✅ Phase 3 — CI/Release Refinements (completed)
Any remaining polish after Phase 2 is committed.
Key Decisions
releases/v*) and per-package publish (releases/pkg/<crate>/v<semver>)releases/v*does NOT matchreleases/pkg/...in GitHub Actionsv1/modules, configv2_0_0/)e2e-tools,persistence-benchmark,torrent-repository-benchmarking,workspace-coupling)Verification
linter allpassescargo test --doc --workspacepassescargo +nightly fmt --checkpassescargo +nightly check --tests --benches --examples --workspace --all-targets --all-featurespassescargo +stable test --tests --benches --examples --workspace --all-targets --all-featurespassescargo check --workspacepasses with new versions