Skip to content

Commit 281cd54

Browse files
author
keeper
committed
test(pipeline): the prefix telling two comparisons apart was unpinned
1 parent f89b556 commit 281cd54

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

internal/pipeline/drill_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,17 @@ func TestADrillCatchesABundleMissingHistoryTheSourceHad(t *testing.T) {
298298
t.Errorf("mismatches do not name the missing branch: %v", r.Mismatches)
299299
}
300300

301+
// And it is prefixed, because the prefix is the only thing that says which comparison
302+
// failed. SPEC.md names it as part of gitdr.drill/v1 and the control plane splits on it:
303+
// counting the array without reading it told an auditor that refs "came back at a different
304+
// commit" about a drill where every ref came back exactly as the bundle declared. Dropping
305+
// the prefix would reintroduce that silently, in a different repository, months later.
306+
for _, mm := range r.Mismatches {
307+
if strings.Contains(mm, "refs/heads/release") && !strings.HasPrefix(mm, "source: ") {
308+
t.Errorf("a source mismatch is not prefixed \"source: \": %q", mm)
309+
}
310+
}
311+
301312
// Every declared ref is accounted for exactly once: it came back at the same commit, a
302313
// clone created nothing for it, or it came back at a different one.
303314
//

0 commit comments

Comments
 (0)