-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fail check/ts-build-current when bundle files cannot be built #7696
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
Fail check/ts-build-current when bundle files cannot be built #7696
Conversation
The `check/ts-build-current` CI job could pass if `check/ts-build` failed before writing the bundle files.
cc: @seunomonije (related to #7687) |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
################################################################################ | ||
|
||
check/ts-build | ||
check/ts-build || exit $? |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 $? |
There was a problem hiding this comment.
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.
Re the comment above:
True, but right now, the script prints an explanatory message. With 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 |
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
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
The
check/ts-build-current
CI job could pass ifcheck/ts-build
failed before writing the bundle files.