Regenerate expired TUF test fixtures - #2000
Conversation
The TUF test fixtures across three packages shared a baked-in expiry of 2026-07-18T08:24:13Z, which has now passed. Any test run after that date failed constructing a TUF client with "final root.json is expired", reddening CI on main and every open PR. Affected packages/tests: - pkg/reconciler/trustroot: TestReconcile/With_repository and the trusted_root.json variant (embedded testdata/*). - pkg/apis/policy/v1alpha1: TestTrustRootValidation (inline base64 blobs). - pkg/tuf: TestDownloadTargetFromSerializedMirror and TestClientFromSerializedMirror (inline base64 blobs, byte-identical to the v1alpha1 ones). Regenerate all three together (they must share the same trust anchor): - Reconciler testdata via `make generate-testdata`. - The inline validRepository/rootJSON blobs in pkg/tuf and pkg/apis/policy/v1alpha1 from the freshly generated tufRepo.tar and root.json. Also refresh the stale "next expiration" comments and replace the manual kind-cluster generation notes with a pointer to `make generate-testdata`. Note: the scaffolding repo builder hardcodes a 6-month expiry, so these fixtures will need periodic regeneration (next: 2027-01-28). Fixes sigstore#1999 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0ce53efa-a7e9-4046-a24e-34c406601950 Signed-off-by: Nell Shamrell <nellshamrell@gmail.com>
|
Filed #2001 as a follow-up to address the recurring 6-month expiry so this stops needing periodic regeneration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2000 +/- ##
=======================================
Coverage 30.73% 30.73%
=======================================
Files 122 122
Lines 7409 7409
=======================================
Hits 2277 2277
Misses 4897 4897
Partials 235 235 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Note on the failing e2e checksThe failing jobs on this PR are all e2e, and they fail at the This is a pre-existing, repo-wide infrastructure failure, not caused by this change:
The unit-test layer this PR targets is green ( |
|
Follow-up: I've opened #2002 to fix the repo-wide e2e/build CI breakage referenced above. The failures on this PR ( |
|
Closing in favor of pulling these changes into #2002 |
Summary
The TUF test fixtures across three packages shared a baked-in expiry of
2026-07-18T08:24:13Z, which has now passed. Any test run after that date fails to construct a TUF client withfinal root.json is expired, reddening CI onmainand every open PR.Fixes #1999.
Affected packages / tests
pkg/reconciler/trustroot—TestReconcile/With_repositoryand thetrusted_root.jsonvariant (embeddedtestdata/*).pkg/apis/policy/v1alpha1—TestTrustRootValidation(inline base64 blobs).pkg/tuf—TestDownloadTargetFromSerializedMirrorandTestClientFromSerializedMirror(inline base64 blobs, byte-identical to the v1alpha1 ones). This third package was not listed in the original issue; found while preparing the fix.Changes
pkg/reconciler/trustroot/testdata/*viamake generate-testdata.validRepository/rootJSONblobs inpkg/tufandpkg/apis/policy/v1alpha1with the freshly generatedtufRepo.tarandroot.json(base64-encoded). All three fixtures now chain to the same fresh trust anchor.next expirationcomments and replaced the manual kind-cluster generation notes with a pointer tomake generate-testdata.Validation
go test ./pkg/tuf/... ./pkg/apis/policy/v1alpha1/... ./pkg/reconciler/trustroot/...— passgo test ./...— passgofmt/go vet— cleanNote
The scaffolding repo builder hardcodes a 6-month expiry, so these fixtures will need periodic regeneration (next:
2027-01-28). A longer-lived or clock-injectable fixture would avoid the recurrence; happy to follow up separately if maintainers prefer that direction.