Add trim report output
This commit is contained in:
@@ -23,9 +23,10 @@ type Artifact struct {
|
||||
|
||||
// ApplyArtifactResult contains trimmed artifact output and ID mapping metadata.
|
||||
type ApplyArtifactResult struct {
|
||||
Artifact Artifact
|
||||
OldToNewID map[int]int
|
||||
RemovedIDs []int
|
||||
Artifact Artifact
|
||||
OldToNewID map[int]int
|
||||
RemovedIDs []int
|
||||
OverlapGroupsRecomputed bool
|
||||
}
|
||||
|
||||
// ParseArtifactJSON parses and validates a serialized seriatim output artifact.
|
||||
@@ -195,8 +196,9 @@ func ApplyArtifact(input Artifact, opts Options) (ApplyArtifactResult, error) {
|
||||
Schema: SchemaFull,
|
||||
Full: &out,
|
||||
},
|
||||
OldToNewID: result.OldToNewID,
|
||||
RemovedIDs: result.RemovedIDs,
|
||||
OldToNewID: result.OldToNewID,
|
||||
RemovedIDs: result.RemovedIDs,
|
||||
OverlapGroupsRecomputed: true,
|
||||
}, nil
|
||||
case SchemaIntermediate:
|
||||
if input.Intermediate == nil {
|
||||
@@ -212,8 +214,9 @@ func ApplyArtifact(input Artifact, opts Options) (ApplyArtifactResult, error) {
|
||||
Schema: SchemaIntermediate,
|
||||
Intermediate: &out,
|
||||
},
|
||||
OldToNewID: result.OldToNewID,
|
||||
RemovedIDs: result.RemovedIDs,
|
||||
OldToNewID: result.OldToNewID,
|
||||
RemovedIDs: result.RemovedIDs,
|
||||
OverlapGroupsRecomputed: false,
|
||||
}, nil
|
||||
case SchemaMinimal:
|
||||
if input.Minimal == nil {
|
||||
@@ -229,8 +232,9 @@ func ApplyArtifact(input Artifact, opts Options) (ApplyArtifactResult, error) {
|
||||
Schema: SchemaMinimal,
|
||||
Minimal: &out,
|
||||
},
|
||||
OldToNewID: result.OldToNewID,
|
||||
RemovedIDs: result.RemovedIDs,
|
||||
OldToNewID: result.OldToNewID,
|
||||
RemovedIDs: result.RemovedIDs,
|
||||
OverlapGroupsRecomputed: false,
|
||||
}, nil
|
||||
default:
|
||||
return ApplyArtifactResult{}, fmt.Errorf("unsupported artifact schema %q", input.Schema)
|
||||
|
||||
Reference in New Issue
Block a user