Skip to content

Commit 07a5a6b

Browse files
committed
chore: prepare for edition 2024 by pinning pre-2024 dependencies
Raise MSRV to 1.83 and pin transitive dependencies to versions that do not require edition 2024, keeping the workspace on edition 2021. Bump workspace version to 3.1.0-develop. Cargo.toml: - rust-version: 1.80 → 1.83 - jsonwebtoken: 10 (rust_crypto) → 9.3 - rand: 0 → 0.9 - Fix LocatedError to v3.0.0 Cargo.lock: - Downgrade or remove ~30 crates whose latest releases set edition 2024 or pull edition-2024 transitive deps (time, clap, image, rand, uuid, tera, and others — see ADR-T-003 for the full table). Source: - rand::RngExt → rand::Rng (renamed in rand 0.9) - Allow clippy::missing_const_for_fn on map_error_to_image CI: - Bump 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 - Add MSRV job to testing workflow ADRs: - Move docs/adrs/ → adr/ with ADR-T-NNN naming convention - Rewrite adrs in formal style - Add ADR-T-003: Preparing for Rust Edition 2024 - Add ADR index to README.md - Normalise §ADR R-NNN → ADR-R-NNN across render-text-as-image AGENTS.md: - Add Test Doc-Headers and cross-reference prefix table - Clarify atomic file replacement procedure# modified: packages/render-text-as-image/adr/001-dependency-selection.md
1 parent b5a40b6 commit 07a5a6b

29 files changed

Lines changed: 663 additions & 993 deletions

.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)