Skip to content

Conversation

@stevejalim
Copy link
Contributor

@stevejalim stevejalim commented Dec 19, 2025

One-line summary

Now that the VPN Resource Center content has been migrated to Wagtail, we can finally remove the code that rendered those pages based on data synced into the DB from Contentful (which we stopped syncing ages ago)

Significant changes and points to review

Best to review this commit by commit - it was performed by Claude Code, using a plan I generated with its support and which I reviewed beforehand. There were a few gaps which led to mop-up commits at the end. This PR will remain Draft until I've re-reviewed the commits myself

Issue / Bugzilla link

Resolves #15843

Testing

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.08%. Comparing base (0be5625) to head (69a2a07).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
bedrock/products/views.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16960      +/-   ##
==========================================
+ Coverage   80.56%   81.08%   +0.52%     
==========================================
  Files         164      157       -7     
  Lines        9203     8313     -890     
==========================================
- Hits         7414     6741     -673     
+ Misses       1789     1572     -217     

☔ 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.

@janbrasna
Copy link
Collaborator

Well a good review would be comparing the changeset to #15845 how the copilot compares to the original engineer;]

(There's e.g. an extra redirect test thrown in for good measure.)

@stevejalim
Copy link
Contributor Author

Haha @janbrasna I'd forgotten I had made that PR!

stevejalim and others added 15 commits January 8, 2026 15:54
- Replace Contentful-based active_locale_available() with Wagtail query
- Remove resource center view functions and URL patterns
- Remove Contentful imports and unused helper functions
- Keep vpn_resource_center_redirect() for backward compatibility
- Fix circular import by moving model import inside function

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove ContentfulPage import
- Delete FirefoxContentful view class
- Remove Contentful URL pattern
- Remove unused settings import

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove ContentfulPage import
- Delete ContentfulPreviewView class
- Delete dev_urls.py file (only contained Contentful preview URL)
- Remove dev_urls import and usage from mozorg/urls.py
- Remove unused imports (method_decorator, never_cache, settings)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove ContentfulEntry import
- Delete get_contentful_sync_info() function
- Remove contentful_info from cron-health-check context
- Remove unused tz_now import

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove Contentful imports
- Delete _get_vrc_urls() and get_contentful_urls() functions
- Remove get_contentful_urls() call from get_all_urls()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Delete all contentful/tests/ files
- Delete mozorg/tests/contentful_test_urlconf.py
- Remove Contentful imports and tests from base/tests/test_views.py
- Remove Contentful test classes from products/tests/test_views.py
- Remove Contentful tests and mocking from sitemaps/tests/test_utils.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove bedrock.contentful.constants import
- Remove bedrock.contentful from INSTALLED_APPS
- Delete all CONTENTFUL_* settings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove contentful==2.5.0 from requirements/prod.in
- Regenerate requirements/prod.txt

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Remove entire bedrock/contentful/ directory including:
- models, views, API code, utilities
- management commands
- migrations (database tables will remain for later cleanup)
- templates and templatetags
- all other files and subdirectories

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove contentful.ContentfulEntry from export-db-to-sqlite.sh
- Remove Contentful data import/export section from fill-empty-postgres-database.sh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Delete contentful-all.html templates from mozorg and firefox
- Remove Contentful sync info from cron-health-check.html
- Delete test_contentful_preview_view test from mozorg/tests
- Remove unused imports (Mock, pytest) from mozorg/tests/test_views.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove 15 Contentful-related bundle definitions from static-bundles.json
- Delete all CSS files in media/css/contentful/ directory
- Remove bundle definitions: mozilla-c-article, mozilla-c-call-out, mozilla-c-picto,
  mozilla-c-section-heading, mozilla-c-split, mozilla-c-card, mozilla-t-multi-column,
  firefox-c-article, firefox-c-call-out, firefox-c-picto, firefox-c-section-heading,
  firefox-c-split, c-logo, firefox-c-card, firefox-t-multi-column

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Add URL patterns for VPN Resource Center pages that are now CMS-only:
- products.vpn.resource-center.landing
- products.vpn.resource-center.article

These were previously in products/urls.py with prefer_cms() decorator
but removed when Contentful views were deleted. Adding them here allows
reverse URL lookups to work while pages are served by the CMS.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove contentful per-file-ignores from pyproject.toml
- Remove contentful module from example_sentry_payload.json
- Remove contentful_migrations ignore pattern from eslint.config.js

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@stevejalim stevejalim force-pushed the 15843--remove-contentful-code branch from 6f71ed2 to 69a2a07 Compare January 8, 2026 16:00
@stevejalim stevejalim marked this pull request as ready for review January 8, 2026 16:00
@stevejalim stevejalim requested review from a team as code owners January 8, 2026 16:00
@stevejalim
Copy link
Contributor Author

Well a good review would be comparing the changeset to #15845 how the copilot compares to the original engineer;]

(There's e.g. an extra redirect test thrown in for good measure.)

I've compared this PR to that PR and they both cover the same ground. There were some redirects added in the older PR (which I've now closed) so I decided to bring them over to this one.

Ready for review @stephaniehobson or @maureenlholland

@stephaniehobson
Copy link
Contributor

stephaniehobson commented Jan 9, 2026

Well Claude is very impressed with the work you two did together:

This commit cleanly removes the Contentful integration (~6,700 lines deleted) with proper care taken to:

  • Maintain URL redirects for SEO continuity
  • Transition VPN Resource Center to Wagtail CMS
  • Remove all dependencies and configuration
  • Clean up tests comprehensively

The only consideration is whether you want to add a database cleanup step for the orphaned contentful_contentfulentry table and django_migrations records. This isn't blocking - the code will work fine without it.

I squashed the commits into one mega commit and deleted the associated commit messages so that it would not have any prose to mislead it. I also pointed it at the Contentful docs in platform-docs before it got started and fed it a bit of my own context.

@stephaniehobson
Copy link
Contributor

stephaniehobson commented Jan 9, 2026

@stevejalim Can I push this to run-integration-tests without breaking that branch?

Edit: I guess if I break it we know we have a problem. So I'll push it.

Copy link
Contributor

@stephaniehobson stephaniehobson left a comment

Choose a reason for hiding this comment

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

✅ Local manual checking
✅ Code review of individual commits

Waiting on test run to give final R+

Copy link
Contributor

@stephaniehobson stephaniehobson left a comment

Choose a reason for hiding this comment

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

Integration check passed ✅

R+ 😇

@stevejalim stevejalim merged commit 790bc31 into main Jan 12, 2026
13 checks passed
@stevejalim stevejalim deleted the 15843--remove-contentful-code branch January 12, 2026 10:58
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 Contentful app, templates and related CSS bundles

4 participants