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

Generate clients CI create PR #6

Open
paddatrapper opened this issue Apr 11, 2022 · 4 comments
Open

Generate clients CI create PR #6

paddatrapper opened this issue Apr 11, 2022 · 4 comments
Labels
ci This is affecting the ci enhancement New feature or request

Comments

@paddatrapper
Copy link
Contributor

I'm not sure what we want here. Do we want a push to main on schema update or do we want it to push to a branch and open a PR against main for any changes?

The PR approach is easier to audit, but does add complexity in how those PRs are managed.

@paddatrapper paddatrapper added the question Further information is requested label Apr 11, 2022
@jooola
Copy link
Contributor

jooola commented Apr 11, 2022

I would always push to the same branch over and over and open a PR if the branch is ahead of main.

We should be able to pill up many client regeneration in the same branch/PR.

@jooola
Copy link
Contributor

jooola commented Apr 11, 2022

Also, a few problems I see in the workflows:

  • Don't cancel in progress workflows, as we want to make our life easy to track changes across repositories. Skipping a commit would mean squashing them together.
  • Change the commit message and author details
      - name: Commit changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "chore: update clients"
          commit_user_name: "github-actions[bot]"
          commit_user_email: "github-actions[bot]@users.noreply.github.com"

@paddatrapper
Copy link
Contributor Author

The reason I configured cancel in progress is to prevent race-conditions - if there are two pipelines running concurrently there can be inconsistencies introduced between them in the following case:

  1. commit 1 clones
  2. commit 2 clones
  3. commit 2 completes
  4. commit 2 pushes
  5. commit 1 completes
  6. commit 1 pushes <-- Here there will a problem

@jooola
Copy link
Contributor

jooola commented Apr 12, 2022

To fix the issue you are describing we only need to set a concurrency group for the workflow.

Workflow will always be queued in the same order they are received (with the push event) so they should always run in the right order. To prevent the commit 2 workflow to push before the commit 1 workflow, using the concurrency group will put the commit 2 workflow in pending mode awaiting for the commit 1 workflow to finish.

So I think we can safely remove the cancel in progress key, but keep the concurrency group.

See https://docs.github.com/en/enterprise-cloud@latest/actions/using-jobs/using-concurrency

jooola added a commit that referenced this issue Apr 13, 2022
@jooola jooola added enhancement New feature or request ci This is affecting the ci and removed question Further information is requested labels Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci This is affecting the ci enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants