Skip to content

Commit d77aab7

Browse files
committed
Merge torrust#837: Prepare for edition 2024 by pinning pre-2024 dependencies
07a5a6b chore: prepare for edition 2024 by pinning pre-2024 dependencies (Cameron Garnham) Pull request description: Several upstream crates have started shipping releases that require Rust edition 2024 (`rustc ≥ 1.85`). Rather than migrating the entire workspace to edition 2024 in one sweep, this PR takes the incremental approach: **pin or downgrade every transitive dependency that requires edition 2024** so the workspace stays on edition 2021 for now. ### What changed **Dependencies** — Downgraded `jsonwebtoken` from v10 to v9.3, pinned `rand` to 0.9, and locked ~30 transitive crates in Cargo.lock to their last edition-2021-compatible versions (notably `time`, `clap`, `image`, `uuid`, `tera`, and friends). The full pin table is documented in ADR-T-003. **MSRV raised to 1.83** — Even after all the edition-2024 pins, the remaining dependency floor (set by crates like `async-compression`, `crc`, `icu_*`, `pest*`) is rustc 1.83. The workspace `rust-version` is updated accordingly and a new **MSRV CI job** in the testing workflow ensures we don't regress. **Source changes** — `rand 0.9` renames `rand::RngExt` → `rand::Rng`; all call sites updated. One `clippy::missing_const_for_fn` allow added in the render-text-as-image package. No behavioural changes. **CI bumps** — `actions/checkout` v4→v6, `docker/setup-buildx-action` v3→v4, `docker/login-action` v3→v4, `actions/upload-artifact` v4→v7, `actions/github-script` v7→v8. **ADR housekeeping** — Moved `docs/adrs/` → adr using the `ADR-T-NNN` naming convention. Rewrote existing ADRs in formal style. Added ADR-T-003 documenting this decision, options considered, and the full list of pinned crates. Normalised cross-references across the render-text-as-image package (`§ADR R-NNN` → `ADR-R-NNN`). ### Why not just jump to edition 2024? Edition 2024 introduces new lints and language changes that touch a lot of first-party code. Migrating the edition is better done as a focused, standalone effort (tracked for a future ADR). This PR buys that time by keeping everything building and tested on edition 2021 while the ecosystem settles. ### Version bump Workspace version → **3.1.0-develop**. ACKs for top commit: da2ce7: ACK 07a5a6b Tree-SHA512: 8b62dcdfd2ecadb520ce9b223da95842afa68e6040ec788c210aae010154f9edcbf94621167f7e6badc99d7eae822b4292bd80fbb9fa13a582f09224218f9d70
2 parents b5a40b6 + 07a5a6b commit d77aab7

81 files changed

Lines changed: 770 additions & 540 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/container.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- id: setup
2828
name: Setup Toolchain
29-
uses: docker/setup-buildx-action@v3
29+
uses: docker/setup-buildx-action@v4
3030

3131
- id: build
3232
name: Build
@@ -46,7 +46,7 @@ jobs:
4646

4747
- id: checkout
4848
name: Checkout Repository
49-
uses: actions/checkout@v4
49+
uses: actions/checkout@v6
5050

5151
- id: compose
5252
name: Compose
@@ -117,14 +117,14 @@ jobs:
117117
118118
- id: login
119119
name: Login to Docker Hub
120-
uses: docker/login-action@v3
120+
uses: docker/login-action@v4
121121
with:
122122
username: ${{ vars.DOCKER_HUB_USERNAME }}
123123
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
124124

125125
- id: setup
126126
name: Setup Toolchain
127-
uses: docker/setup-buildx-action@v3
127+
uses: docker/setup-buildx-action@v4
128128

129129
- name: Build and push
130130
uses: docker/build-push-action@v6
@@ -158,14 +158,14 @@ jobs:
158158
159159
- id: login
160160
name: Login to Docker Hub
161-
uses: docker/login-action@v3
161+
uses: docker/login-action@v4
162162
with:
163163
username: ${{ vars.DOCKER_HUB_USERNAME }}
164164
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
165165

