Publish products without execution ledgers
This commit is contained in:
@@ -16,9 +16,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
InputKindManifest = "previous_manifest"
|
||||
InputKindArtifact = "previous_artifact"
|
||||
InputSource = "previous_session_publish.current"
|
||||
)
|
||||
|
||||
type Plan struct {
|
||||
@@ -38,7 +36,6 @@ type Record struct {
|
||||
Size int64
|
||||
Generation string
|
||||
S3Bucket string
|
||||
VerifiedContent []byte
|
||||
}
|
||||
|
||||
// Resolve evaluates previous-session requirements against the one selected
|
||||
@@ -99,7 +96,7 @@ func Resolve(
|
||||
)
|
||||
|
||||
result := &Plan{}
|
||||
current, err := artifacts.LoadCurrentState(ctx, store, previousSessionPrefix, artifacts.CurrentStateValidation{
|
||||
current, err := artifacts.LoadCurrentInventory(ctx, store, previousSessionPrefix, artifacts.CurrentStateValidation{
|
||||
ExpectedSessionID: previousSessionID,
|
||||
ExpectedCampaign: campaign,
|
||||
ValidateRunID: true,
|
||||
@@ -116,32 +113,10 @@ func Resolve(
|
||||
return nil, fmt.Errorf("load previous-session current state: %w", err)
|
||||
}
|
||||
result.PreviousRunID = strings.TrimSpace(current.RunID)
|
||||
currentManifestKey := current.CurrentManifestKey
|
||||
if current.Commit == nil {
|
||||
return nil, fmt.Errorf("previous-session current state does not include a committed remote declaration")
|
||||
}
|
||||
|
||||
manifestRel, err := relativeToSession(paths, paths.PreviousManifestPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
manifestRecord := Record{
|
||||
Kind: InputKindManifest,
|
||||
LocalRelativePath: manifestRel,
|
||||
LocalPath: paths.PreviousManifestPath,
|
||||
RemoteKey: currentManifestKey,
|
||||
S3Bucket: bucket,
|
||||
}
|
||||
committedManifest, ok := current.Commit.Artifact(artifacts.RemoteArtifactTypeSessionManifest)
|
||||
if !ok || committedManifest.DestinationKey != currentManifestKey {
|
||||
return nil, fmt.Errorf("previous-session remote commit does not declare its session manifest")
|
||||
}
|
||||
manifestRecord.SHA256 = committedManifest.SHA256
|
||||
manifestRecord.Size = committedManifest.Size
|
||||
manifestRecord.Generation = committedManifest.Generation
|
||||
manifestRecord.VerifiedContent = append([]byte(nil), current.ManifestData...)
|
||||
result.Records = append(result.Records, manifestRecord)
|
||||
|
||||
for _, requirement := range orderedRequirements {
|
||||
sourceID := previousArtifactSourceID(requirement.Name)
|
||||
selectedArtifact, ok := committedPublishedArtifactBySource(current.Commit, sourceID)
|
||||
|
||||
Reference in New Issue
Block a user