* 10544: Add Contentful-SQS settings, from env vars
* Update documentation re test service lacking custom env vars
* 10544: Switch from polling Contentful directly to checking a message queue
Prior to this changeset, the update_contentful management command would immediately pull all content from Contentful and then decide whether the local DB needed updating or not.
This change was run every few minutes as part of run-db-update.sh, called by a clock process, and resulted in lots of API calls to Contentful, even though content may not have changed.
This changeset now first checks an SQS message queue for a notification from Contentful (put there via a separately configured webhook at the Contentful side each time content state changes). The messages are checked and, if the indicate that a content update is worthwhile, only _then_ is the previous set of API calls triggered.
The 'go' actions vary depending on whether this is in use on Dev/Stage or Prod, to allow Dev to pull in updated draft/preview content, too. Note that Dev needs a preview-compatible API key to work in DEV=True mode
Also note that the --force option now does two things:
* [ADDED] poll contentful regardless of queue state
* [RETAINED] update stored data even if the data hash matches
* 10544: Ensure we check the entire queue, not just the first 10 messages
...because our first 'go' signal might be 11+ messages deep in the queue
* 10544: A little tuning of the contentful importer + add MPL atop the code
* 10544: Add in tests for new contentful syncing logic
* 10544: minor typing tweak
* 10544: Make the update_contentful management command tolerant of absent config
If either Contentful or AWS SQS config is not provisioned (eg locally, or in an environment where we currently lack SQS config), we handle things gracefully so that we do not block the rest of any script that calls this command
* 10544: Remove duplicated MPL text
* 10544: Back out misleading documentation change
This changeset makes Bedrock tests use coverage.py once more, but this time via the pytest-cov plugin
The configuration set up ignores a (seemingly) sensible set of files and folders, while also outputting HTML and XML reports, for human and [future] machine enjoyment.
Key changes:
* Config expanded for coverage.py
* Main test-running script updated to invoke pytest with the appropriate coverage-logging options
* Docs updated with a small note.
* added ftl strings and drafted it on the page
* added relay image and updated some tags
* reverting cunnecessary changes on irrelevant file
* added better sized image for relay
* added fluent conditional
* added period
* 10614: Add pre-commit hook for including the MPLv2
Adds to Python, JS, SCSS, Jinja HTML, Fluent templates and shell scripts
Note that the order of application of the hooks is important - we want to add a missing license before we check the formatting of files
* 10614: Update MPLv2 comments on all templates to match standard format produced by pre-commit hook
* Updates existing MPLv2 text to use a https URL
* Amend a handful of Fluent templates that used a token instead of the string "Mozilla" - this standardised things; translation was not used or needed
* Add missing MPLv2 where needed
* Update three tests that regressed with these changes, above
* 10614: Update pre-commit config to not add MPL to JS libraries; Remove MPL from the four files which should not have had it
In addition to supporting the CloudFlare header, we should add
support for the CloudFront one so that we can more easily switch
CDN providers should we need to.
* 10575: Update black configs to stop it skipping migration files
This brings it into line with isort running on all things.
Note: removing the `migrations` dir from the exclusions will broaden the scope of other tools that pre-commit uses, but this makes sense as black and isort will be targetting these, so why not flake8 too?
* 10575: Apply updated Black config to Bedrock migrations
* 10575: Update git-blame history ignoring for previous commit
* Update requirements to avoid requests version clash
* 10570: Add isort to project
* 10570: Add isort config to project
* 10570: Add isort as a test run/CI step
* 10570: Add isort to pre-commit config
* 10570: Update isort config to allow tests/pages.py to be first-party, which is more appropriate
* 10570: Apply isort to entire codebase, using project config
* 10570: Explicitly include lib/ as a first-party import
This behaviour is already implicit in the current config, but making it explicit, partly to protect against a future change. Also makes it easier to grok what will happen to various bedrock-codebase imports
* 10570: Update isort config to stack Django imports above third-party ones
* 10570: [nit-fix] Update run-tests.sh to call isort with the same syntax pattern as we call black
In order to `make livedocs`, one needs to install requirements/docs.txt locally. However, upgrading urllib3 from 1.25.8 to 1.26.5 in #10555 broke the installation of `requests`.
This changeset upgrades `requests`, adds a hashed dependency introduced by requests, and also upgrades attrs, so that installation works on Python 3.9. Python 3.10 is not yet supported for this installation - it was about getting it back on its feet first.
https://github.com/willkg/paul-mclendahand makes maintenance-PR handling so much easier than one-by-one
This changeset adds a default config to make it pretty much instant to use after installation.
Note that this addition doesn't specify which remote to use, so we may need to tune this if 'origin' means different things to different contributors.