You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #1872: chore(container): exclude irrelevant workspace members from nextest archive
baf6c8d chore(container): fix misleading cook-stage comment; clarify T2 task scope (Jose Celano)
bf5bfe4 chore(container): exclude irrelevant workspace members from nextest archive (Jose Celano)
Pull request description:
Closes#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.
## Changes
- `Containerfile`: added `--exclude` flags to 4 `cargo nextest archive` commands; added explanatory comments to cook and recipe stages
- `docs/issues/open/1868-…/ISSUE.md`: T1–T3 marked DONE, AC4 marked DONE, automatic verification checkpoint checked
## Verification
- `linter all` → passed
- `cargo machete` → passed
- `cargo test --doc --workspace` → passed
- Pre-commit hook → SUCCESS
Remaining: AC1–AC3 require a full CI run (build timing and image correctness).
ACKs for top commit:
josecelano:
ACK baf6c8d
Tree-SHA512: 440b33bf1aff4c9f364f8d0a3727865421e551f38f7194bb17a3de1edb3aa3b0b3b5fcea42dc9a163d072495e5c9a2c8a30fbe6fe0b81483b043e529ea2a46e4
| T1 |TODO| Verify `cargo nextest archive` supports `--exclude`| Confirm the flag works for cargo-nextest; check docs and local test.|
98
-
| T2 |TODO| Add `--exclude` flags to all Containerfile cargo commands | Six commands:`cargo chef cook`× 2 and `cargo nextest archive` × 4. Both excluded packages named explicitly.|
99
-
| T3 |TODO| Decide on `cargo chef prepare` exclusion | Determine if `--exclude` is supported/needed for `cargo chef prepare`. If yes, remove the COPY/stub entries for the two packages from the recipe stage. If no, document why the COPY/stub lines must stay. |
100
-
| T4 | TODO | Run full CI build and record timing evidence | CI log showing build time after exclusion. Compare against pre-fix baseline (19m03s build step, 38m total). |
| T1 |DONE| Verify `cargo nextest archive` supports `--exclude`| Confirmed: `--exclude` is standard Cargo package-selection syntax; `cargo nextest archive` passes it through to Cargo. Verified by inspecting cargo-nextest behaviour and Cargo docs.|
98
+
| T2 |DONE| Add `--exclude` flags to all `cargo nextest archive`commands in Containerfile | Applied to all 4 `cargo nextest archive`commands.`cargo chef cook`does **not** support `--exclude` (cargo-chef CLI limitation; see T3). Documented with comments in the Containerfile. |
99
+
| T3 |DONE| Decide on `cargo chef prepare` exclusion | Neither `cargo chef prepare` nor `cargo chef cook` exposes an `--exclude` flag. The COPY/stub lines for both excluded packages **must stay** so that `cargo metadata` (invoked by `prepare`) can resolve the workspace without missing manifest files. See Containerfile comment and AC4. |
100
+
| T4 | TODO | Run full CI build and record timing evidence | CI log showing build time after exclusion. Compare against pre-fix baseline (19m03s build step, 38m total).|
101
101
102
102
## Progress Tracking
103
103
@@ -107,8 +107,8 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.
107
107
-[x] Spec reviewed and approved by user/maintainer
108
108
-[x] GitHub issue created and issue number added to this spec
109
109
-[ ] (Optional, recommended for complex issues) Spec-only PR merged into `develop` before implementation
110
-
-[] Implementation completed
111
-
-[] Automatic verification completed (`linter all`, relevant tests, and any pre-push checks)
110
+
-[x] Implementation completed
111
+
-[x] Automatic verification completed (`linter all`, relevant tests, and any pre-push checks)
112
112
-[ ] Manual verification scenarios executed and recorded (status + evidence)
113
113
-[ ] Acceptance criteria reviewed after implementation and updated with evidence
114
114
-[ ] Reviewer validated acceptance criteria and updated checkboxes
@@ -119,15 +119,16 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.
119
119
120
120
- 2026-06-03 00:00 UTC - GitHub Copilot - Drafted issue spec based on post-merge CI analysis of #1853 - draft file created
121
121
- 2026-06-03 00:00 UTC - GitHub Copilot - Narrowed scope to `--exclude` fix only; layer split analysis moved to dependency-layer-cache-reuse draft - draft updated
122
+
- 2026-06-03 00:00 UTC - GitHub Copilot - Implemented: added `--exclude workspace-coupling --exclude torrust-tracker-torrent-repository-benchmarking` to all 4 `cargo nextest archive` commands in Containerfile; investigated and documented that `cargo chef cook` and `cargo chef prepare` do not support `--exclude` (cargo-chef CLI limitation); COPY/stub lines for excluded packages retained in recipe stage because `cargo chef prepare` invokes `cargo metadata` which requires all workspace manifests to be present
122
123
123
124
## Acceptance Criteria
124
125
125
126
-[ ] AC1: `workspace-coupling` and `torrust-tracker-torrent-repository-benchmarking` do not appear in the container build compilation output.
126
127
-[ ] AC2: The final `cargo nextest archive` step in the CI build completes in measurably less time than the 19m03s baseline recorded after #1853.
127
128
-[ ] AC3: The tracker runtime image is produced correctly and all unit tests still pass inside the container build.
128
-
-[] AC4: The decision on `cargo chef prepare` exclusion is documented with rationale (either in the Containerfile comments or in this spec).
129
-
-[]`linter all` exits with code `0`
130
-
-[] Relevant tests pass
129
+
-[x] AC4: The decision on `cargo chef prepare`and `cargo chef cook`exclusion is documented: neither tool exposes `--exclude` in its CLI (cargo-chef limitation). `cargo chef prepare` uses `cargo metadata` internally, which requires every workspace member's manifest to exist on disk — the COPY/stub lines for the excluded packages are therefore retained in the recipe stage. `cargo chef cook` similarly has no `--exclude` flag; the exclusion is achieved entirely through the 4 `cargo nextest archive` commands where standard Cargo `--exclude` is supported. This is documented in Containerfile comments.
130
+
-[x]`linter all` exits with code `0`
131
+
-[x] Relevant tests pass
131
132
-[ ] Manual verification scenarios are executed and documented (status + evidence)
132
133
-[ ] Acceptance criteria are re-reviewed after implementation and reflect actual behavior
133
134
-[ ] Documentation is updated when behavior/workflow changes
0 commit comments