Validate published output declarations

This commit is contained in:
2026-09-05 14:14:33 +00:00
parent 470450e509
commit 4048996652
14 changed files with 107 additions and 50 deletions

View File

@@ -210,15 +210,11 @@ func committedPublishedArtifactBySource(commit *artifacts.RemoteCommitManifest,
}
func publishedOutputRelativePath(sessionPrefix, destinationKey string) (string, error) {
identity, err := artifacts.ParseImmutableRunObjectKey(sessionPrefix, destinationKey)
identity, err := artifacts.ParsePublishedOutputObjectKey(sessionPrefix, destinationKey)
if err != nil {
return "", err
}
rel, ok := strings.CutPrefix(identity.RelativePath, "published/")
if !ok || strings.TrimSpace(rel) == "" {
return "", fmt.Errorf("destination %q is outside its immutable run published-output prefix", destinationKey)
}
normalized, err := pathsafe.NormalizeRelativeDestination(rel)
normalized, err := pathsafe.NormalizeRelativeDestination(identity.Destination)
if err != nil {
return "", fmt.Errorf("published output destination %q: %w", destinationKey, err)
}