chore(container): exclude irrelevant workspace members from nextest archive - #1872
Merged
josecelano merged 2 commits intoJun 3, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses #1868 by reducing unnecessary work during container builds by excluding two non-runtime workspace members from the cargo nextest archive steps, aiming to improve CI/container build performance while documenting cargo-chef limitations.
Changes:
- Add
--exclude workspace-coupling --exclude torrust-tracker-torrent-repository-benchmarkingto all fourcargo nextest archivecommands (debug/release, warm-up/final). - Document why
cargo chef prepare/cargo chef cookcannot exclude workspace members and why the recipe-stage COPY/stub entries must remain. - Update the issue spec to mark implementation and automatic verification as done, and record the rationale for the cargo-chef limitation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
Containerfile |
Adds --exclude flags to cargo nextest archive commands and documents cargo-chef exclusion limitations. |
docs/issues/open/1868-1840-workflow-performance-exclude-irrelevant-workspace-members/ISSUE.md |
Updates task/AC status and documents the cargo chef exclusion decision rationale. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this pull request
Jun 3, 2026
…scope Address Copilot review comments on PR torrust#1872: - Containerfile cook-stage comment: the previous wording implied that stub sources prevent the excluded packages' unique transitive dependencies from being compiled during the cook layer. In fact, dependency compilation is driven by Cargo.toml manifests (already in the recipe), not by stub sources. Reworded to make clear that the cook layer still compiles those packages, and that the build-time savings come from the archive/build stages where `--exclude` is applied to `cargo nextest archive`. - ISSUE.md T2 task label: renamed from "Add `--exclude` flags to all Containerfile cargo commands" to "Add `--exclude` flags to all `cargo nextest archive` commands in Containerfile" to match what was actually done (only the nextest archive commands were updated; chef cook/prepare cannot accept `--exclude`).
…rchive Closes torrust#1868. Add `--exclude workspace-coupling --exclude torrust-tracker-torrent-repository-benchmarking` to all four `cargo nextest archive` commands in the Containerfile (pre-link warm-up × 2 and final archive × 2, covering both debug and release builds). `cargo chef prepare` and `cargo chef cook` do not expose an `--exclude` flag (cargo-chef CLI limitation). The COPY/stub lines for the excluded packages are retained in the recipe stage because `cargo chef prepare` invokes `cargo metadata` internally, which requires every workspace member's manifest to be present on disk. This limitation and its rationale are documented in Containerfile comments. Issue spec (T1–T3 DONE, AC4 DONE): docs/issues/open/1868-1840-workflow-performance-exclude-irrelevant-workspace-members/ISSUE.md
…scope Address Copilot review comments on PR torrust#1872: - Containerfile cook-stage comment: the previous wording implied that stub sources prevent the excluded packages' unique transitive dependencies from being compiled during the cook layer. In fact, dependency compilation is driven by Cargo.toml manifests (already in the recipe), not by stub sources. Reworded to make clear that the cook layer still compiles those packages, and that the build-time savings come from the archive/build stages where `--exclude` is applied to `cargo nextest archive`. - ISSUE.md T2 task label: renamed from "Add `--exclude` flags to all Containerfile cargo commands" to "Add `--exclude` flags to all `cargo nextest archive` commands in Containerfile" to match what was actually done (only the nextest archive commands were updated; chef cook/prepare cannot accept `--exclude`).
josecelano
force-pushed
the
1868-1840-exclude-irrelevant-workspace-members
branch
from
June 3, 2026 12:15
14e8b37 to
baf6c8d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1872 +/- ##
========================================
Coverage 77.76% 77.76%
========================================
Files 382 382
Lines 28637 28637
Branches 28637 28637
========================================
Hits 22270 22270
Misses 6059 6059
Partials 308 308 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
Author
|
ACK baf6c8d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1868.
Add
--exclude workspace-coupling --exclude torrust-tracker-torrent-repository-benchmarkingto all fourcargo nextest archivecommands in the Containerfile (pre-link warm-up × 2 and final archive × 2, covering both debug and release builds).cargo chef prepareandcargo chef cookdo not expose an--excludeflag (cargo-chef CLI limitation). The COPY/stub lines for the excluded packages are retained in the recipe stage becausecargo chef prepareinvokescargo metadatainternally, which requires every workspace member's manifest to be present on disk. This limitation and its rationale are documented in Containerfile comments.Changes
Containerfile: added--excludeflags to 4cargo nextest archivecommands; added explanatory comments to cook and recipe stagesdocs/issues/open/1868-…/ISSUE.md: T1–T3 marked DONE, AC4 marked DONE, automatic verification checkpoint checkedVerification
linter all→ passedcargo machete→ passedcargo test --doc --workspace→ passedRemaining: AC1–AC3 require a full CI run (build timing and image correctness).