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

Use GitHub's workflow message feature to present errors on the PR itself #93

Open
philiptaron opened this issue Aug 5, 2024 · 3 comments

Comments

@philiptaron
Copy link
Contributor

The new nixf-tidy provides a great example of how nixpkgs-check-by-name can level up. It uses GitHub’s workflow message feature to render error messages in the ‘Files changed’ overview, directly below the lines with errors.

Check an example here: workflows/check-nixf-tidy.yml: by Aleksanaa · Pull Request #1 · Aleksanaa/nixpkgs · GitHub 41.

We should do the same thing when run from CI. The current output is great for terminal use cases; this output is better for CI.

@infinisil
Copy link
Member

I've considered this before, but a problem is that such errors are limited to a single line, which then kind of requires either making two separate ways of printing every error, or not using multi-line errors in the terminal too. I don't have a strong opinion on this though. If it can be made to work well, I'm all for this :)

@philiptaron
Copy link
Contributor Author

philiptaron commented Aug 5, 2024

a problem is that such errors are limited to a single line

The schema seems to indicate that it's not: it contains both line and endLine.

@infinisil
Copy link
Member

infinisil commented Aug 5, 2024

I mean that the error message itself is limited to only being a single line. E.g.

echo -e "::error file=app.js,line=1,col=5,endColumn=7::Missing semicolon\nflorp"

Probably just annotates "Missing semicolon", while "florp" is on its own log line, not attached to any lines of code

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

No branches or pull requests

2 participants