Automate l10n extract/merge
Acceptance criteria:
- weekly Pull request is opened with extracted localization context
- manually approved and merged as a part of release push
Notes:
- use the simplest approach
- should include addons frontend and server, not linter
┆Issue is synchronized with this Jira Task
Just for the sake of documenting my progress, here are two temporary experiments that progress on automating l10n extraction:
- An experiment that adds auto-merge capabilities to the bash script https://github.com/mozilla/addons-server/commit/4b4db2c06c12ded680399751744d2988d3f1b331
- Another experiment that converts the current extraction bash script to Python for easier testing and extension https://github.com/mozilla/addons-server/commit/6da2e9249dbf85e13f4246ae91777e7f2c0c642f
With mozilla/addons#6020 at least product-details updating won't be needed anymore.
This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.
Still needed.
This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.
Note: we might want to consider running just the extract (generating the .pot file) on each commit / as part of the test suite. It's reasonably fast and if it runs into trouble, that should probably error out - it's likely the configuration/templates are broken in some way.
I am even more in favor of implementing the proposal here after looking at this.
But here is a potential solution for the current manual step of extracting and merging locales using a git pre-commit hook.
https://github.com/mozilla/addons-server/assets/19595165/08874a08-969e-493a-815a-ad419de68b19
PR: https://github.com/mozilla/addons-frontend/pull/12775
Adding this here as a WIP of how this could be solved in a scalable way that doesn't deviate too much from the current architecture.
We can utilize a github action to handle extracting and merging locales in a fully automated pipeline that can be shared between multiple repositories enabling this feature for all Addons repositories that do locale extraction.
Requirements:
- implement a generic github action that:
- orchestrates execution of extract and merge via expected bash scripts that should be implemented in the consuming repo.
- executes on pushes to master (a better and more automated solution would be to execute mid merge, but this would require implementing merge queues and we 1) don't have that and 2) have mixed feelings about them.
- checks if locale files have changed
- if they have, commits them and pushes to master (we could also open a PR but pontoon is already committing directly so there is little benefit)
This action could be stored in the addons repo and shared with other repositories so long as they are owned by the same org. This is the happy path, but if it is overly complex, or not feasible from a security standpoint, we can always just copy the code and if it needs updating, open PRs in the repos 🤷 anything is possible.
The scripts for extracting and merging could be separate or could be just one script that should be executed on each repo. It doesn't seem possible to completely encapsulate the logic for extracting as different repos have different implementations to work with. But if there is an expected script the repo can just add their logic there and the action will do the rest.
https://blog.jdblischak.com/posts/circleci-ssh/
Old Jira Ticket: https://mozilla-hub.atlassian.net/browse/ADDSRV-165