Reset CVE v5 rank state before each import#27
Merged
Conversation
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.
Motivation
rank:cpe/ vendor-product ranking produced from CVE v5 NDJSON does not accumulate across repeated imports and starts from a clean state each run.Description
reset_rank_state(rdb, missing_word_key)helper inlib/cpeimport/cvelistv5.pyand export it vialib/cpeimport/__init__.pyto deleterank:cpe,rank:vendor_product, and the configured missing-word set.bin/import_cvelistv5.pyto callreset_rank_state()by default before importing and add a--preserve-rankflag to keep previous behavior when requested.test_reset_rank_state_clears_previous_import_datatotests/test_cvelistv5.pyto verify the reset clears only the CVE v5 ranking state and does not remove unrelatedw:<word>data.README.mdto document the new default behavior and the--preserve-rankopt-out.Testing
python -m unittest tests.test_cvelistv5and the test suite passed (all tests OK).python -m unittest tests.test_nvd_jsonand the test suite passed (all tests OK).Codex Task