Use canonical source identities in publication reports

This commit is contained in:
2026-11-20 13:45:17 +00:00
parent f44078724a
commit 672b7f0ebd
3 changed files with 52 additions and 4 deletions

View File

@@ -261,9 +261,10 @@ func inspectPublishedOutputs(ctx context.Context, cfg *config.Config, store stor
}
var resultErr error
for _, rule := range rules {
destination, err := artifactpolicy.ResolvePublishedDestinationWithExtractions(strings.TrimSpace(rule.Source), rule.Dest, configuredOutputs, extractionOutputs)
_, isLocked := locked[rule.Source]
output := sessionPublishedOutput{Source: rule.Source, Destination: destination, Required: rule.Required == nil || *rule.Required, LockState: "unknown", State: "missing", Outcome: outcomes[rule.Source]}
source := strings.TrimSpace(rule.Source)
destination, err := artifactpolicy.ResolvePublishedDestinationWithExtractions(source, rule.Dest, configuredOutputs, extractionOutputs)
_, isLocked := locked[source]
output := sessionPublishedOutput{Source: source, Destination: destination, Required: rule.Required == nil || *rule.Required, LockState: "unknown", State: "missing", Outcome: outcomes[source]}
if locksKnown {
output.LockState = "unlocked"
if isLocked {
@@ -274,7 +275,7 @@ func inspectPublishedOutputs(ctx context.Context, cfg *config.Config, store stor
output.State = "error"
}
if err == nil && current != nil && current.Commit != nil {
if declaration, ok := declarations[rule.Source]; ok {
if declaration, ok := declarations[source]; ok {
identity, identityErr := artifacts.ParsePublishedOutputObjectKey(current.SessionPrefix, declaration.DestinationKey)
if identityErr != nil {
err = identityErr