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

Error on send results to sheperd.dev in Psalm 5.5 #9168

Closed
vjik opened this issue Jan 23, 2023 · 11 comments · Fixed by #9169
Closed

Error on send results to sheperd.dev in Psalm 5.5 #9168

vjik opened this issue Jan 23, 2023 · 11 comments · Fixed by #9169
Labels

Comments

@vjik
Copy link
Contributor

vjik commented Jan 23, 2023

With psalm 5.4 is OK, with 5.5 — error.

Log:

2023-01-23T18:42:18.7857115Z ##[group]Run vendor/bin/psalm --config=psalm.xml --shepherd --stats --output-format=checkstyle --php-version=8.1 | cs2pr --graceful-warnings --colorize
2023-01-23T18:42:18.7857765Z �[36;1mvendor/bin/psalm --config=psalm.xml --shepherd --stats --output-format=checkstyle --php-version=8.1 | cs2pr --graceful-warnings --colorize�[0m
2023-01-23T18:42:18.7909298Z shell: /usr/bin/bash -e {0}
2023-01-23T18:42:18.7909533Z env:
2023-01-23T18:42:18.7909756Z   COMPOSER_PROCESS_TIMEOUT: 0
2023-01-23T18:42:18.7910003Z   COMPOSER_NO_INTERACTION: 1
2023-01-23T18:42:18.7910240Z   COMPOSER_NO_AUDIT: 1
2023-01-23T18:42:18.7910493Z   COMPOSER_CACHE_DIR: /home/runner/.cache/composer
2023-01-23T18:42:18.7910778Z   MSYS: winsymlinks:nativestrict
2023-01-23T18:42:18.7911015Z ##[endgroup]
2023-01-23T18:42:18.8994535Z Warning: "findUnusedBaselineEntry" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting.
2023-01-23T18:42:18.8995543Z Warning: "findUnusedCode" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting.
2023-01-23T18:42:18.9188802Z Target PHP version: 8.1 (set by CLI argument) Enabled extensions: .
2023-01-23T18:42:18.9189343Z Scanning files...
2023-01-23T18:42:22.0967137Z Deprecation: Psalm stubs for ext-apcu loaded using legacy way. Instead, please declare ext-apcu as dependency in composer.json or use <enableExtensions> and/or <disableExtensions> directives in Psalm config.
2023-01-23T18:42:22.0968335Z Deprecation: Psalm stubs for ext-redis loaded using legacy way. Instead, please declare ext-redis as dependency in composer.json or use <enableExtensions> and/or <disableExtensions> directives in Psalm config.
2023-01-23T18:42:22.3340200Z Analyzing files...
2023-01-23T18:42:22.3340429Z 
2023-01-23T18:42:22.6142633Z ░░░░░░░░░░░░░░
2023-01-23T18:42:23.8395097Z Error: Extra content at the end of the document on line 4, column 1
2023-01-23T18:42:23.8417484Z 
2023-01-23T18:42:23.8418474Z <?xml version="1.0" encoding="UTF-8"?>
2023-01-23T18:42:23.8419114Z <checkstyle>
2023-01-23T18:42:23.8419741Z </checkstyle>
2023-01-23T18:42:23.8420280Z 🐑 results sent to shepherd.dev 🐑
2023-01-23T18:42:23.8582453Z ##[error]Process completed with exit code 2.
@psalm-github-bot
Copy link

Hey @vjik, can you reproduce the issue on https://psalm.dev ?

@weirdan
Copy link
Collaborator

weirdan commented Jan 23, 2023

Error on send results to sheperd.dev

Actually this doesn't seem to be the case here. results sent to shepherd.dev is only output when results were sent successfully.

The problem here seems to be this message is being written to STDOUT now, whereas previously it went to STDERR. @lptn can you take a look?

@weirdan weirdan added the bug label Jan 23, 2023
@alies-dev
Copy link
Contributor

alies-dev commented Jan 23, 2023

@vjik
Hm, interesting. What is the repo and git branch? Can you please share a link to GitHub workflow log?

I assume this is an issue caused by | cs2pr --graceful-warnings --colorize + new output from Psalm, but I need more info for debug

@vjik
Copy link
Contributor Author

vjik commented Jan 23, 2023

@weirdan
Copy link
Collaborator

weirdan commented Jan 23, 2023

--output-format=checkstyle makes Psalm output XML to its STDOUT. Any additional output (like that results sent to shepherd) must go to STDERR; otherwise, the XML won't be valid.

alies-dev added a commit to alies-dev/psalm that referenced this issue Jan 23, 2023
@alies-dev
Copy link
Contributor

thanks @weirdan , #9169 should fix it

@alies-dev
Copy link
Contributor

@vjik
BTW (just curious) why you don't use --output=github?

@weirdan
Copy link
Collaborator

weirdan commented Jan 23, 2023

Fixed in 5.6.0

@vjik
Copy link
Contributor Author

vjik commented Jan 24, 2023

@lptn

Psalm 5.6 with output format "checkstyle" work good: https://github.com/yiisoft/assets/actions/runs/3993746108/jobs/6850736386

Psalm 5.6 with output format "github" complete with error: https://github.com/yiisoft/assets/actions/runs/3993734424/jobs/6850714804

What is different between "checkstyle" and "github" ?

@weirdan
Copy link
Collaborator

weirdan commented Jan 24, 2023

@vjik with --output-format=github you don't need cs2pr at all. Psalm will produce the output github understands natively.

@vjik
Copy link
Contributor Author

vjik commented Jan 24, 2023

with --output-format=github you don't need cs2pr at all. Psalm will produce the output github understands natively.

It's work! Thank you!

https://github.com/yiisoft/assets/actions/runs/3993974990/jobs/6851175380

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

Successfully merging a pull request may close this issue.

3 participants