Skip to content

Remove MitreCVE feed backend (#16519)#17142

Merged
stevejalim merged 1 commit intomainfrom
janriokrause/remove-cve-feed
Apr 28, 2026
Merged

Remove MitreCVE feed backend (#16519)#17142
stevejalim merged 1 commit intomainfrom
janriokrause/remove-cve-feed

Conversation

@janriokrause
Copy link
Copy Markdown
Contributor

@janriokrause janriokrause commented Apr 20, 2026

Summary

Notes

The gone() redirect in redirects.py (#16521) is intentionally kept so the old URL continues to return 410. The security/partials/cve.html template is also kept. It renders CVE entries on advisory detail pages and is unrelated to the feed.

@janriokrause janriokrause self-assigned this Apr 20, 2026
@janriokrause janriokrause requested a review from a team as a code owner April 20, 2026 20:00
@janriokrause janriokrause linked an issue Apr 20, 2026 that may be closed by this pull request
1 task
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.78%. Comparing base (979bbe4) to head (674b6d8).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17142      +/-   ##
==========================================
- Coverage   81.85%   81.78%   -0.08%     
==========================================
  Files         175      175              
  Lines        9410     9376      -34     
==========================================
- Hits         7703     7668      -35     
- Misses       1707     1708       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes the deprecated Mitre CVE feed backend from the security app, completing the decommissioning work started in #16521 / #16542 while keeping the 410 Gone redirect behavior in place via bedrock/security/redirects.py.

Changes:

  • Removed the MitreCVE model and its JSON feed view, along with related imports and management-command logic.
  • Deleted Mitre CVE model tests and removed the stale commented-out URL pattern for cve-feed.json.
  • Added migration 0009_delete_mitrecve to drop the MitreCVE database table.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
bedrock/security/views.py Removes the Mitre CVE JSON feed view and MitreCVE dependency.
bedrock/security/urls.py Removes the leftover commented-out cve-feed.json URL pattern reference.
bedrock/security/tests/test_models.py Deletes MitreCVE model tests and removes the import.
bedrock/security/models.py Deletes the MitreCVE model class.
bedrock/security/migrations/0009_delete_mitrecve.py Drops the MitreCVE table via DeleteModel.
bedrock/security/management/commands/update_security_advisories.py Removes CVE-feed-specific parsing/upsert logic and the MitreCVE clear step.

Comment thread bedrock/security/migrations/0009_delete_mitrecve.py Outdated
@janriokrause
Copy link
Copy Markdown
Contributor Author

Just removed the migration from this commit and created a separate PR #17143.

@stevejalim
Copy link
Copy Markdown
Contributor

Just removed the migration from this commit and created a separate PR #17143.

Looking at the failing test test_no_missing_migrations it seems that Django detects the deleted Model class and expects there to be a complementary migration.

I think we can balance this by keeping the Model definition in this PR (you can remove the custom methods if you want) and focus on dropping the non-models.py code in this PR, then in #17143 delete the Model definition there, along with the migration to drop the table. How does that seem to you @janriokrause ?

@janriokrause janriokrause force-pushed the janriokrause/remove-cve-feed branch from 19df32f to b5dd53b Compare April 21, 2026 14:12
janriokrause added a commit that referenced this pull request Apr 21, 2026
@janriokrause
Copy link
Copy Markdown
Contributor Author

Great. Thanks for the hint. Updated both PRs.

janriokrause added a commit that referenced this pull request Apr 21, 2026
janriokrause added a commit that referenced this pull request Apr 21, 2026
@stevejalim stevejalim force-pushed the janriokrause/remove-cve-feed branch from b5dd53b to cf021b7 Compare April 22, 2026 09:41
Copy link
Copy Markdown
Contributor

@stevejalim stevejalim left a comment

Choose a reason for hiding this comment

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

Might be worth a search for MitreCVE in the codebase in general - I see it's still included in the export-db-to-sqlite.sh script and can come out of there, too - either in this PR or in the one that drops the model - it won't really matter

@janriokrause janriokrause force-pushed the janriokrause/remove-cve-feed branch from cf021b7 to 28decf9 Compare April 24, 2026 17:10
janriokrause added a commit that referenced this pull request Apr 24, 2026
The `cve-feed.json` endpoint was already removed and redirected to
410 Gone in #16542. This removes the remaining Python backend: the
`mitre_cve_feed` view, the `add_or_update_cve` management command
logic, and all associated tests.

A migration to drop the `MitreCVE` model and database table will be
in a separate commit.
@janriokrause janriokrause force-pushed the janriokrause/remove-cve-feed branch from 28decf9 to 674b6d8 Compare April 24, 2026 17:18
janriokrause added a commit that referenced this pull request Apr 24, 2026
@janriokrause
Copy link
Copy Markdown
Contributor Author

Removed MitreCVE from export-db-to-sqlite.sh in the follow-up PR #17143.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment on lines 277 to 281
if clear_db:
printout("Clearing all security advisories.")
SecurityAdvisory.objects.all().delete()
Product.objects.all().delete()
MitreCVE.objects.all().delete()

Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

Consider cleaning up the remaining MitreCVE model/table as part of this decommissioning. After this change, the update_security_advisories --clear-db path no longer deletes MitreCVE rows, and MitreCVE also appears to be otherwise unused (only the model/migrations remain), which can leave stale data in the DB and ongoing schema maintenance overhead. Options: add a migration to remove the model/table, or (if you’re intentionally keeping the table temporarily) keep deleting it here and/or add a short comment explaining why it’s retained.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Model/table will be deleted in a follow-up PR #17143, following the multi-release process of migrations.

@stevejalim stevejalim merged commit fc9c279 into main Apr 28, 2026
9 checks passed
@stevejalim stevejalim deleted the janriokrause/remove-cve-feed branch April 28, 2026 14:03
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.

Remove cve-feed.json

3 participants