Show carried output locations
This commit is contained in:
@@ -193,7 +193,9 @@ func remotePublishedOutputAvailabilityForCurrent(
|
||||
continue
|
||||
}
|
||||
state += "remote=published"
|
||||
if identity.RunID != current.RunID {
|
||||
if outcome == "carried_locked" || identity.RunID != current.RunID {
|
||||
state += " declared_dest=" + identity.Destination
|
||||
state += " declared_key=" + declaration.DestinationKey
|
||||
state += " origin_run=" + identity.RunID
|
||||
}
|
||||
out[publishedOutputRemoteStateKey(source, dest)] = state
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
@@ -145,7 +146,7 @@ func TestCommittedStatusReportsCarriedOutputOriginAndChecksExactKey(t *testing.T
|
||||
"transcripts/full.json": []byte("carried\n"),
|
||||
})
|
||||
const originRun = "20260512T010203Z-11223344"
|
||||
oldKey := artifacts.S3RunRelativeDestinationKey(artifacts.S3RunPrefix(current.SessionPrefix, originRun), "published/transcripts/full.json")
|
||||
oldKey := artifacts.S3RunRelativeDestinationKey(artifacts.S3RunPrefix(current.SessionPrefix, originRun), "published/transcripts/original.json")
|
||||
fake.SeedObject(storage.FakeObject{Key: oldKey, Data: []byte("carried\n")})
|
||||
current.Commit.Artifacts[1].Source = "narratio.transcript.final_trimmed"
|
||||
current.Commit.Artifacts[1].DestinationKey = oldKey
|
||||
@@ -158,13 +159,20 @@ func TestCommittedStatusReportsCarriedOutputOriginAndChecksExactKey(t *testing.T
|
||||
|
||||
availability := remotePublishedOutputAvailabilityForCurrent(context.Background(), cfg, fake, nil, current)
|
||||
key := publishedOutputRemoteStateKey("narratio.transcript.final_trimmed", "transcripts/full.json")
|
||||
want := "outcome=carried_locked remote=published origin_run=" + originRun
|
||||
want := "outcome=carried_locked remote=published declared_dest=transcripts/original.json declared_key=" + oldKey + " origin_run=" + originRun
|
||||
if availability[key] != want {
|
||||
t.Fatalf("availability = %#v, want %q", availability, want)
|
||||
}
|
||||
if len(fake.ExistsKeys) == 0 || fake.ExistsKeys[len(fake.ExistsKeys)-1] != oldKey {
|
||||
t.Fatalf("exists keys = %#v, want final exact declaration key %q", fake.ExistsKeys, oldKey)
|
||||
}
|
||||
var rendered bytes.Buffer
|
||||
writePublishedOutputLine(&rendered, cfg.Pipeline.Publish.Outputs[0], nil, nil, availability)
|
||||
for _, fragment := range []string{"dest=transcripts/full.json", "declared_dest=transcripts/original.json", "declared_key=" + oldKey, "origin_run=" + originRun} {
|
||||
if !strings.Contains(rendered.String(), fragment) {
|
||||
t.Fatalf("rendered output = %q, want %q", rendered.String(), fragment)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCommittedPublishOutputOutcomesRecognizesAllStates(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user