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

[check] Split github action into two stages (source, output) #4533

Merged
merged 1 commit into from Mar 2, 2021

Conversation

jensmaurer
Copy link
Member

@jensmaurer jensmaurer commented Feb 27, 2021

Also improve the visibility of error messages.

Resolves #4529

@jensmaurer jensmaurer changed the title experiments with check.sh ci: split checking into two stages: before and after LaTeX Feb 27, 2021
@jensmaurer
Copy link
Member Author

error-sample

@JohelEGP
Copy link
Contributor

It seems that the source location in the message is still useful. Otherwise, it only appears when you look at it from "Files changed" (see image below) and not in the workflow run logs.
1614460395

@jensmaurer
Copy link
Member Author

Ah, nice.

@jwakely
Copy link
Member

jwakely commented Mar 1, 2021

Excellent, thanks!

Copy link
Contributor

@tkoeppe tkoeppe left a comment

Choose a reason for hiding this comment

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

  1. I don't understand all the detailed sed/grep magic, but please do what you think is best.
  2. The split is great. I might maybe call the two phases check-source and check-output?
  3. Regarding the commit message: this isn't just "CI", since it's also precommit. I recommend phrasing the commit message as "Split GitHub action into two stages (source, output)".

tools/check.sh Outdated

# For some reason, the file/line/col information is not shown in the GUI.
# Make sure to leave it in the message proper.
! sed 's/^\(.\+\.tex\):\([0-9]\+\):/::error file=source\/\1,line=\2::\1:\2:'"$*"': /; s/^\([^:][^:]\)/::error ::'"$*"': \1/' |
Copy link
Member

Choose a reason for hiding this comment

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

I think the last sed command will be ill-formed if the $* message contains a / e.g. something like | fail "misplaced begin/end"

It's probably OK, but if we want to allow / in the errors we could use another character less likely to be used in the error string, e.g. @

 ! sed 's@^\(.\+\.tex\):\([0-9]\+\):@::error file=source/\1,line=\2::\1:\2:'"$*"': @; s@^\([^:][^:]\)@::error ::'"$*"': \1@' |

(N.B. this also allows source/ instead of source\/)

Copy link
Member Author

@jensmaurer jensmaurer Mar 1, 2021

Choose a reason for hiding this comment

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

The trouble is that awk's regex machinery doesn't seem to allow references to sub-matches grouped by ().

But using @ as the sed separator is probably a good compromise.

Copy link
Member

Choose a reason for hiding this comment

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

GNU awk's gensub() function supports back-refs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great, but @burblebee already dislikes GNU-isms in sed, so better avoid them for such a central functionality.

@JohelEGP
Copy link
Contributor

JohelEGP commented Mar 1, 2021

3. Regarding the commit message: this isn't just "CI", since it's also precommit. I recommend phrasing the commit message as "Split GitHub action into two stages (source, output)".

Regarding that. For my recent commits that did not touch the LaTeX sources, I took the liberty to use https://www.conventionalcommits.org/.

Also improve the visibility of error messages.
@jensmaurer
Copy link
Member Author

@tkoeppe, I've addressed your concerns. Please have another look.

@jensmaurer jensmaurer requested a review from tkoeppe March 1, 2021 21:14
@jensmaurer jensmaurer changed the title ci: split checking into two stages: before and after LaTeX [check] Split github action into two stages (source, output) Mar 1, 2021
@tkoeppe
Copy link
Contributor

tkoeppe commented Mar 1, 2021

@jensmaurer: Great, thanks, ship it!

@JohelEGP: Yeah, I didn't have a good regular label at hand previously, so I just sayd "Action" a lot, but I think Jens has come up with a nice one that we can use from now on.

@jensmaurer jensmaurer merged commit b0da187 into cplusplus:master Mar 2, 2021
@jensmaurer jensmaurer deleted the chk branch March 2, 2021 07:28
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.

ci: more visibility of errors output by tools/check.sh
4 participants