Skip to content

Commit aba0d1c

Browse files
committed
Fetch full Git history for retirement provenance in CI
Require fetch-depth zero for all CI and release checkout steps. The new regression fails on the previous shallow defaults and passes on the updated workflows. Native integration proof: 788 passed, 1 existing ignored; all 10 CLI tests passed. No runtime or consumer behavior changed.
1 parent 6b3cac0 commit aba0d1c

3 files changed

Lines changed: 42 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
RMS_TEST_SHARD: ${{ matrix.shard }}
2222
steps:
2323
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
2426
- uses: dtolnay/rust-toolchain@stable
2527
- uses: actions/setup-python@v5
2628
with:
@@ -58,6 +60,8 @@ jobs:
5860
CARGO_BUILD_JOBS: "2"
5961
steps:
6062
- uses: actions/checkout@v4
63+
with:
64+
fetch-depth: 0
6165
- uses: dtolnay/rust-toolchain@stable
6266
- uses: actions/setup-python@v5
6367
with:
@@ -92,6 +96,8 @@ jobs:
9296
shell: pwsh
9397
run: git config --global core.longpaths true
9498
- uses: actions/checkout@v4
99+
with:
100+
fetch-depth: 0
95101
- uses: dtolnay/rust-toolchain@stable
96102
- name: Cross-platform behavioral-contract corpus
97103
run: cargo test -p rms --locked behavioral_contract::tests
@@ -107,6 +113,8 @@ jobs:
107113
runs-on: ubuntu-latest
108114
steps:
109115
- uses: actions/checkout@v4
116+
with:
117+
fetch-depth: 0
110118
- uses: dtolnay/rust-toolchain@stable
111119
- uses: actions/setup-python@v5
112120
with:

‎.github/workflows/release.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
1719
- uses: dtolnay/rust-toolchain@stable
1820
- name: Check tag version
1921
run: |
@@ -45,6 +47,8 @@ jobs:
4547
runs-on: ubuntu-latest
4648
steps:
4749
- uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
4852
- uses: dtolnay/rust-toolchain@stable
4953
- name: Package source crate
5054
run: |
@@ -76,6 +80,8 @@ jobs:
7680
shell: pwsh
7781
run: git config --global core.longpaths true
7882
- uses: actions/checkout@v4
83+
with:
84+
fetch-depth: 0
7985
- uses: dtolnay/rust-toolchain@stable
8086
- name: Build release binary
8187
run: cargo build --release -p rms --locked
@@ -115,6 +121,8 @@ jobs:
115121
runs-on: ubuntu-latest
116122
steps:
117123
- uses: actions/checkout@v4
124+
with:
125+
fetch-depth: 0
118126
- uses: actions/download-artifact@v4
119127
with:
120128
path: dist

‎tooling/rust/rms/tests/cli_smoke.rs‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,32 @@ fn repository_root() -> PathBuf {
152152
.to_path_buf()
153153
}
154154

155+
#[test]
156+
fn ci_workflows_fetch_complete_provenance_history() {
157+
for file in [".github/workflows/ci.yml", ".github/workflows/release.yml"] {
158+
let workflow: serde_yaml::Value =
159+
serde_yaml::from_str(&fs::read_to_string(repository_root().join(file)).unwrap())
160+
.unwrap();
161+
let mut checkouts = 0;
162+
for job in workflow["jobs"].as_mapping().unwrap().values() {
163+
for step in job["steps"].as_sequence().unwrap() {
164+
if step["uses"]
165+
.as_str()
166+
.is_some_and(|value| value.starts_with("actions/checkout@"))
167+
{
168+
checkouts += 1;
169+
assert_eq!(
170+
step["with"]["fetch-depth"].as_u64(),
171+
Some(0),
172+
"{file}: retirement provenance requires full Git history"
173+
);
174+
}
175+
}
176+
}
177+
assert!(checkouts > 0, "{file}: no checkout found");
178+
}
179+
}
180+
155181
fn run_probe(arguments: &[&str]) -> Output {
156182
Command::new(env!("CARGO_BIN_EXE_rms"))
157183
.current_dir(repository_root())

0 commit comments

Comments
 (0)