Skip to content

Conversation

pavoljuhas
Copy link
Collaborator

The check/ts-build-current CI job could pass if check/ts-build
failed before writing the bundle files.

The `check/ts-build-current` CI job could pass if `check/ts-build`
failed before writing the bundle files.
@pavoljuhas pavoljuhas requested review from a team and vtomole as code owners October 8, 2025 01:20
@pavoljuhas pavoljuhas requested a review from viathor October 8, 2025 01:20
@github-actions github-actions bot added the Size: XS <10 lines changed label Oct 8, 2025
@pavoljuhas pavoljuhas requested a review from mhucka October 8, 2025 01:20
@pavoljuhas
Copy link
Collaborator Author

cc: @seunomonije (related to #7687)

Copy link

codecov bot commented Oct 8, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7696      +/-   ##
==========================================
- Coverage   99.38%   99.37%   -0.01%     
==========================================
  Files        1089     1089              
  Lines       97550    97550              
==========================================
- Hits        96948    96945       -3     
- Misses        602      605       +3     

☔ 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.

################################################################################

check/ts-build
check/ts-build || exit $?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional: Would it be appropriate to use set -e in this script?

Copy link
Contributor

@mhucka mhucka Oct 9, 2025

Choose a reason for hiding this comment

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

I'm not Pavol, but I just had an experience involving set -e so feeling compelled to chime in. Using set -e would obviate the need for the exit statement in this one place, but it would also cause the script to exit if git diff on line 27 found any differences. (The use of set -e causes errors inside $(…) commands to "bubble up", in a sense.) That in turn would prevent the rest of the logic in the script from working as desired.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In this PR I'd like to do a minimum change to prevent failing builds going unnoticed and do a more complete fix later. As for the set -e the rules how it applies are a bit byzantine (e.g., true && false does exit, but false && true does not) to a level it is easier for me to reason about the script without errexit.

BTW, I am going to hold on with this PR a bit, because it would start failing the CI for unrelated contributions. The fix for the ts-build is in works at #7697 so I will wait for it with the merge here.

Copy link
Collaborator

@viathor viathor Oct 9, 2025

Choose a reason for hiding this comment

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

@mhucka IIUC, exiting when there are untracked files is the intended behavior. Indeed, it is what we do explicitly in the conditional, so set -e may simplify the script.

@pavoljuhas It was only a suggestion.

################################################################################

check/ts-build
check/ts-build || exit $?
Copy link
Collaborator

@viathor viathor Oct 9, 2025

Choose a reason for hiding this comment

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

@mhucka IIUC, exiting when there are untracked files is the intended behavior. Indeed, it is what we do explicitly in the conditional, so set -e may simplify the script.

@pavoljuhas It was only a suggestion.

@pavoljuhas pavoljuhas enabled auto-merge October 10, 2025 16:30
@pavoljuhas pavoljuhas added this pull request to the merge queue Oct 10, 2025
Merged via the queue into quantumlib:main with commit 72c728a Oct 10, 2025
35 checks passed
@pavoljuhas pavoljuhas deleted the stopgap-fix-for-ci-bundle-files branch October 10, 2025 17:11
@mhucka
Copy link
Contributor

mhucka commented Oct 10, 2025

Re the comment above:

@mhucka IIUC, exiting when there are untracked files is the intended behavior. Indeed, it is what we do explicitly in the conditional, so set -e may simplify the script.

True, but right now, the script prints an explanatory message. With set -e, it would exit before it got to the part where it prints the message:

if [[ -n "$untracked" ]]; then
    echo -e "\033[31mERROR: Uncommitted changes to bundle file(s) found! Please commit these files:\033[0m"
    for generated in $untracked
    do
        echo -e "\033[31m ${generated}\033[0m"
    done

As far as I can see, the behavior of git diff --name-only HEAD is to print a list of files without any further explanation. So while both approaches would exit with an exit code of 1, IMHO there is some value in explaining to the user why that happened.

pavoljuhas added a commit to pavoljuhas/Cirq that referenced this pull request Oct 14, 2025
Exit with error status if check/ts-build does not recreate
bundle files exactly as they were.  Also detect orphaned and
uncommitted new files.

Follow-up to quantumlib#7696
github-merge-queue bot pushed a commit that referenced this pull request Oct 15, 2025
Exit with error status if check/ts-build does not recreate
bundle files exactly as they were.  Also detect orphaned and
uncommitted new files.

Follow-up to #7696
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: XS <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants