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

83 Коммитов

Автор SHA1 Сообщение Дата
Rob Hudson ab16fd3c0a Run docs through `blacken-docs` 2024-10-02 17:10:45 -07:00
Alex Gibson 89833dd206
Remove tinypng-cli lib (Fixes #14014) (#14342)
* Remove tinypng-cli lib (Fixes #14014)

* Review fixes
2024-04-04 09:34:21 +11:00
Alex Gibson 6a7ac6b4f5
Migrate ESLint to use flat config (Fixes #13770) (#14338) 2024-03-28 10:25:41 +00:00
Rob Hudson 059f97e978
Add markus metrics docs (#14018) 2024-01-04 20:12:07 +00:00
Alex Gibson 9c78d30af4 Remove high_res_img() helper (Fixes #13227) 2023-08-03 09:08:22 +01:00
Rob Hudson 71457e6170 Fixes #11997: Remove `platform_img` from backend 2023-06-22 14:16:11 +01:00
Rob Hudson 8b97a92b65 Add ruff import sorting (isort) config 2023-06-07 10:00:36 -07:00
Rob Hudson b19f3e0399 Migrate to using ruff for Python linting
Ruff, written in Rust, is faster and replaces flake8 and isort (and multiple dependencies)
2023-06-07 10:00:36 -07:00
Alex Gibson dbbb76dd36
Document steps required for adding new countries to the VPN landing page (Fixes #13089) (#13114) 2023-05-11 09:35:26 +01:00
Alex Gibson 6ebeb5e269
Remove image() macro (Fixes #12190) (#12594) 2023-02-07 11:12:31 +00:00
Stephanie Hobson bb4ff04d1b
Update HTML (#12687)
Updates to HTML to reflect better support for HTML5 elements or
HTML5 syntax.
2023-02-06 09:34:47 -08:00
Nathan Barrett 7d20c13620
Moved protocol macro docs to macro file (Fixes #12022) (#12614)
* Moved protocol macro docs to macro file (Fixes #12022)
2023-01-24 11:15:40 -08:00
Alex Gibson e9f8ad5ce4 Simplify picto macro image handling (Fixes #12513) 2023-01-10 14:48:15 -08:00
Steve Jalim d870a908c5
Fix up broken links in documentation (tested via `make linkcheck`) (#12545) 2023-01-04 12:16:57 +00:00
Alex Gibson 40bd299eee
Simplify split() macro image handling (Fixes #12331) (#12485) 2022-12-23 13:18:14 +00:00
Alex Gibson 609cf81a14
Import DNT helper via NPM (Fixes #11475) (#12391) 2022-11-28 08:48:48 -08:00
Alex Gibson 28251821ee
State of Mozilla 2021 (#12384) 2022-11-17 10:16:51 +00:00
Nathan Barrett af269936eb
Remove image from card macro (Fixes #12300) (#12321) 2022-11-09 15:52:13 +00:00
Nathan Barrett 83b581326c
Remove image macro from billboard macro (#12299) 2022-11-01 17:28:49 +00:00
Alex Gibson 8e1547d316
Update Protocol macro docs (Fixes #12019) (#12020) 2022-08-10 15:52:21 +01:00
Alex Gibson a5eafe2557 Remove unused feature_card macro and CSS imports (Fixes #12009) 2022-08-10 10:14:31 -03:00
Alex Gibson 30b608d871
Add responsive image helpers (Fixes #11833) (#11994) 2022-08-09 16:33:44 +01:00
Reem H cd5e6a3607
Add front-end dependencies section in documentation (fixes #11795) (#11827)
* added dependencies to docs

* review updates
2022-06-30 11:44:04 +10:00
Alex Gibson 3436392cc0
Add link to ISO country code table in docs (Fixes #11568) (#11570) 2022-05-04 13:22:55 -07:00
Rob Hudson 785e47ae37
Ensure GET views are protected (#11540)
This updates the `page` URL helper to wrap the view using the `require_safe`
decorator, and also limits the HTTP methods on the `L10nTemplateView` to `GET`
or `HEAD`. All other views explicitly get decorated with `@require_safe`.
2022-05-02 10:18:03 -07:00
Reem H aeed6f60b6
fixed subsection visibility (#11545) 2022-04-26 13:36:03 -07:00
Reem H 5d1b371632
Document CSS bundles updates (#11526)
* updated docs to reflect new CSS bundles update

* PR fixes and fixed broken URL
2022-04-25 11:02:55 -04:00
maureenlholland 9b0a277d7d
Document how to find template from URL (fixes #11479) (#11522)
* Document how to find template from URL (fixes #11479)

* Update Firefox release to remove parentheses
2022-04-25 15:40:09 +01:00
Rob Hudson 685b41befd
Add `:abbr:` tags for common abbreviations (#11527)
* Standardize on all caps for "URL"
* Add `:abbr:` tags for common abbreviations
2022-04-23 09:57:15 -07:00
Paul McLanahan f480f0242f Update references to bedrock git default branch to main
Fix #9894
2022-04-15 14:49:12 -04:00
Paul McLanahan 6d00a9548e Stop `page` URL helper from adding a trailing slash
This will allow the helper to be used for URLs that should not have
a trailing slash.
2022-03-29 17:27:26 -04:00
Paul McLanahan 8906429e4b Update all uses of `page` helper to include a trailing slash
Also fix the docs to make this clear.
2022-03-29 17:27:26 -04:00
Steve Jalim 571849b23f
Refactor dependency management to straightfoward pip-compile (#11269)
* Switch away from pip-compile-multi in attempt to resurrect Dependabot support

Calling just pip-compile from pip-tools on each input file generates files
with no inheritance/cross-file dependencies, which hopefully will help
Dependabot process them properly

* Update ADRs in light of tooling change

* Delete redundant pip-compile-multi header file

* Update documentation

* Switch to NOT inheriting from prod reqs at all

...and plug the gap with a make command 👍

* Use requirements/prod.txt to constrain the duplicate deps in dev.txt

* Update make command for installing local deps

* Remove unnecessary -U and --no-cache-dir options
* Remove docs dependencies installation from makefile shortcut, because technically it may clash with dev.txt and we don't want developer confusion. The documentation still shows how to install the deps when required
2022-03-03 16:06:19 +00:00
Rob Hudson d83c59cb8c
Updates to support Django 3.2 (#11228)
Django 3.0 fixes:
* Remove six
* Convert LANGUAGES to a list
* Update redirects
  * Django's `re_path` no longer sends they key for matched group name if the value is `None`. This caused some errors as we were depending on the old behavior.
* Add `private` for cache-control headers
* Remove context argument to `from_db_value`
* Re-arrange check due to `re_path` change.
* Tweak contentful query
  * The change to using bitwise operations on the `Q` object here are due to this adding an empty `(AND: )` to the query. While this doesn't change anything about the underlying query, I made this change to clean up the query and match Django documented usage.
* Fix failing contentful test
* `is_ajax` is deprecated
  * The `HttpRequest.is_ajax()` method is deprecated as it relied on a jQuery-specific way of signifying AJAX calls, while current usage tends to use the JavaScript Fetch API. Depending on your use case, you can either write your own AJAX detection method, or use the new HttpRequest.accepts() method if your code depends on the client Accept HTTP header.
* Update docs to follow Django upgrades and syntax

Django 3.2 fixes:
* Set value for the new `DEFAULT_AUTO_FIELD` setting
* Updates for new app config discovery
* Update to new response headers interface.
* Remove regex from URL `path`s
* Change quoting to match black in docs
2022-02-28 10:48:36 -08:00
Steve Jalim 06a533d030
Upgrade Bedrock to Python 3.9 and update dependency management tooling (#11176)
* Move Bedrock to pip-compile-multi for easier Python dependency management

This changeset adds tooling to ease dependency management and also rationalises
our requirements files.

Before, we were just using hashin to manually hash pinned deps straight into a requirements file

Now we're using pip-compile-multi, which sits on top of pip-tools to do this.
We now get:
* Simpler syntax for adding and pinning dependencies via *.in files
* Automatic hash generation when the *.txt requirements files are produced

The dependency compilation/update tooling runs in a Docker container, so will be compatible
with the deployed service's containers.

We're also rationalising the existing split of dependency files:

* base -> being retired and used as the basis for prod requirements
* migration -> being retired and the two deps still useful to us (for moz-l10n-lint)
  added to dev deps
* dev -> now extends from the prod requirements. We're not too concerned about image
  size for dev and test builds
* prod -> still exists, but includes the base deps
* docs -> still exists as a standalone file, but also follows the "*.in"-file pattern

* Regenerate dependency files using pip-compile-multi

Note that to avoid clashes, the following balances were made:

* Keep meinheld at the lower version used in prod.txt, not the dev.txt one -- for now at least
* Downgrade Markdown to 3.3 to avoid a clash over importlib-metadata version
* Remove importlib-metadata==4.10.1 altogether as a hard pin and let pip-compile-multi work out the best fit

* Update docs to reference pip-compile-multi, replacing now-redundant notes on hashin

* Update Dockerfile to copy over and use freshly recut dependency files

* Attempting to tune deps to allow local builds to work, not just Docker ones

* Update pip-compile-multi config to inject a custom header that explains how to rebuild reqs

* Update Bedrock to use Python 3.9

* Update base images
* Update CI
* Update dependencies to make install run -- this involved manually using hashin to upgrade two hashed deps (greenlet and meinheld) then re-running make compile-requirements to update the top-level hash in prod.txt. It's a bit of a chicken-and-egg situation when the deps are built/re-locked in a container but you can't build the container itself unless the deps are viable, but it worked

* Upgrade everett in order to remove configobj, which is redundant and causing local install issues on MacOS M1

* Drop backports.cached-property and typed-ast from dev reqs because we don't need them on 3.9

* Update docs with local-installation guidance for pyenv and pyenv-virtualenv

* Remove 'upgrade requirements' option

Given that the --upgrade flag is implicitly / by-default true with
pip-compile-multi anyway, plus the fact we're hard-pininng everything,
there's no point having an explicit 'upgrade' path - so let's remove it

* Docs tweak to suggest simpler virtualenv name

* Update help option in Makefile

* Pin version of pip in the compile-requirements script

When unpinned, the build suddenly broke, so we're keeping it under strict
limits for now

* Upgrade Django to 2.2.27

* Upgrade newrelic package to latest, incl py3.9 support

* Switch to Python 3.9 Debian bullseye image, from buster

* Rationalise dependency input files to remove over-pinned subdeps

When we moved from hand-managed requirements.txt files, we were taking on files
that had literally every dependency and thier sub-deps in them. We don't want
the input (*.in) files to reference those subdeps, so this changeset tries to
thin things out and remove them

Note that the diff shows this was successful - there are very few changes to
the dependencies being mentioned in the output *.txt files, and the ones that
are there are all deliberate changes (eg removing 'pbr')

* Drop unused tenacity dep, bump APScheduler and link to a Python 3.9-patched version of mdx-outline

* Add --require-hashes option to pip usage in Dockerfile

It's implicitly set because the reqs files feature --hash=XXX
but better to be explicit

* Drop what appear to be redundant top-level dev dependencies

regex, pep8 and wcwidth appear to be subdeps that don't need pinning.

The others appear to not be in used, based on a search of the codebase.

Tests till pass

* Thin out some unnecessary top-level deps in prod.in

 - funcsigs - old backport, redundant
 - lxml - over-pinned subdep of BeautifulSoup?
 - typing_extensions - over-pinned subdep
 - zipp - over-pinned subdep

* Cap pip version to 21 for pip-compile-multi for now

* Reinstate lxml as a first-class dep: BeautifulSoup needs it as a user-specified parser

* Fix typo in pip-compile-multi header

* Hard-pin latest working combo of pip + pip-tools in compile-requirements.sh

* Update docs explaining why we're using 3.9.10 locally
2022-02-08 16:59:17 +00:00
maureenlholland 1c4b333359
Deprecate lazy_img in favour of loading=lazy (fixes #8752) (#11033) 2022-01-05 13:32:37 +00:00
Reem H 88813e46df
Add Protocol and Macro paths to Bedrock documentation (#11083)
* updated docs to reflect code paths

* updated some header titles
2022-01-04 18:54:13 +02:00
Reem H f8188a23ea
Add State of Mozilla 2020 Page (#10721) 2021-12-10 10:35:15 -08:00
Alex Gibson fe40de6f3e Add docs for how to install new Python dependencies (Fixes #10831) 2021-11-29 11:24:40 +00:00
Steve Jalim 64f4b6ef16
Update docs with a reminder about writing safer migrations (#10809)
* Update docs with a reminder about writing safer migrations

* Updates following code review - renaming columns needs three steps
2021-11-24 18:06:43 +00:00
Alex Gibson 04908c997a Remove whats-new-page geo redirects (Fixes #10590) 2021-11-04 11:24:19 +00:00
Steve Jalim a8d2e59939 10631: Reinstate support for python-coverage
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.
2021-10-25 15:59:53 -04:00
Steve Jalim a8ed6ae9c4
Add pre-commit hook for including the MPLv2 in all source code files (#10617)
* 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
2021-10-22 13:09:44 +01:00
Ayushsunny d8389a1e8a Removed yarn as a dependencies and updated the docs 2021-10-22 10:13:39 +01:00
maureenlholland ede5335c57
Remove deprecated picto cards [#10500] (#10541) 2021-10-15 16:21:35 -07:00
Steve Jalim 72609c9029
Documentation tweaks while in the neighbourhood (#10595) 2021-10-14 14:45:14 +01:00
Alex Gibson 7305098445 Format JS files using Prettier (Fixes #10468, #10479) 2021-10-08 16:07:35 +01:00
Alex Gibson 46202e3a3d Minor docs syntax fixes 2021-09-28 09:49:43 +01:00
Alex Gibson 6f93237cdb Add Babel as a transpiling option for JS bundles (Fixes #10467) 2021-09-23 09:17:14 +01:00
Alex Gibson 665323b14e Migrate to Webpack (Issue #10310) 2021-09-16 08:54:16 +01:00