Index applied changes for repair outcomes
This commit is contained in:
@@ -241,6 +241,7 @@ func (r *Runner) Run(ctx context.Context, input RunInput) (RunOutput, error) {
|
||||
unit.State = outcomes.WorkCompleted
|
||||
unit.CorrectionsApplied = appliedBySection[sectionPos]
|
||||
}
|
||||
var appliedIndices map[int]struct{}
|
||||
for i := range workUnits[moduleIndex*len(sections) : (moduleIndex+1)*len(sections)] {
|
||||
unit := &workUnits[moduleIndex*len(sections)+i]
|
||||
for j := range unit.Repairs {
|
||||
@@ -248,13 +249,16 @@ func (r *Runner) Run(ctx context.Context, input RunInput) (RunOutput, error) {
|
||||
if branch.Outcome != "approved" {
|
||||
continue
|
||||
}
|
||||
branch.Outcome = "approved_skipped"
|
||||
for _, change := range applied {
|
||||
if change.ProposalIndex == branch.ProposalIndex {
|
||||
branch.Outcome = "applied"
|
||||
break
|
||||
if appliedIndices == nil {
|
||||
appliedIndices = make(map[int]struct{}, len(applied))
|
||||
for _, change := range applied {
|
||||
appliedIndices[change.ProposalIndex] = struct{}{}
|
||||
}
|
||||
}
|
||||
branch.Outcome = "approved_skipped"
|
||||
if _, ok := appliedIndices[branch.ProposalIndex]; ok {
|
||||
branch.Outcome = "applied"
|
||||
}
|
||||
}
|
||||
}
|
||||
attributeApplyFiltering(sections, pipelineResult.Approved, skipped, policy, workUnits[moduleIndex*len(sections):(moduleIndex+1)*len(sections)])
|
||||
|
||||
Reference in New Issue
Block a user