Skip to content

Commit 75ad2fe

Browse files
add global-min-publish-age (#492)
Two conflicts resolved against the v0.10.0 base: security-audit.yml adopts the cooldown step onto that release's audit workflow, which still uses actions-rs/audit-check, and Cargo.lock is reconciled onto v0.10.0's dependency tree rather than main's. Dropping the pinned reqwest-eventsource collapses a duplicate copy of the crate that v0.10.0 carried at both 0.5.0 and 0.6.0. Co-authored-by: Manuel Iñaki Bilbao <manuel.bilbao@lambdaclass.com> (cherry picked from commit 0d3eb68)
1 parent 260afcd commit 75ad2fe

11 files changed

Lines changed: 157 additions & 321 deletions

File tree

‎.cargo/config.toml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Supply-chain cooldown for dependency resolution (unstable min-publish-age,
2+
# tracking issue rust-lang/cargo#17009): crate versions published less than
3+
# 14 days ago are excluded when the resolver runs on a nightly cargo.
4+
# Stable cargo ignores these tables silently, so builds from the committed
5+
# Cargo.lock are unaffected; run `just update` to resolve under the policy.
6+
# When the feature stabilizes, drop the [unstable] table and the nightly
7+
# resolver pin in the justfile: the policy then binds all resolution.
8+
# The fmt nightly (older than the feature) prints an unused-key warning
9+
# for these tables; harmless.
10+
[unstable]
11+
min-publish-age = true
12+
13+
[registry]
14+
global-min-publish-age = "14 days"

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2525

2626
- name: Install Rust toolchain
27-
uses: dtolnay/rust-toolchain@master
27+
uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # v1
2828
with:
2929
toolchain: nightly-2026-01-01
30-
components: clippy, rustfmt
30+
components: rustfmt
3131

3232
- name: Install protoc
3333
run: sudo provisioning/protoc.sh
@@ -41,7 +41,7 @@ jobs:
4141
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
4242

4343
- name: Check compilation
44-
run: cargo check
44+
run: cargo check --locked
4545

4646
- name: Check formatting
4747
run: just fmt-check

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ jobs:
207207
${{ runner.os }}-cargo-build-
208208
209209
- name: Build binary (Darwin)
210-
run: cargo build --release --target ${{ matrix.target }} --bin ${{ matrix.name }}
210+
run: cargo build --locked --release --target ${{ matrix.target }} --bin ${{ matrix.name }}
211211

212212
- name: Package binary (Darwin)
213213
run: |

‎.github/workflows/security-audit.yml‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,23 @@ jobs:
2121
- uses: actions/checkout@v6
2222
- uses: actions-rs/audit-check@v1.2.0
2323
with:
24-
token: ${{ secrets.GITHUB_TOKEN }}
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
# Stable cargo ignores the publish-age policy, so the lockfile can pin
26+
# too-young crates (or deliberately via `just update-allow`); surface them.
27+
- name: Check lockfile against the publish-age cooldown
28+
run: |
29+
if ! rustup toolchain install nightly-2026-06-21 --profile minimal; then
30+
echo "::warning title=Publish-age cooldown check skipped::toolchain install failed"
31+
exit 0
32+
fi
33+
if ! cargo +nightly-2026-06-21 update --dry-run -Z min-publish-age > cooldown.txt 2>&1; then
34+
msg=$(head -20 cooldown.txt | sed ':a;N;$!ba;s/\n/%0A/g') # %0A = newline in annotations
35+
echo "::warning title=Publish-age cooldown probe failed::$msg"
36+
exit 0
37+
fi
38+
hits=$(grep -E "Downgrading|is too new" cooldown.txt || true)
39+
if [ -n "$hits" ]; then
40+
count=$(echo "$hits" | wc -l)
41+
msg=$(echo "$hits" | head -20 | sed ':a;N;$!ba;s/\n/%0A/g')
42+
echo "::warning title=Lockfile pins $count crate(s) younger than the publish-age cooldown::$msg"
43+
fi

0 commit comments

Comments
 (0)