166166
- id: setup
167167
name: Setup Toolchain
168-
uses: docker/setup-buildx-action@v3
168+
uses: docker/setup-buildx-action@v4
169169

170170
- name: Build and push
171171
uses: docker/build-push-action@v6

.github/workflows/coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323

2424
- name: Install LLVM tools
2525
run: sudo apt-get update && sudo apt-get install -y llvm

.github/workflows/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- id: checkout
1919
name: Checkout Repository
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
2121

2222
- id: setup
2323
name: Setup Toolchain
@@ -42,7 +42,7 @@ jobs:
4242
steps:
4343
- id: checkout
4444
name: Checkout Repository
45-
uses: actions/checkout@v4
45+
uses: actions/checkout@v6
4646

4747
- id: setup
4848
name: Setup Toolchain

.github/workflows/e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- id: checkout
2424
name: Checkout Repository
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
2626

2727
- id: setup
2828
name: Setup Toolchain

.github/workflows/generate_coverage_pr.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323

2424
- name: Install LLVM tools
2525
run: sudo apt-get update && sudo apt-get install -y llvm
@@ -63,13 +63,13 @@ jobs:
6363
# Triggered sub-workflow is not able to detect the original commit/PR which is available
6464
# in this workflow.
6565
- name: Store PR number
66-
uses: actions/upload-artifact@v4
66+
uses: actions/upload-artifact@v7
6767
with:
6868
name: pr_number
6969
path: pr_number.txt
7070

7171
- name: Store commit SHA
72-
uses: actions/upload-artifact@v4
72+
uses: actions/upload-artifact@v7
7373
with:
7474
name: commit_sha
7575
path: commit_sha.txt
@@ -78,7 +78,7 @@ jobs:
7878
# is executed by a different workflow `upload_coverage.yml`. The reason for this
7979
# split is because `on.pull_request` workflows don't have access to secrets.
8080
- name: Store coverage report in artifacts
81-
uses: actions/upload-artifact@v4
81+
uses: actions/upload-artifact@v7
8282
with:
8383
name: codecov_report
8484
path: ./codecov.json

.github/workflows/labels.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
- id: checkout
2727
name: Checkout Repository
28-
uses: actions/checkout@v4
28+
uses: actions/checkout@v6
2929

3030
- id: sync
3131
name: Apply Labels from File

.github/workflows/testing.yaml

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- id: checkout
1717
name: Checkout Repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919

2020
- id: setup
2121
name: Setup Toolchain
@@ -32,6 +32,50 @@ jobs:
3232
name: Run Formatting-Checks
3333
run: cargo fmt --check
3434

35+
msrv:
36+
name: MSRV
37+
runs-on: ubuntu-latest
38+
needs: format
39+
40+
steps:
41+
- id: checkout
42+
name: Checkout Repository
43+
uses: actions/checkout@v6
44+
45+
- id: msrv
46+
name: Read MSRV from Cargo.toml
47+
run: |
48+
MSRV=$(sed -n 's/^rust-version = "\(.*\)"/\1/p' Cargo.toml | head -1)
49+
echo "version=$MSRV" >> "$GITHUB_OUTPUT"
50+
51+
- id: setup
52+
name: Setup Toolchain
53+
uses: dtolnay/rust-toolchain@stable
54+
with:
55+
toolchain: ${{ steps.msrv.outputs.version }}
56+
57+
- id: cache
58+
name: Enable Workflow Cache
59+
uses: Swatinem/rust-cache@v2
60+
61+
- id: check
62+
name: Run Build Checks
63+
run: cargo check --workspace --all-targets --all-features
64+
65+
- id: imdl
66+
name: Install Intermodal
67+
run: |
68+
rustup install stable
69+
cargo +stable install imdl
70+
71+
- id: test-docs
72+
name: Run Documentation Tests
73+
run: cargo test --doc
74+
75+
- id: test
76+
name: Run Unit Tests
77+
run: cargo test --workspace --all-targets --all-features
78+
3579
check:
3680
name: Static Analysis
3781
runs-on: ubuntu-latest
@@ -44,7 +88,7 @@ jobs:
4488
steps:
4589
- id: checkout
4690
name: Checkout Repository
47-
uses: actions/checkout@v4
91+
uses: actions/checkout@v6
4892

