addons-server icon indicating copy to clipboard operation
addons-server copied to clipboard

Add CI workflow and update Makefile-docker

Open KevinMind opened this issue 1 year ago • 4 comments

fixes: mozilla/addons#5872

Description

Using a github action to extract l10n strings on push to master. It sets up the environment, and runs the extract and push scripts. This would result in a push on master if there are new locales.

Context

The action approach bypasses the token issues we had in previous attempts made with CircleCI as action runners can push to their repositories automatically. It's also safe because this job can only run on a push to master in our repository, so we do not need any additional potentially vulnerable credentials and modifications to our actions are in our control already.

Right now, there are two approaches, 1 using docker compose and make commands to execute. This works but is CPU expensive. The other approach attempts to install python and our bare minimum needed dependencies to execute. We will probably need to refactor this further to make it useful as it's currently not working.

I wanted to open this up for review already to make sure we align on the initial idea and if we do I can make those changes and get the PR ready to merge.

Testing

In the long term this action can be tested outside of master by pushing to a branch called 1extract-locales, that way we can freely tweak the code without needing pushes to master.

KevinMind avatar Feb 07 '24 12:02 KevinMind

https://github.com/mozilla/addons-server/assets/19595165/4067ceb4-dd3e-4e0a-8faf-e21fb4218231

You can confirm that the second commit which was generated by this branch is not triggering the job to create another commit, thus avoiding infinite loops (link)

KevinMind avatar Feb 07 '24 17:02 KevinMind

Example run that did not push https://github.com/mozilla/addons-server/actions/runs/7819322737/job/21331523440?pr=21822

KevinMind avatar Feb 07 '24 18:02 KevinMind

@diox we should probably add a filter on our circleci master release to ignore pushes made by this job. No need to build a container for strings.

KevinMind avatar Feb 07 '24 18:02 KevinMind

Job, pushing changes https://github.com/mozilla/addons-server/actions/runs/7834008833/job/21376296237?pr=21822

KevinMind avatar Feb 08 '24 18:02 KevinMind