Attribute filtered revisions to their repair attempts
This commit is contained in:
@@ -28,6 +28,7 @@ type RepairAttempt struct {
|
||||
Succeeded bool
|
||||
Approved bool
|
||||
Operations []outcomes.Operation
|
||||
Filtered []outcomes.FilteredProposal
|
||||
}
|
||||
|
||||
// RepairOutcome keeps the proposal identity through revision and application.
|
||||
@@ -180,6 +181,11 @@ func repairCandidates(ctx context.Context, input validateSectionCandidatesInput,
|
||||
record.Revision = &revisionSnapshot
|
||||
record.Decisions = validated.decisions
|
||||
record.Rejected = validated.rejected
|
||||
if len(validated.filtered) > 0 {
|
||||
// A repair response contains one proposal. Attribute its first
|
||||
// defect once, as for proposals in the original response.
|
||||
record.Filtered = validated.filtered[:1]
|
||||
}
|
||||
for i := range validated.operations {
|
||||
proposalIndex, attemptNumber := original.ProposalIndex, attempt+1
|
||||
validated.operations[i].Reference.ProposalIndex = &proposalIndex
|
||||
@@ -239,6 +245,10 @@ func repairOperations(input validateSectionCandidatesInput, branches []RepairOut
|
||||
operation := outcomes.Operation{Reference: outcomes.Reference{StageIndex: &input.Spec.Index, StageID: input.Spec.ID, ModuleKey: input.Spec.ModuleKey, ModuleInstance: input.Spec.InstanceName, SectionIndex: section, Kind: outcomes.OperationCorrectionRepair, ProposalIndex: &index, RepairAttempt: &number}, Counts: attempt.Counts, Succeeded: attempt.Succeeded, FailureReason: attempt.FailureReason, ProposalIndices: []int{index}}
|
||||
if attempt.Succeeded {
|
||||
operation.RecoveryReasons = outcomes.ExecutionRecoveries(attempt.Counts)
|
||||
if len(attempt.Filtered) > 0 {
|
||||
operation.Filtered = attempt.Filtered
|
||||
operation.RecoveryReasons = append(operation.RecoveryReasons, outcomes.RecoveryProposalsFiltered)
|
||||
}
|
||||
if attempt.Approved {
|
||||
operation.RecoveryReasons = append(operation.RecoveryReasons, outcomes.RecoveryCorrectionRevised)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user