Document and verify published product imports

This commit is contained in:
2026-12-02 16:49:46 +00:00
parent 56483f9064
commit e5d91cb19b
32 changed files with 330 additions and 265 deletions

View File

@@ -13,7 +13,7 @@ import (
func loadPriorPublishCommit(ctx context.Context, store storage.ObjectStore, sessionPrefix, campaign, sessionID string) (*artifacts.RemoteCommitManifest, error) {
current, err := artifacts.LoadCurrentInventory(ctx, store, sessionPrefix, artifacts.CurrentStateValidation{
ExpectedCampaign: campaign, ExpectedSessionID: sessionID, ValidateRunID: true,
ExpectedCampaign: campaign, ExpectedSessionID: sessionID,
})
if errors.Is(err, artifacts.ErrCurrentCommitPointerMissing) {
return nil, nil

View File

@@ -795,7 +795,7 @@ func TestPublishCarriesLockedRequiredOutputAndCommits(t *testing.T) {
t.Fatalf("carried published output metadata = %#v", outcome)
}
state, err := artifacts.LoadCurrentInventory(context.Background(), fake, m.S3SessionPrefix, artifacts.CurrentStateValidation{ValidateRunID: true})
state, err := artifacts.LoadCurrentInventory(context.Background(), fake, m.S3SessionPrefix, artifacts.CurrentStateValidation{})
if err != nil {
t.Fatal(err)
}
@@ -971,7 +971,7 @@ func TestPublishFailurePreservesPreviousCommittedSnapshotAndRetryIsDeterministic
if got := fake.Objects[pointerKey].Data; !reflect.DeepEqual(got, priorPointer) {
t.Fatalf("current pointer changed after failed publication: %q", got)
}
state, err := artifacts.LoadCurrentInventory(context.Background(), fake, m.S3SessionPrefix, artifacts.CurrentStateValidation{ValidateRunID: true})
state, err := artifacts.LoadCurrentInventory(context.Background(), fake, m.S3SessionPrefix, artifacts.CurrentStateValidation{})
if err != nil {
t.Fatalf("LoadCurrentState() error = %v", err)
}
@@ -992,7 +992,7 @@ func TestPublishFailurePreservesPreviousCommittedSnapshotAndRetryIsDeterministic
if len(fake.Uploads) == 0 || fake.Uploads[len(fake.Uploads)-1].Key != pointerKey {
t.Fatalf("retry uploads = %#v, want pointer as final mutation", fake.Uploads)
}
state, err = artifacts.LoadCurrentInventory(context.Background(), fake, m.S3SessionPrefix, artifacts.CurrentStateValidation{ValidateRunID: true})
state, err = artifacts.LoadCurrentInventory(context.Background(), fake, m.S3SessionPrefix, artifacts.CurrentStateValidation{})
if err != nil {
t.Fatalf("LoadCurrentState() after retry error = %v", err)
}
@@ -1051,7 +1051,7 @@ func TestPublishDoesNotSelectCommitWhenLockAppearsAtCommitPoint(t *testing.T) {
if _, exists := fake.Objects[commitKey]; !exists {
t.Fatalf("immutable attempt commit %q missing after final lock appeared", commitKey)
}
state, err := artifacts.LoadCurrentInventory(context.Background(), fake, m.S3SessionPrefix, artifacts.CurrentStateValidation{ValidateRunID: true})
state, err := artifacts.LoadCurrentInventory(context.Background(), fake, m.S3SessionPrefix, artifacts.CurrentStateValidation{})
if err != nil || state.RunID != oldRunID {
t.Fatalf("current state after lock loss = %#v, %v; want old run %q", state, err, oldRunID)
}