Skip to content

Commit

Permalink
ignore query score for controls (#1493)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaym authored Nov 21, 2024
1 parent 842a7c0 commit f139271
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion policy/resolved_policy_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ func (b *resolvedPolicyBuilder) addControl(control *ControlMap) bool {
}
qNode, ok := n.(*rpBuilderGenericQueryNode)
if ok {
b.addEdge(qNode.selectedCodeId, control.Mrn, nil)
b.addEdge(qNode.selectedCodeId, control.Mrn, &explorer.Impact{Scoring: explorer.ScoringSystem_IGNORE_SCORE})
hasChild = true
}
}
Expand Down
4 changes: 2 additions & 2 deletions policy/resolver_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,11 +903,11 @@ framework_maps:
rpTester.ReportingJobByMrn(queryMrn("check-pass-2")).Notifies(policyMrn("policy1"))

rpTester.CodeIdReportingJobForMrn(queryMrn("active-query")).Notifies(queryMrn("active-query"))
rpTester.CodeIdReportingJobForMrn(queryMrn("active-query")).Notifies(controlMrn("control1"))
rpTester.CodeIdReportingJobForMrn(queryMrn("active-query")).Notifies(controlMrn("control1")).WithImpact(&explorer.Impact{Scoring: explorer.ScoringSystem_IGNORE_SCORE})
rpTester.ReportingJobByMrn(queryMrn("active-query")).Notifies(policyMrn("policy1"))

rpTester.CodeIdReportingJobForMrn(queryMrn("active-query-2")).Notifies(queryMrn("active-query-2"))
rpTester.CodeIdReportingJobForMrn(queryMrn("active-query-2")).Notifies(controlMrn("control1"))
rpTester.CodeIdReportingJobForMrn(queryMrn("active-query-2")).Notifies(controlMrn("control1")).WithImpact(&explorer.Impact{Scoring: explorer.ScoringSystem_IGNORE_SCORE})
rpTester.ReportingJobByMrn(queryMrn("active-query-2")).Notifies(policyMrn("policy1"))

rpTester.ReportingJobByMrn(queryMrn("check-overlap")).Notifies(policyMrn("policy1"))
Expand Down

0 comments on commit f139271

Please sign in to comment.