Enhance advisory grouping 2172#2228
Open
shivamshrma09 wants to merge 1 commit intoaboutcode-org:mainfrom
Open
Conversation
b3a2b09 to
cfdec1c
Compare
…advisory grouping Signed-off-by: shivamshrma09 <shivamsharma27107@gmail.com>
cfdec1c to
0fe9ffa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2172
This PR enhances the advisory grouping mechanism by adding two new
heuristics to the existing
ComputeToDopipeline incompute_advisory_todo.py.Changes
New issue types in
ISSUE_TYPE_CHOICES(models.py)POTENTIALLY_RELATED_BY_ALIASES— for advisories from differentdatasources that share the same alias
SIMILAR_SUMMARIES— for advisories with near-identical summariesNew pipeline steps (
compute_advisory_todo.py)relate_advisories_by_aliases()AdvisoryAliasobjectscreates a
POTENTIALLY_RELATED_BY_ALIASEStodoissue_detaildetect_similar_summaries()difflib.SequenceMatcher0.8, creates aSIMILAR_SUMMARIEStodosimilarity_score,datasource_a,datasource_binissue_detailMigration (
0117_add_alias_and_summary_issue_types.py)issue_typefield choices on bothAdvisoryToDoandAdvisoryToDoV2Tests (
test_compute_advisory_todo_v2.py) — 5 new teststest_relate_advisories_by_aliases_creates_todotest_relate_advisories_by_aliases_same_datasource_not_flaggedtest_detect_similar_summaries_creates_todotest_detect_similar_summaries_below_threshold_not_flaggedtest_detect_similar_summaries_empty_summary_skippedApproach
Both new steps follow the exact same pattern as the existing
detect_conflicting_advisories()step — usingLoopProgress,bulk_create_with_m2m(), andadvisories_checksum()from theexisting codebase.
The
SUMMARY_SIMILARITY_THRESHOLD = 0.8constant is defined at thetop of the file for easy adjustment.