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

infra: remove --fail-with-body from pr-description.sh #12446

Merged
merged 1 commit into from
Nov 26, 2022

Conversation

nrmancuso
Copy link
Member

@nrmancuso nrmancuso commented Nov 23, 2022

Noticed at https://github.com/checkstyle/checkstyle/actions/runs/3531403281/jobs/5924533074, check of PR description was silently failing.

0s
Run ./.ci/pr-description.sh
curl: option --fail-with-body: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
Commit messages from github: ...
Issue number: 
PR validation succeeded.

@nrmancuso nrmancuso assigned nrmancuso and romani and unassigned nrmancuso Nov 23, 2022
@rnveach
Copy link
Member

rnveach commented Nov 23, 2022

was silently failing

What should we be doing to avoid these silent fails?

@nrmancuso
Copy link
Member Author

was silently failing

What should we be doing to avoid these silent fails?

Do less piping and always check exit value of curl commands maybe?

@rnveach
Copy link
Member

rnveach commented Nov 23, 2022

Do less piping and always check exit value of curl commands maybe?

I am not a bash programmer so I can't really provide valuable insight. :)

Is it piping that is hiding the failure or is it the ${}? Can we atleast confirm this?

@romani
Copy link
Member

romani commented Nov 24, 2022

this option is ~1 year old only in curl - https://curl.se/mail/lib-2021-03/0056.html
action is using latest-ubuntu, so sad.

we can not use bash feature fail on failure in middle of pipe https://stackoverflow.com/a/32684221 , because we use grep -E "$REGEXP" | cat in this script, so we expect failed commands.

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

commit is updated.

ok to merge as CI pass

@romani romani assigned rnveach and unassigned romani Nov 24, 2022
@rnveach
Copy link
Member

rnveach commented Nov 24, 2022

we can not use bash feature fail on failure in middle of pipe ... because ... in this script

So it is the pipe that causing the hidden failure?
Can we add it to other scripts so they don't have hidden issues?

we use grep -E "$REGEXP" | cat in this script, so we expect failed commands

Is the failure because the regexp doesn't match like if they don't have issue number and thats what we are checking?

@romani
Copy link
Member

romani commented Nov 24, 2022

Pipe is not causing it.
Without bash flag that I mentioned above, failure in the middle swallowed.

Is the failure because the regexp doesn't match like if they don't have issue number and thats what we are checking?

Yes, if nothing is grepping, it is failure for grep command.

@rnveach
Copy link
Member

rnveach commented Nov 26, 2022

ok, it makes sense now. Maybe we should see if we can silo off commands that can fail and those that shouldn't from the grep.

@romani What about this? It has no grep.

COMMITS=$(curl -s -H "Authorization: token $READ_ONLY_TOKEN" "$LINK_COMMITS" \
             | jq '.[0] | .commit.message')

@rnveach rnveach assigned nrmancuso and unassigned rnveach Nov 26, 2022
@romani romani merged commit f127566 into checkstyle:master Nov 26, 2022
@romani
Copy link
Member

romani commented Nov 26, 2022

If we refactor code to avoid greps or narrow them to specific segments, I will be happy to enable failures in pipelines.
I already did somewhere enablement of such mode in code and disablement after.

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

Successfully merging this pull request may close these issues.

None yet

3 participants