Remove stale internal-analyzer findings when affected components are cleared - #7031
heyiamwahab236 wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 595 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
fc9fe41 to
93662de
Compare
|
Note on the failing test job: both failures are unrelated, environment-sensitive tests in the existing suite, not caused by this change. First run: GitHubAdvisoryMirrorTaskTest.shouldUseLimitResetHeaderForRetryDelay failed on a timing assertion (retry delay off by 2s) - tracked in #4921. Second run: GitHubMetaAnalyzerTest.testAnalyzerInvalidTag[4] hit its 5-second TimeoutException on the runner. Both classes pass consistently against this branch locally, and the same suite passed on #7104, which is based on the same 4.14.x HEAD. Happy to re-trigger, or a maintainer re-run of the failed job would be appreciated. |
…cleared Updating an INTERNAL vulnerability synchronizes its VulnerableSoftware records, but findings previously created by the internal analyzer were never removed. Since the internal analyzer only ever adds findings, clearing all affected components from a vulnerability left the matched components carrying the finding indefinitely. The update endpoint now removes INTERNAL_ANALYZER finding attributions and component links when the affected components list is emptied, and dispatches metrics updates for the affected components. Signed-off-by: Abdul wahab Shah <214828401+heyiamwahab236@users.noreply.github.com>
93662de to
7193c0b
Compare
Description
Fixes stale findings left behind by the internal analyzer. Updating an INTERNAL
vulnerability synchronizes its VulnerableSoftware records, but findings previously
created by the internal analyzer were never removed. Since the internal analyzer only
ever adds findings, clearing all affected components from a vulnerability left the
matched components carrying the finding indefinitely.
The update endpoint now removes INTERNAL_ANALYZER finding attributions and component
links when the affected-components list is emptied, and dispatches metrics updates
for the affected components.
Addressed Issue
fixes #7029
Additional Details
removeStaleInternalFindingsinVulnerabilityQueryManager, invoked from theupdate path inside the existing transaction when the synchronized VulnerableSoftware
list is empty.
the update) and passes with it.
whichever merges second needs a trivial rebase.
Checklist
This PR implements an enhancement, and I have provided tests to verify that it works as intendedThis PR introduces changes to the database model, and I have updated the migration changelog accordinglyThis PR introduces new or alters existing behavior, and I have updated the documentation accordinglyThis PR is a substantial change (per the ADR criteria), and I have added an ADR underdocs/adr/