Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use different config files and do different PRs on one repository #89

Closed
Tracked by #33
teolemon opened this issue Sep 14, 2021 · 8 comments
Closed
Tracked by #33

Use different config files and do different PRs on one repository #89

teolemon opened this issue Sep 14, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@teolemon
Copy link

teolemon commented Sep 14, 2021

What

  • We have a repository with PR averaging 1K to 2K files, and I'd like to split it up in smaller PRs (either one PR per language, or one PR per file to translate, not completely sure).
  • Is there a way to use different config files and do different PRs on one repository, without spawning the GitHub action several times, and wasting computing ressources both on GitHub and on Crowdin's server ?
@teolemon teolemon added the enhancement New feature or request label Sep 14, 2021
@andrii-bodnar
Copy link
Member

HI @teolemon!

It is possible to use different config files and do different PRs on one repository.

To do this, you need to split your Crowdin Action WF step into separate steps. Each of these steps should use a different config through the config parameter. Also, you can specify various pull_request_title's for each of these steps.

And then, each WF Step will use only a specified config file and will create a separate PR including only those files, that were configured in config.

@teolemon
Copy link
Author

teolemon commented Sep 16, 2021

@andrii-bodnar Thanks a lot for the answer 👍 Am I right in thinking that this method will trigger a Crowdin build each time (around 45 min for us) ?
45 min * 100 = a lot of time
Ideally, I'd like to do it this way:

steps:
  - name: Common Build (45min) using the Crowdin action
    run: #run the action
strategy:
 matrix:
  lang: ['aa', 'fr', 'en', ...]
steps:
  - name: Language PR (10s) without having to trigger the action again
    run: echo ${{ matrix.lang }}

@andrii-bodnar
Copy link
Member

@teolemon it's interesting 🤔

Just trying to figure out if this is possible now. Crowdin Action doesn't know anything about languages and the only way to control languages - parameters download_language and upload_language.

Let's imagine that we will download all the translations once and then we should create a separate PR for each language. Crowdin Action will need to find files for each language, then add to git and commit. This is a difficult task because downloaded files can have different export patterns with different language codes.

You could try to split your WF at least by language. In This case, Crowdin Action will create a separate PR for each language and as a result, PRs will be smaller. This shouldn't affect the execution time, because project buildlang1 build + lang2 build + ... + langN build

@teolemon
Copy link
Author

Open Food Fact's current workflow is this one, https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/workflows/crowdin.yml, with files located in another file https://github.com/openfoodfacts/openfoodfacts-server/blob/main/crowdin.yml

I've made a PR implementing your suggestion, but I'm not sure it won't block the 2nd step to the build triggered in the 1st one
openfoodfacts/openfoodfacts-server#5752

@andrii-bodnar
Copy link
Member

Hi @teolemon!
Hmm, unfortunately in this case all of the builds were running in parallel and some of them failed with 429 Too Many Requests and 409 Conflict responses.

Parallel builds are not allowed in Crowdin and number of simultaneous API requests per account is 20 requests.

Is there any way to run a matrix not in parallel, but sequentially?

@teolemon
Copy link
Author

teolemon commented Oct 1, 2021

There is @andrii-bodnar : https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymax-parallel

@andrii-bodnar
Copy link
Member

@teolemon great, probably with max-parallel: 1 it should work.

@andrii-bodnar
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants