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

Concurrency issues in CI #1412

Closed
adamjstewart opened this issue Jun 13, 2023 · 4 comments · Fixed by #1423
Closed

Concurrency issues in CI #1412

adamjstewart opened this issue Jun 13, 2023 · 4 comments · Fixed by #1423
Assignees
Milestone

Comments

@adamjstewart
Copy link
Collaborator

Description

We're seeing concurrency issues in CI where PRs are cancelling each others' jobs.

Steps to reproduce

This most commonly occurs when dependabot opens multiple simultaneous PRs.

The issue is that github.ref isn't specific enough and returns main for PRs. We can make this more robust.

See https://docs.github.com/en/actions/learn-github-actions/contexts for details.

Version

0.5.0.dev0 (06f91f7)

@adamjstewart adamjstewart added this to the 0.4.2 milestone Jun 13, 2023
@adamjstewart adamjstewart self-assigned this Jun 13, 2023
@adamjstewart
Copy link
Collaborator Author

For reference, here are the github contexts for the following events:

@adamjstewart
Copy link
Collaborator Author

The issue is that github.ref isn't specific enough and returns main for PRs.

It seems like github.ref is specific enough for both:

  • pull_request: "refs/pull/1422/merge"
  • push: "refs/heads/main"

I no longer know why this is occurring.

@adamjstewart
Copy link
Collaborator Author

This looks promising:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
  cancel-in-progress: true

I would still like to better understand why the issue is occuring though.

@adamjstewart
Copy link
Collaborator Author

For the above event logs, this looks like:

  • pull_request: ${{ tests }} @ ${{ adamjstewart:tests/concurrency || tests/concurrency || refs/pull/1422/merge }}
  • push: ${{ tests }} @ ${{ null || "" || refs/heads/main }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant