addons icon indicating copy to clipboard operation
addons copied to clipboard

Automate l10n extract/merge

Open EnTeQuAk opened this issue 7 years ago • 10 comments

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

EnTeQuAk avatar Aug 08 '18 18:08 EnTeQuAk

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

EnTeQuAk avatar Oct 19 '18 13:10 EnTeQuAk

With mozilla/addons#6020 at least product-details updating won't be needed anymore.

EnTeQuAk avatar Jan 14 '19 15:01 EnTeQuAk

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.

stale[bot] avatar Sep 08 '19 12:09 stale[bot]

Still needed.

diox avatar Sep 08 '19 22:09 diox

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.

stale[bot] avatar Mar 06 '20 23:03 stale[bot]

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.

diox avatar Apr 11 '22 12:04 diox

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

KevinMind avatar Jan 10 '24 09:01 KevinMind

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.

KevinMind avatar Jan 22 '24 13:01 KevinMind

https://blog.jdblischak.com/posts/circleci-ssh/

KevinMind avatar Feb 02 '24 12:02 KevinMind

Old Jira Ticket: https://mozilla-hub.atlassian.net/browse/ADDSRV-165

KevinMind avatar May 04 '24 12:05 KevinMind