Repository navigation
Fix warnings emitted by the backend test run - #4855
Merged
Merged
Conversation
- Restore export columns dropped by the django-import-export 4 upgrade: v4 ignores declared fields missing from Meta.fields, so the grant export lost email, age group and submission columns, and the ranking export lost the submission title. - Bump pytest-cov to 7.1.0; 4.x passes --rsyncdir to xdist, which is deprecated. - Use sentry_sdk.new_scope() and Scope.set_user() instead of the deprecated push_scope() and Scope.user setter. - Use pypdf's remove_duplicates/remove_unreferenced kwargs. - Drop WhiteNoise middleware in test settings: collectstatic does not run in CI, so it warns about the missing STATIC_ROOT. - Install libharfbuzz-subset0 in CI, matching the production image, so WeasyPrint stops warning about it. - Bump actions/setup-python to v7.1.0 (Node 24).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Summary: Bundles several unrelated changes: admin URL fields default to Issues
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4855 +/- ##
=======================================
Coverage 92.42% 92.43%
=======================================
Files 360 360
Lines 10935 10938 +3
Branches 949 949
=======================================
+ Hits 10107 10110 +3
Misses 706 706
Partials 122 122 🚀 New features to boost your workflow:
|
Silences Django's RemovedInDjango60Warning about forms.URLField's
assume_scheme by opting into the Django 6 default: a URL entered in the
admin without a scheme ("example.com") is saved as "https://example.com"
instead of "http://example.com".
Admins and inlines with URL fields set formfield_overrides; module-level
ModelForms set Meta.formfield_callback, since ModelAdmin replaces it with
its own when it builds the form. A test builds every registered admin and
inline form and checks that its URL fields assume https, so a new admin
that misses the override fails.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes all the warnings in the backend test job (e.g. run 42327842658). Locally the suite now runs with 0 warnings (708 before).
Changes
GrantResource/RankSubmissionResource:ignoring field ... because not declared in 'fields' whitelistMeta.fields. Since that upgrade, the grant export has been missingage_group,email,has_sent_submission,submission_title,submission_tags,submission_admin_link,submission_pycon_link,grant_admin_link, and the ranking export has been missingsubmission__title. They're back in the whitelists, in the same order v3 produced. Added regression tests.RemovedInDjango60Warning: URLField default scheme will change to httpsformfield_overrides = HTTPS_URL_FORMFIELD_OVERRIDES. Module-level ModelForms setMeta.formfield_callback = formfield_with_https_urls, because ModelAdmin replaces that callback with its own. Behaviour change: a URL typed in the admin without a scheme (example.com) is saved ashttps://example.cominstead ofhttp://example.com. A new test builds every registered admin and inline form and checks that its URL fields assume https, so a future admin that misses the override fails.--rsyncdir ... deprecated--rsyncdirto xdist. Bumped to 7.1.0 (rsync support was removed in 5.0).push_scope is deprecated,Scope.user setter is deprecatedsentry_sdk.new_scope()+scope.set_user()inpretix.create_order.remove_identicals/remove_orphansdeprecatedremove_duplicates/remove_unreferenced.No directory at: .../backend/static/collectstaticnever runs in CI, so test settings now drop the WhiteNoise middleware (same pattern as the debug toolbar). This one made up most of the 708 warnings.HarfBuzz-Subset will be requiredlibharfbuzz-subset0, which the production Dockerfile already installs.Node.js 20 is deprecated(+punycodedeprecation in post-job)actions/setup-pythonv5.6.0 → v7.1.0 (pinned SHA) in all workflows. v7 only removed thepip-installinput, which we don't use.Note on the setup-uv cache annotation
The first CI run of this PR showed
Failed to save: Unable to reserve cache. Backend tests, Backend checks and GraphQL schema all start in parallel with the same setup-uv cache key wheneveruv.lockchanges, so only one of them can save it. A rerun got a cache hit and showed no annotation. It only shows on the first run after a lockfile change, so I didn't change anything for it.Testing
-n 8 --cov: 1370 passed, 0 warnings, coverage 92.17%.formfield_overridesmakes it fail.static/and harfbuzz-subset), so CI confirms those two: the PR run shows neither.