-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalize rescoring rule model #237
base: master
Are you sure you want to change the base?
Conversation
9c09576
to
b21a41c
Compare
b21a41c
to
67e2267
Compare
67e2267
to
d880735
Compare
d880735
to
3894c0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you elaborate on the highlevel organisation of rulesets you suggest?
before this change, there was a global (cve-)rulesets
, which was a list of (cve-)rescoring-rules.
or. yaml-ishly speaking:
rulesets: # each entry implicitly being a set of cve-rescoring-rulesets
- name: my-rescoring-rules
rules: # list of rules
In that example, the topmost attribute (rulesets) might be described /w a typehint list[CVE_RescoringRuleset, ...]
whereas each CVE_RescoringRuleset would have a list (stored in rules
) of CVE_RescoringRule
--
After the ongoing generalisation, I think we should have something like:
rulesets:
- name: my-cve-ruleset
type: cve-rescoring
rules: # cve-rescoring-rules
- name: my-sast-ruleset
type: sast-rescoring
rules: # sast-rescoring-rules
Thus, it will make sense to have a (generic, ideally w/ type-params) base-class for rulesets, and rulesettype-specific rules, like so (pseudo-pseudo-code - I might have gotten type-parameters wrong syntactically):
class Rule:
name: str # probably, each rule should have a name
class RuleSet[T: Rule]:
rules: list[T]
class CveRescoringRule(Rule):
pass #...
class SastRescoringRule(Rule):
pass # ...
class CveRescoringRuleset(Ruleset[CveRescoringRule]):
pass
3894c0f
to
4b277d4
Compare
4b277d4
to
772ed5b
Compare
772ed5b
to
886df9e
Compare
886df9e
to
05fa61d
Compare
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: