Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions crates/registry-evidencectl/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ fn runtime_failure<T>(message: &str) -> Result<T> {
fn parse_bundle_revision(stdout: &str) -> Result<String> {
let revision = stdout
.lines()
.find_map(|line| line.strip_prefix("Evidence deployment "))
.find_map(|line| line.strip_prefix("Evidence bundle "))
.and_then(|line| line.split_whitespace().next())
.filter(|value| {
value.len() == 71
Expand Down Expand Up @@ -637,12 +637,19 @@ requirements: []

#[test]
fn revision_and_secret_reference_parsing_are_closed() {
let revision = format!("Evidence deployment sha256:{}\n", "a".repeat(64));
let revision = format!(
"Evidence bundle sha256:{} passed check (2 requirements)\n",
"a".repeat(64)
);
assert_eq!(
parse_bundle_revision(&revision).expect("revision"),
format!("sha256:{}", "a".repeat(64))
);
assert!(parse_bundle_revision("Evidence deployment sha256:not-a-digest\n").is_err());
assert!(parse_bundle_revision(
"Evidence deployment sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
)
.is_err());
assert!(parse_bundle_revision("Evidence bundle sha256:not-a-digest\n").is_err());

let names = secret_references(&json!({
"z": "secret:file/source-token",
Expand Down
2 changes: 1 addition & 1 deletion crates/registry-evidencectl/tests/production_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ if [ "$failure" = "fixture:$fixture" ]; then
fi

if [ -z "$fixture" ]; then
printf '%s\n' 'Evidence deployment sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa / sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb passed check'
printf '%s\n' 'Evidence bundle sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa passed check (2 requirements)'
else
printf '%s\n' 'Evidence fixture passed (1 evaluated cases)'
fi
Expand Down
16 changes: 16 additions & 0 deletions crates/registry-evidencectl/tests/production_handoff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,22 @@ fn production_candidate_accepts_a_token_from_an_independent_real_mint() {
);
}

#[test]
#[ignore = "exact gate: runs the real production builder and sibling Evidence bundle check"]
fn production_build_accepts_the_real_bundle_check_revision() {
let fixture = Fixture::new();
let evidence = evidence_binary();
fixture.stage_authoring_project();
fixture.stage_four_shape_project();
fixture.stage_target();
fixture.authorize_four_shapes();

let output = fixture.build(evidence);
let revision = bundle_revision(&output);
assert!(revision.starts_with("sha256:"));
assert!(fixture.candidate.join("bundle/evidence.yaml").is_file());
}

#[test]
#[ignore = "exact gate: runs the real production builder across all four authoring shapes"]
fn production_build_checks_and_evaluates_every_neutral_authoring_shape() {
Expand Down