Skip to content

CI - check for the ci/no-release label first#7948

Merged
pavoljuhas merged 1 commit intoquantumlib:mainfrom
pavoljuhas:ci-release-check-labels-first
Mar 11, 2026
Merged

CI - check for the ci/no-release label first#7948
pavoljuhas merged 1 commit intoquantumlib:mainfrom
pavoljuhas:ci-release-check-labels-first

Conversation

@pavoljuhas
Copy link
Collaborator

Exit early if the release workflow is asked to do nothing.

Exit early if the release workflow is asked to do nothing.
@pavoljuhas pavoljuhas requested review from a team and vtomole as code owners March 11, 2026 00:32
@pavoljuhas pavoljuhas requested a review from dabacon March 11, 2026 00:32
@github-actions github-actions bot added the size: S 10< lines changed <50 label Mar 11, 2026
@pavoljuhas pavoljuhas requested a review from mhucka March 11, 2026 00:32
@pavoljuhas pavoljuhas added the ci/no-release Use this label for pull request that should not have Cirq pre-release on PyPI. label Mar 11, 2026
@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.63%. Comparing base (1ac366c) to head (b4721ce).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7948   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files        1108     1108           
  Lines       99571    99571           
=======================================
  Hits        99205    99205           
  Misses        366      366           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@mhucka mhucka left a comment

Choose a reason for hiding this comment

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

I wrote a small optional suggestion for an alternative for getting the PR number. Otherwise LGTM.

env:
GH_TOKEN: ${{ github.token }}
run: |
pr_number=$(git log -1 --pretty="%s" | sed -n -E "s/.*[(]#([0-9]+)[)]$/\1/p")
Copy link
Contributor

Choose a reason for hiding this comment

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

That sed command concerns me due to its complexity and assumption about the format of the log message. The following may be more robust:

pr_number=$(gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number')

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ack. I thought about that option, but I feel it is vulnerable to race condition. The push event that starts this workflow is emitted right after the PR merge to main, ie, after the state flip from OPEN to MERGED. gh pr list --search presumably checks some database and I am not sure it is guaranteed to be up-to-date by the time of the push event. OTOH, the main head must exist in the working repo and for the past 4 years the commit subject line has ended in (#PR_NUMBER) (the first exception being #5196 which might have been a manual push).

In the worst case, when sed pattern does not match, the pr_number is set to an empty string which is handled just as the default no-special-label case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point about the potential race condition.

@pavoljuhas pavoljuhas added this pull request to the merge queue Mar 11, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 11, 2026
@pavoljuhas pavoljuhas added this pull request to the merge queue Mar 11, 2026
Merged via the queue into quantumlib:main with commit 83165d3 Mar 11, 2026
41 checks passed
@pavoljuhas pavoljuhas deleted the ci-release-check-labels-first branch March 11, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/no-release Use this label for pull request that should not have Cirq pre-release on PyPI. size: S 10< lines changed <50

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants