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

Updated CI workflows to avoid race conditions on PRs with concurrency label #778

Merged
merged 31 commits into from
Jul 3, 2024

Conversation

rashidnhm
Copy link
Collaborator

@rashidnhm rashidnhm commented Jun 26, 2024

Context:
Currently there exists a race condition within the CI due to misconfiguration of the concurrency label.

This PR updates the affected workflows to fix the concurrency labels.

Description of the Change:
${{ github.event }} is not a string, but rather an object, when you have that in the concurrency label you get:

# Label
group: my-workflow-${{ github.event }}-${{ github.ref }}

# Renders as
group: my-workflow-[object Object]-refs/heads/my-branch

This was causing workflows that had pull_request and workflow_call triggers to overstep on each other's runtime as they both rendered with the same concurrency label.

This PR changes the attribute to use the correct string name event_name.

# Label
group: my-workflow-${{ github.event_name }}-${{ github.ref }}

# Renders as
group: my-workflow-pull_request-refs/heads/my-branch

Benefits:
Race conditions averted. No random job cancellations especially when PR needs wheels built.

Possible Drawbacks:
None.

Related GitHub Issues:
None. sc-66955

Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.48%. Comparing base (3d6db7a) to head (e94b402).
Report is 94 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #778   +/-   ##
=======================================
  Coverage   98.48%   98.48%           
=======================================
  Files         109      109           
  Lines       15801    15801           
=======================================
  Hits        15562    15562           
  Misses        239      239           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but do we want to target the RC branch?

@rashidnhm
Copy link
Collaborator Author

LGTM, but do we want to target the RC branch?

Probably best to have it in the default branch first. I'll open a subsequent PR to the rc branch

Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Don't forget to update the changelog.

@rashidnhm rashidnhm added urgent Mark a pull request as high priority and removed urgent Mark a pull request as high priority labels Jul 2, 2024
@rashidnhm rashidnhm requested review from maliasadi and vincentmr July 2, 2024 23:19
@rashidnhm
Copy link
Collaborator Author

@maliasadi @vincentmr

Re-requesting a review as I've had to address an additional issue within the PR.

Scipy was being installed to the python venv on the self-hosted runner, but the build was using the system Python (and thus could not find the installed scipy). This was causing sporradic failures and bugs.

The solution was to export Python_ROOT_DIR and Python3_ROOT_DIR to hint cmake's find_package to use the correct venv python installation for workflows running on aws instances.

Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks again @rashidnhm .

Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rashidnhm! Looks good to merge now :)

@rashidnhm rashidnhm merged commit 45bc864 into master Jul 3, 2024
89 of 90 checks passed
@rashidnhm rashidnhm deleted the sc-66955-fix-ci-race-condition branch July 3, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
urgent Mark a pull request as high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants