Skip to content

Upgrade Wagtail from 7.3.4 to 8.1 - #17498

Open
stevejalim wants to merge 2 commits into
mainfrom
wagtail-8.1
Open

stevejalim wants to merge 2 commits into
mainfrom
wagtail-8.1

Conversation

@stevejalim

@stevejalim stevejalim commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Port of mozmeao/springfield#2045 to bedrock. This moves us from 7.3 to 8.1, so we pick up the 7.4 and 8.0 releases too.

Codebase changes needed beyond the dep bump:

  • The Smartling visual-context callback strips the page's own site root URL rather than the default site's. Under Wagtail 8 the existing test for this started failing, and using the page's site is the right thing anyway. A new test covers a page on a non-default site.
  • The Wagtail docs links in AGENTS.md point at 8.1.
  • The WAGTAIL_ENABLE_UPDATE_CHECK comment no longer claims we track LTS releases.

Springfield's other changes (inline imports to break an import cycle, PAGE_PERMISSION_CODENAMES, the image-tag permission policy) don't apply here: bedrock has none of that code, and Django boots cleanly without the import-cycle workaround.

Adds three Wagtail migrations (wagtailadmin.0006_formstate, wagtailcore.0098_apitoken, wagtailsearch.0010_add_text_fields). No migrations of our own. New transitive deps: django-ninja, pydantic, swapper.

Note: to get Wagtail 8.1 rather than 8.0, we had to override the 7-day cooldown. We'll need to remove the wagtail = false cooldown exemption in pyproject.toml on or after 2026-11-10.

Upgrade considerations I checked against bedrock:

  • 8.0: AVIF and WebP uploads are no longer converted to PNG renditions by default. We allow WebP uploads, so WebP images will now get WebP renditions unless a format-* filter is used. That seems like an improvement rather than a problem, but flagging it.
  • 8.1: sitemaps include pages from all locales. We don't use wagtail.contrib.sitemaps.
  • 7.4: StreamField CSS class prefix change. We have no admin CSS targeting those classes.

Testing

Full Python suite run locally with Wagtail 8.1 and again on main with 7.3.4: the same nine tests fail in both runs, all from local env vars and test-ordering, so no regressions.

  • Manual QA before merge: the admin customisations
    • Draftail plugins (wagtail_hooks.py)
    • locale badges on the locales list
    • environment-specific admin CSS
    • SVG upload sanitising
  • Check Smartling workflow still OK

🤖 Generated with Claude Code

Port of mozmeao/springfield#2045.

Codebase changes needed beyond the dep bump:

* The Smartling visual-context callback strips the page's own site root
  URL rather than the default site's, with a test covering a page on a
  non-default site.
* The Wagtail docs links in AGENTS.md point at 8.1.
* The WAGTAIL_ENABLE_UPDATE_CHECK comment no longer claims we track LTS.

Adds Wagtail's own migrations (form state, API token, search text
fields). No migrations of our own.

Wagtail 8.1 was uploaded on 2026-11-02, inside the 7-day cooldown, so
pyproject.toml exempts it. Remove `wagtail = false` on or after
2026-11-10.
@stevejalim
stevejalim requested a review from a team as a code owner November 6, 2026 09:59
@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.63%. Comparing base (c296b0a) to head (683a9fd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17498   +/-   ##
=======================================
  Coverage   85.63%   85.63%           
=======================================
  Files         172      172           
  Lines        8729     8729           
=======================================
  Hits         7475     7475           
  Misses       1254     1254           

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

An active blocking security finding remains because the expired certifi cooldown exemption still permits selecting releases newer than the repository’s seven-day supply-chain cooldown.

1 open issue
What changed in this PR

Upgrades Bedrock from Wagtail 7.3.4 to 8.1 and updates Smartling visual-context handling for pages hosted on non-default sites.

Changes:

  • Updates Wagtail and its transitive dependencies, migrations, and lockfile entries.
  • Uses the page’s associated site when stripping URLs from Smartling visual context, with regression coverage.
  • Updates Wagtail documentation links and the update-check configuration comment.
  • Follow-up is required for the expired certifi cooldown exemption and unsupported wagtail-localize-dashboard version.

This pull request requires changes.

File Description
uv.lock Locks Wagtail 8.1 and its new transitive dependencies.
pyproject.toml Updates the Wagtail dependency and package cooldown exemptions.
bedrock/​settings/​base.py Clarifies why Wagtail update notifications remain disabled.
bedrock/​cms/​wagtail_localize_smartling/​callbacks.py Strips URLs using the page’s associated site.
bedrock/​cms/​tests/​test_callbacks.py Adds regression coverage for a non-default site.
AGENTS.md Updates Wagtail documentation links to version 8.1.

Review effort: Lite

Comment thread pyproject.toml Resolved
@stephaniehobson stephaniehobson self-assigned this Nov 9, 2026
@stevejalim

Copy link
Copy Markdown
Contributor Author

@copilot remove the expired certifi exemption and handle the merge conflicts, please

# Conflicts:
#	uv.lock

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

@copilot remove the expired certifi exemption and handle the merge conflicts, please

Removed the expired certifi exemption, regenerated uv.lock, and merged main, resolving the lockfile conflict. Commit: ca57033d.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The expired Wagtail cooldown exemption remains in pyproject.toml, allowing subsequent upgrades to bypass the seven-day supply-chain safeguard.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread pyproject.toml
exclude-newer-package = { certifi = false }
# Temporary: Wagtail 8.1 was uploaded on 2026-11-02, so skip the cooldown for it. Remove
# `wagtail = false` on or after 2026-11-10 and run `uv lock`, then check Wagtail is still 8.1.
exclude-newer-package = { wagtail = false }
@stevejalim

Copy link
Copy Markdown
Contributor Author

https://gh.io/copilot-coding-agent-docs remove the expired wagtail 8.1 exemption and re-review

This branch has not been deployed

No deployments
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.

4 participants