Skip to content

Duplicate scanner results for rollbacked versions#24962

Merged
eviljeff merged 2 commits into
mozilla:masterfrom
eviljeff:16152-dupliciate-scanner-results-for-rollback
May 29, 2026
Merged

Duplicate scanner results for rollbacked versions#24962
eviljeff merged 2 commits into
mozilla:masterfrom
eviljeff:16152-dupliciate-scanner-results-for-rollback

Conversation

@eviljeff
Copy link
Copy Markdown
Member

@eviljeff eviljeff commented May 27, 2026

Fixes mozilla/addons#16152

Description

Duplicates scanner results linked to a version when we're rolling it back

Context

I tried to make AbstractScannerResult.duplicate as generic as possible, not knowing what future fields could be added to the models. (I started writing a more generic function that would accept any arbitrary fields as overrides - not just version - but it ended up getting complicated due to foreign keys and it really wasn't worth it given our current use case)

Testing

  • Have a version with one or more scanner results
  • have 1 newer approved version you can rollback over
  • rollback to the version with the scanner results
  • see the scanner results are shown in reviewer tools for the newly rolled back version

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@eviljeff eviljeff marked this pull request as ready for review May 27, 2026 17:22
@eviljeff eviljeff requested a review from diox May 27, 2026 17:31
Copy link
Copy Markdown
Member

@diox diox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately doesn't copy over matched_rules for the results, which is a problem.

Comment thread src/olympia/versions/tasks.py Outdated
Comment thread src/olympia/versions/tests/test_tasks.py Outdated
Comment thread src/olympia/scanners/models.py
@eviljeff eviljeff requested a review from diox May 29, 2026 14:05
@eviljeff eviljeff merged commit 8459627 into mozilla:master May 29, 2026
87 of 88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: scanner results don't show up on rollback versions

2 participants