π Github Reporter not generating annotations correctly
tommoyang opened this issue Β· comments
Environment information
Commands are being run in a Warpbuild
Github Actions runner (specifically warp-ubuntu-latest-x64-2x
), but i've tested and this happens on ubuntu-latest
too
CLI:
Version: 1.8.0
Color support: true
Platform:
CPU Architecture: x86_64
OS: linux
Environment:
BIOME_LOG_DIR: unset
NO_COLOR: unset
TERM: "unknown"
JS_RUNTIME_VERSION: "v18.19.0"
JS_RUNTIME_NAME: "node"
NODE_PACKAGE_MANAGER: "yarn/4.1.0"
Biome Configuration:
Status: Loaded successfully
Formatter disabled: false
Linter disabled: false
Organize imports disabled: false
VCS disabled: false
Workspace:
Open Documents: 0
What happened?
- Set up biome in a project with linting errors
- Run
yarn biome ci --reporter=github
in an actions workflow/step
Expected result
Expected: Annotation output should turn into an annotation in the Github Actions execution logs/Files Changed
view
Actual: The annotation is output as a string and nothing happens. i.e. I see this in the console:
::error title=lint/correctness/useJsxKeyInIterable,file=path/to/file.tsx,line=36,endLine=36,col=20,endColumn=48::Missing key property for this element in iterable.
Error: Process completed with exit code 1.
Instead of this, and all the other annotations stuff:
Error: Missing key property for this element in iterable.
I can confirm that the annotation format is correct - if I manually echo
the output it turns into an annotation correctly, and it's only from yarn biome ci
that it fails to work.
Code of Conduct
- I agree to follow Biome's Code of Conduct
Yeah I have been trying to understand why it hasn't been working properly, and I can't figure out why
I think colors
is the reason why the annotation doesn't work properly. Here is a working one I tested in my fork (not a fork, the website repo) with biome ci --reporter=github --colors=off
using the v1.8.2 biome release, it correctly generated all the annotations.
Tested, it's also working for me! Thanks for the fix.
I think if Github annotations are going to be generated it might be better to force colours off as opposed to setting a flag to explicitly turn them off, but i'm happy to leave that as just a note and close this issue.
I think if Github annotations are going to be generated it might be better to force colours off as opposed to setting a flag to explicitly turn them off
I completely agree with you.
One thing is turning colours off also means that the colours for summary details/total are also off:
biome/crates/biome_cli/src/reporter/terminal.rs
Lines 88 to 141 in fc9b1eb
This is not a big deal, but the ideal fix for this should be only switching off colours for the "annotation" part.
I'd like to reopen this as a reminder. Either forcing colours off entirely in this mode, or only keeping annotataions colorless is an acceptable fix.
I'd like to reopen this as a reminder. Either forcing colours off entirely in this mode, or only keeping annotataions colorless is an acceptable fix.
I think removing colours based on the reporter is the way to go. Keeping annotation colourless feels too complex, and I don't envision future cases where we need such a sophisticated feature.