Граф коммитов

13866 Коммитов

Автор SHA1 Сообщение Дата
Rob Hudson ab2fc8408c
Add dependabot config for Python and Docker (#11158)
* Add dependabot config for Python and Docker

* Fix FF100 tests
2022-01-25 07:23:40 -08:00
Rob Hudson 3c7d3f0440
Fixups for dependency updates (#11155)
Downgrades APScheduler due to a tzlocal version conflict.
Upgrades PyJWT as a dependency of the previously upgraded PyGithub.
2022-01-21 10:49:45 -08:00
Rob Hudson 02925d5d01
Downgrade eslint for pre-commit to match. (#11153) 2022-01-21 09:24:39 -08:00
Rob Hudson 51558385d4
Update dependencies with minor updates (#11151) 2022-01-21 09:11:53 -08:00
Ayush Anand 354f56b731
Fixed 'Remote' job filtering (#11125) 2022-01-21 15:17:33 +00:00
Rob Hudson 36f2e917f9
Remove unused dependencies (#11150) 2022-01-20 13:46:07 -08:00
Rob Hudson 74d40595e2
Bump dev tools (#11147)
* Bump dev tooling dependencies

* Bump versions in pre-commit

* Fixups after pre-commit updates
2022-01-20 11:48:26 -08:00
maureenlholland afa380a6a4
Add tests to pocket mobile navigation (fixes #11029) (#11110) 2022-01-20 15:58:15 +00:00
Steve Jalim bf6dd48335
Downgrade pytest-selenium and selenium to avoid regression in integration tests (#11145) 2022-01-20 11:01:20 +00:00
Rob Hudson ebf1c2d9d1
Update various django projects and dependencies (#11141) 2022-01-19 15:40:14 -08:00
Rob Hudson 6ce73dfac5
Update pytest and dependencies (#11140) 2022-01-19 12:48:34 -08:00
Rob Hudson 9c3ddb5d3b
No-op mozorg migrations and remove unused picklefield dependency (#11131)
* No-op mozorg migrations and remove unused picklefield dependency

* Squash migrations
2022-01-19 10:38:07 -08:00
Rob Hudson e4288e08a8
Fixes #11138: Bump Sphinx and dependencies (#11139)
* Bump Sphinx and dependencies

* Downgrade docutils to satisfy Sphinx

https://github.com/sphinx-doc/sphinx/blob/4.4.x/setup.py#L25

* Add zipp to docs requirements
2022-01-19 10:07:28 -08:00
Steve Jalim 6a08c876f6 11106: Disable logging of DisallowedHost to reduce log noise 2022-01-18 15:42:15 -05:00
Rob Hudson fb5ae832b4
Update boto3 and dependencies (#11137) 2022-01-18 11:03:31 -08:00
Alex Gibson 2f04108fec
Remove unused cookie helper 404 script (#11123) (#11124) 2022-01-18 08:53:14 -08:00
Craig Cook 170d477e82
Leaderhip updates; remove DCamp [fix #11133] (#11136) 2022-01-18 08:52:07 -08:00
Steve Jalim 54df117e5f
9575: Expand backend FF100 coverage (#11127)
* 9575: Expand test coverage for some of firefox_details to check both three and two-digit major version numbers

* 9575: Minor test expansion for three-digit FF

* 9575: More small FF100 test expansions - iOS and Android

* 9575: More small FF100 test expansions - releasenotes models

* 9575: More small FF100 test expansions - releasenotes listing/index view
2022-01-17 14:36:15 +00:00
Alex Gibson 61bbeeeb49 Remove legacy FxA sync flows (Fixes #9144) 2022-01-17 09:28:23 +00:00
Rob Hudson 009b46919c Remove caldata symlink 2022-01-14 18:18:36 -05:00
Rob Hudson bf501f3ab3
Fix #11126: Remove remaining Thunderbird calendar files (#11130) 2022-01-14 14:41:28 -08:00
Rob Hudson e2f69a035a
Remove unused dependencies (#11128) 2022-01-14 13:51:00 -08:00
Rob Hudson 879c0110ca Remove unused log_settings file and nuggets dependency 2022-01-14 11:33:23 -05:00
maureenlholland 385f249d16 Update jasmine docs link 2022-01-14 16:05:15 +00:00
Alex Gibson 4deaca396d Add JS tests for /careers job filtering (Fixes #11080) 2022-01-13 19:43:46 +00:00
Steve Jalim 9b29dd8d1e
Drop django-filter from project - no longer required (#11116)
No point upgrading a redundant dependency.

It's not imported here and looks like it was related to a vendored version of DRF
2022-01-13 17:44:13 +00:00
Rob Hudson 1f2353e33d
Add pipdeptree to dev requirements (#11115) 2022-01-13 08:22:59 -08:00
dependabot[bot] f913bdd6af
Bump pillow from 8.3.2 to 9.0.0 in /requirements (#11113)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 8.3.2 to 9.0.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/8.3.2...9.0.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-13 15:37:11 +00:00
Rob Hudson 0b19d5173f Refactor `get_accept_languages` to remove extra work 2022-01-12 13:38:12 -05:00
Rob Hudson e8eb7f3379 Fix #10859: Make l10n template lang redirect match urlresolvers 2022-01-12 13:38:12 -05:00
Rob Hudson 8586533ccd Update `bin/` scripts to explicitly use Python 3 2022-01-11 11:44:26 -05:00
fkiriakos07 dc81a3a6ad
Add SSRF to the list of payouts for web bug bounty (#11043)
* add SSRF to the list of payouts for web bug bounty
* no payout for other sites
* exclude blind SSRF reports
2022-01-11 10:51:22 -05:00
Rob Hudson 2177e4d2dc
Fix #11057: Update codebase to prefer python3 syntax (#11086)
* Update `super()` calls

* Update for use f-strings

* Remove utf-8 comments

* Import from built-in `unittest.mock`

* Use native dict and set syntax

* Update exception errors

* Remove six compatibility code

* Remove explicit utf-8 encoding

* Use `yield from`
2022-01-11 07:21:16 -08:00
Reem H 866e82c37d
Updated remaining VPN logos to use Protocol assets (#11100)
* updated remaining VPN assets to use Protocol logos

* PR fixes
2022-01-10 20:49:05 +02:00
Craig Cook 52bd8679b5
Shrink QR code on EN WNP96 [#11070] (#11101) 2022-01-10 19:24:15 +02:00
Steve Jalim 332fd911d0 Deal with warning during test collection - rename fake class to avoid false alarm
A clash between test auto-discovery (find something beginning with "Test") and
a dummy/utility class created for testing the relevant decorator was causing pytest
to raise warning.
Renaming the dummy classes worked - running `pytest bedrock/utils -vv` shows the relevant tests
are run, while the warnings are now gone
2022-01-10 12:56:37 +00:00
Steve Jalim 7c4ca6863f Update android-sys-req helper for FF100+
System requirement pages for Android releases exist from 46.0 and upward. This changeset makes sure that it the relevant check works for FF100 and above
2022-01-10 12:27:50 +00:00
Alex Gibson 875690b91b Fix /whatsnew URL version number logic for Firefox 100 (Issue #9575) 2022-01-10 10:49:51 +00:00
Steve Jalim 74d821510f
Add a timeout to cron tasks, to avoid a long-running blockage (#11063)
* 11038: add a nine-minute timeout to cron tasks, to avoid a long-running blockage

This was suggested by @duallain following a minor problem where a scheduled sync
task stalled/failed during an infrastructure outage and just hung. Adding a
timeout should avoid this happening again.

Nine minutes is a gut-feel for a reasonable time, allowing for long-running syncs

* 11038: Reduce timeout + make timeout easier to grok

* Attempt to catch all exceptions from check_call, log them to sentry and then re-raise

* 11038: Allow SENTRY_DSN to be absent without a hard fail
2022-01-09 19:00:49 +00:00
Alex Gibson 4175943789
Add JS unit tests with Firefox v100 UA string (Issue #9575) (#11098) 2022-01-07 18:18:19 +02:00
Ayush Anand 8a4fc06b27
Fixed Error-message colour on newsletter error (#11094) 2022-01-07 15:42:26 +02:00
Alex Gibson 87112a4802
Fix typo in WNP 96 DE (Issue #11059) (#11096) 2022-01-07 10:30:43 +00:00
Alex Gibson a33e6e691f
Transparency report amendment h1 2021 (Fixes #11095) (#11097) 2022-01-07 10:29:33 +00:00
Paul McLanahan 8aa9f06626 Fix #11092: Remove old VPN ToS
Redirect to new VPN ToS.
2022-01-07 09:43:52 +00:00
Craig Cook 711c120837 Update EN WNP96 send-to-device form [#11070] 2022-01-07 09:39:10 +00:00
maureenlholland 91e4628067
Clean up pocket banner (fixes #11050) (#11088)
* Clean up pocket banner (fixes #11050)

* remove show_pocket_banner conditionals in html
2022-01-06 19:55:05 +02:00
Craig Cook 1836be11c3 Update Adjust links on EN WNP96 [#11070] 2022-01-06 17:06:17 +00:00
Craig Cook e1da770895
Add EN WNP for Firefox 96 [fix #11070] (#11087) 2022-01-06 15:59:19 +00:00
Steve Jalim cf280577e5
Contentful l10n support - all-in-one PR (#11061)
* BUGFIX: always pop the preview_image key from the SEO object, so that a missing preview image doesn't break the sync

* 10867: Remove unique constraint on ContentfulEntry.contentful_id and make hybrid with locale field

This is required because translations of Entries in Contentful share the same ID but vary on locale, making the uniqueness check a combination of contentful_id and locale

* 10867: Move hard-coded IDs for Contentful Homepage lookup into settings, because we'll need them as part of some homepage-specific logic when syncing multuple locales very soon

* 10810: Log to Sentry if we end up using the static fallback homepages instead of data from Contentful

* 10867: Looking forward, support getting individual pages by ID and locale, not just ID.

This is backwards-compatible with the way that the EN and DE Homepages are pulled from the DB only via ID.

When we add in the multi-locale sync in an upcoming commit, we'll deliberately ONLY sync the homepages for en-US, because they don't really have a formal locale field set up, and we WON'T sync them for any other locale

* 10867: Add support for syncing multiple locales from Contentful

This changeset updates how we pull from Contentful to ensure we query for a
version of every page in every locale that's enabled in Contentful. It's not
the most efficient - there are quite a lost of wasted queries and we're not
getting a bunch of Entries at once, just iterating through N page * M locales,
but it's workable for now.

There are also a number of workarounds in the code:

1) When syncing the homepages (connectHomepage Entries) we know we can't
trust the locale field we're currently extracting for them, so we only
sync them for en-US. This will go away when we move the homepages to Compose.

2) When syncing a Compose `page` in any locale other than en-US, we get back
an Entry, but when we try to read its content, things blow up because there is
no child Entry linked to it. Because of this, we have to check for a specific
AttributeError message, and skip that page, but it does still cost us a network
call.

* 10867: Drop patching/truncation of es locales when going from Bedrock to Contentful because Contentful now has the variations of the locale

* 10867: Update tests for locale-supporting Contentful sync. More to come

* 10867: Reduce the noise during the sync

* 10867: Fix broken locale map from Bedrock to Contentful

🤦

* 10867: Constants cleanup while in the neighbourhood

* 10867: Update deletion logic so that removing an individual locale in Contentful works

The locale-specific version of the page is removed from the DB, but any others persist. 
Before this change, the deleted locale persisted, which was not ideal even though the 
use-case of removing just one locale from a published page is small

* Update comment to highlight risk of cacheing mutable data structures

* Rename test module for Contentful management commands

* 11022: Add helpers for deciding when we have enough Contentful content in a particular locale to 'activate' it.

Broadly similar to how we use Fluent files, we have a configurable threshold
percentage which we use to decide whether we have enough ContentfulEntry
records of the given classification and content_type in the target locale,
compared to the default locale, to say 'yes we have enough records to consider
this locale as active.

Use cases are building a list of active locales to use in the footer <select>
and also deciding if a listing page (eg the VRC page) is worth rendering in
a particular locale, or redirecting to the default locale]

* 11022: Refactor Contentful active_locales helper to hit the DB less

* Drop unnecessary cache-timeout config

* 10867: Fix typo in short locale code version of ja-JP

* 11022: [Almost] Guarantee that all locales will show content in DEV mode

This will overrire any threshold setting for locales for Contentful-sourced content

* 11022: Extend Contentful-specific active_locales helper with optional scoping for all content with a particular (shared) slug

* 11022: Update VRC listing and article views to support multiple locales

* If requested locale isn't available for a specific article, try defaulting to en-US for the same slug, else 404
* Show the locale selector on listing and article pages, showing only those locales that are 'active', as defined by the helper util from an earlier commit

* Backfill tests for ContentfulEntry model - now at 100%

* Test coverage papercuts for Contentful management command

* Add pytest-mock to dev deps

* Contentful sync: split up main method to be a bit smaller + add another coverage increment

* Test regression fixups after rebasing

* Update comment on Bedrock<->Contentful locale map to help avoid misunderstanding

* VRC listing view: use l10n_utils.render to automatically select an appropriate locale if selected one is inviable

Returning early with the call to render() is better than a forced redirect to a DEFAULT_LOCALE, because it will
try to get the most appropriate default locale it can, rather than assuming en-US.

* Rename helper function used to transform Contentful locale names to Bedrock locale names

* VRC article view: use l10n_utils.render to automatically select an appropriate locale
...if the selected one is inviable

* Trim comments

* Optimise get_active_locales: return early when we've got a slug in the kwargs

When finding locales by slug + content_type + classification, every result returned
is active 'enough' because we only need one match for that triplet of params for it
to count as 'enough'. As such, we can return early and avoid crunching data unnecessarily

* Expand tests to cover both unavailable and invalid locales

* Refactor the redirection logic from l10n_utils.render() into a reusable function

Tested manually with DEV=False to be able to replicate locale redirection for /ff/ as a locale

* Refactor VRC to use redirect_to_best_locale helper - much cleaner now

* Tidy up the dev-level override for the Contentful locale activation threshold
2022-01-06 09:49:19 +00:00
Alex Gibson 58a8340806 Use VPN client ID for service parameter referrals (Fixes #11074) 2022-01-05 16:08:10 +00:00