4993
- id: setup
5094
name: Setup Toolchain
@@ -97,7 +141,7 @@ jobs:
97141
steps:
98142
- id: checkout
99143
name: Checkout Repository
100-
uses: actions/checkout@v4
144+
uses: actions/checkout@v6
101145

102146
- id: setup
103147
name: Setup Toolchain
@@ -134,7 +178,7 @@ jobs:
134178
steps:
135179
- id: checkout
136180
name: Checkout Repository
137-
uses: actions/checkout@v4
181+
uses: actions/checkout@v6
138182

139183
- id: setup
140184
name: Setup Toolchain

.github/workflows/upload_coverage_pr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- name: "Download existing coverage report"
2424
id: prepare_report
25-
uses: actions/github-script@v7
25+
uses: actions/github-script@v8
2626
with:
2727
script: |
2828
var fs = require('fs');
@@ -96,7 +96,7 @@ jobs:
9696
echo "override_commit=$(<commit_sha.txt)" >> "$GITHUB_OUTPUT"
9797
9898
- name: Checkout repository
99-
uses: actions/checkout@v4
99+
uses: actions/checkout@v6
100100
with:
101101
ref: ${{ steps.parse_previous_artifacts.outputs.override_commit || '' }}
102102
path: repo_root

AGENTS.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,41 @@ API, perhaps using `#[doc(hidden)]` helpers when appropriate.
3434
| Crate | `pub(crate)` | `/src/tests/` |
3535
| Integration | `pub` | `/tests/` |
3636

37+
38+
## Test Doc-Headers
39+
40+
Every test file (module) should maintain an index of the tests contained in the module-doc. The primary purpose is to make it easy to scan the test files to detect duplicates or overlapping coverage. Please opportunistically create if missing.
41+
3742
## Cross-Reference Conventions
3843

3944
Eagerly corrected when spotted in **any** file!
4045

4146
Cross-references use the `§` (section sign) prefix. Every reference
42-
carries a **package qualifier**`T-` for Torrust —
43-
so the target document is never ambiguous.
47+
carries a **package qualifier** so the target document is never ambiguous.
48+
ADR references (`ADR-T-001`, `ADR-R-001`, …) are an exception — they
49+
use their own `ADR-<PREFIX>-<NNN>` form without the `§` prefix.
50+
51+
| Prefix | Package | Example document |
52+
|--------|----------------------|--------------------------------------|
53+
| `T-` | Torrust (root crate) | *(none yet)* |
54+
| `R-` | render-text-as-image | `packages/render-text-as-image/` |
4455

4556
### General Rules
4657

47-
- Use `§§` for ranges: e.g. `§§ALGO M-12.2–12.5`.
58+
- Use `§§` for ranges: e.g. `§§IDEA M-12.2–12.5`.
4859
- Bare `§N` (no label) is acceptable **within** a document that already
49-
establishes context (e.g. inside `algorithm.md` itself), but in source
60+
establishes context (e.g. inside `idea.md` itself), but in source
5061
code and cross-package references always use the fully qualified
5162
`§BOOK PACKAGE_PREFIX-N` form.
63+
- Example: `§SPEC R-1.1` refers to §1.1 of `packages/render-text-as-image/docs/specification.md`.
64+
- ADRs live in an `adr/` directory per package (`/adr/` for the
65+
root crate) and use sequential numbering: `NNN-slug.md`. Referenced
66+
as `ADR-T-001`, `ADR-R-001`, `ADR-R-002`.
5267

5368
## Replacing a File
5469

70+
To avoid partial or corrupted writes, always replace files atomically:
71+
5572
1. Read the file.
5673
2. Using the CLI, `rm` the file.
5774
3. Recreate the file.

0 commit comments

Comments
 (0)