Skip to content

feat(workspace): adopt independent package versioning policy#1961

Draft
josecelano wants to merge 6 commits into
torrust:developfrom
josecelano:1926-1669-si-32-define-package-versioning-strategy
Draft

feat(workspace): adopt independent package versioning policy#1961
josecelano wants to merge 6 commits into
torrust:developfrom
josecelano:1926-1669-si-32-define-package-versioning-strategy

Conversation

@josecelano

@josecelano josecelano commented Jun 29, 2026

Copy link
Copy Markdown
Member

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:

  • Issue spec with three-tier versioning model (tracker runtime / API contract / platform-utility / unpublished tooling), release process implications, and Appendix A with version assignment table per crate
  • ADR (20260629000000) documenting the independent versioning decision, alternatives considered, and rationale
  • EPIC and DECISIONS log updated with references
  • .github/workflows/deployment.yaml — refined to publish only torrust-tracker
  • .github/workflows/deployment-packages.yaml — new workflow for per-package publishing
  • docs/release_process.md — split into two paths (tracker release + per-package publish)

✅ Phase 2 — Version Migration (completed)

  • ✅ Removed version.workspace = true from all 26 Cargo.toml manifests
  • ✅ Set explicit initial versions per Appendix A:
    • 4 crates keep 3.0.0 (already on crates.io)
    • 23 crates start at 0.1.0
    • Root binary keeps 3.0.0-develop
  • ✅ Removed version from [workspace.package] in root Cargo.toml
  • ✅ Updated all inter-package dependency version references
  • ✅ Regenerated Cargo.lock for consistency
  • cargo check --workspace passes
  • linter all passes
  • cargo test --doc --workspace passes

✅ Phase 3 — CI/Release Refinements (completed)

Any remaining polish after Phase 2 is committed.


Key Decisions

  1. All packages version independently — path dependencies guarantee workspace compatibility regardless of declared version numbers
  2. Two-concept release model: tracker application release (releases/v*) and per-package publish (releases/pkg/<crate>/v<semver>)
  3. Glob safety: releases/v* does NOT match releases/pkg/... in GitHub Actions
  4. Version by namespace for public contracts (REST API v1/ modules, config v2_0_0/)
  5. 4 crates never published (e2e-tools, persistence-benchmark, torrent-repository-benchmarking, workspace-coupling)

Verification

  • linter all passes
  • cargo test --doc --workspace passes
  • cargo +nightly fmt --check passes
  • cargo +nightly check --tests --benches --examples --workspace --all-targets --all-features passes
  • cargo +stable test --tests --benches --examples --workspace --all-targets --all-features passes
  • GPG-signed commits (all 5 commits)
  • cargo check --workspace passes with new versions
  • All 21 Copilot review comments addressed
  • All 27 files changed (292 insertions, 439 deletions)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-tracker and 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.

Comment thread project-words.txt
Comment thread docs/release_process.md
Comment thread docs/issues/open/1926-1669-si-32-define-package-versioning-strategy.md Outdated
Comment thread docs/issues/open/1926-1669-si-32-define-package-versioning-strategy.md Outdated
Comment thread docs/adrs/20260629000000_adopt_independent_package_versioning.md Outdated
Comment thread docs/adrs/20260629000000_adopt_independent_package_versioning.md
Comment thread .github/workflows/deployment.yaml
Comment thread .github/workflows/deployment-packages.yaml
Comment thread .github/workflows/deployment-packages.yaml
@josecelano josecelano force-pushed the 1926-1669-si-32-define-package-versioning-strategy branch from a88721d to 4cb1889 Compare June 30, 2026 06:59
@josecelano josecelano requested a review from Copilot June 30, 2026 07:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Comment thread docs/issues/open/1926-1669-si-32-define-package-versioning-strategy.md Outdated
Comment on lines 760 to 762
See the ADR for full details, including the two-concept release model split
(tracker application release vs individual package publish).
migration does not run ahead of layer decoupling.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 5db2060. Removed the orphaned sentence fragment "migration does not run ahead of layer decoupling." from EPIC.md.

Comment thread .github/workflows/deployment-packages.yaml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 36 out of 37 changed files in this pull request and generated 4 comments.

Comment on lines +250 to +252
> All dependency crates are published independently via `deployment-packages.yaml` as they
> evolve. This avoids conflating versioning semantics (three-tier model) with publish
> mechanics (single workflow per package).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 5db2060. The Design decision callout now references "four-tier model" consistently instead of "three-tier model".

Comment thread docs/issues/open/1926-1669-si-32-define-package-versioning-strategy.md Outdated
Comment on lines +760 to 763
See the ADR for full details, including the two-concept release model split
(tracker application release vs individual package publish).
migration does not run ahead of layer decoupling.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 5db2060. Removed the orphaned sentence fragment from EPIC.md.

Comment thread packages/torrent-repository-benchmarking/Cargo.toml
Define and document the policy that all workspace packages version
independently, replacing the implicit shared workspace version.

Phase 1 of issue torrust#1926 (SI-32). Includes:
- Issue spec with three-tier versioning model and Appendix A
- ADR documenting the decision
- EPIC and DECISIONS log updates
- CI workflows (deployment-packages.yaml, deployment.yaml updates)
- Release process documentation update
Phase 2 of issue torrust#1926 (SI-32). 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 (own explicit field)
- Published crates (4): 3.0.0 (primitives, configuration, test-helpers)
- Unpublished crates (23): 0.1.0
- Removed version from [workspace.package] in root Cargo.toml
- Updated all inter-package dependency version references
- Regenerated Cargo.lock for consistency
Fix 5 issues from the Phase 2 Copilot review:
- Fix "three-tier model" references to "four-tier model" with "publishable" wording
- Fix "still publish the bundle" to "now publish only torrust-tracker"
- Remove orphaned sentence fragment in EPIC.md ("migration does not run...")
- Fix output injection in deployment-packages.yaml via env + printf pattern
- Comment about Goal section resolved by Phase 2 implementation itself
Unpublished tooling crates should not inherit publish.workspace = true.
@josecelano josecelano force-pushed the 1926-1669-si-32-define-package-versioning-strategy branch from 26de059 to 8fed65f Compare June 30, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 36 out of 37 changed files in this pull request and generated 4 comments.

Comment on lines +58 to +60
if [ -n "$INPUT_CRATE_NAME" ]; then
printf 'crate-name=%s\n' "$INPUT_CRATE_NAME" >> "$GITHUB_OUTPUT"
else
Comment on lines +43 to +45
env:
CARGO_REGISTRY_TOKEN: "${{ secrets.TORRUST_UPDATE_CARGO_REGISTRY_TOKEN }}"

Comment on lines +106 to +110
publish:
name: Publish
environment: deployment
needs: [extract-crate, test]
runs-on: ubuntu-latest
Comment on lines +52 to +53
| **Platform/utility** | Crate's own library API changed | `test-helpers`, `e2e-tools` |
| **Unpublished tooling** | Version changes only when internal API changes meaningfully | `persistence-benchmark`, `workspace-coupling` |
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