-
Notifications
You must be signed in to change notification settings - Fork 672
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
Version 3.16 breaks xml reports #4252
Comments
Hey @ndench, can you reproduce the issue on https://psalm.dev ? |
Have you tried latest master? |
Having the same error in an project, and could reproduce it in different docker containers (PHP 7.1 up to 7.4 tested). edit @muglug updating to newest build found quite a few errors but still crashed on xml generation. |
Thanks @pascalheidmann for testing the newest build, I also just tried installing |
@ndench can you narrow down to a problematic commit? |
@muglug I installed psalm with Is there a way I can dump the output before it's run through the Array2XML converter? That way we can see the differences in output that was introduced by this commit? |
@ndench you could use the regular console output between the two commits |
Good idea, not sure it will help, but here's the output: Psalm v3.15
Psalm v3.16
Diff25a26,53
> INFO: PropertyNotSetInConstructor - src/Integrations/Procore/OAuth/ProcoreProvider.php:16:7 - Property Hyra\Integrations\Procore\OAuth\ProcoreProvider::$clientSecret is not defined in constructor of Hyra\Integrations\Procore\OAuth\ProcoreProvider and in any private or final methods called in the constructor (see https://psalm.dev/074)
> class �[30;47mProcoreProvider�[0m extends AbstractProvider
>
>
> INFO: PropertyNotSetInConstructor - src/Integrations/Procore/OAuth/ProcoreProvider.php:16:7 - Property Hyra\Integrations\Procore\OAuth\ProcoreProvider::$redirectUri is not defined in constructor of Hyra\Integrations\Procore\OAuth\ProcoreProvider and in any private or final methods called in the constructor (see https://psalm.dev/074)
> class �[30;47mProcoreProvider�[0m extends AbstractProvider
>
>
> INFO: PropertyNotSetInConstructor - src/Integrations/Procore/OAuth/ProcoreProvider.php:16:7 - Property Hyra\Integrations\Procore\OAuth\ProcoreProvider::$state is not defined in constructor of Hyra\Integrations\Procore\OAuth\ProcoreProvider and in any private or final methods called in the constructor (see https://psalm.dev/074)
> class �[30;47mProcoreProvider�[0m extends AbstractProvider
>
>
> INFO: PropertyNotSetInConstructor - src/Integrations/Procore/OAuth/ProcoreProvider.php:16:7 - Property Hyra\Integrations\Procore\OAuth\ProcoreProvider::$grantFactory is not defined in constructor of Hyra\Integrations\Procore\OAuth\ProcoreProvider and in any private or final methods called in the constructor (see https://psalm.dev/074)
> class �[30;47mProcoreProvider�[0m extends AbstractProvider
>
>
> INFO: PropertyNotSetInConstructor - src/Integrations/Procore/OAuth/ProcoreProvider.php:16:7 - Property Hyra\Integrations\Procore\OAuth\ProcoreProvider::$requestFactory is not defined in constructor of Hyra\Integrations\Procore\OAuth\ProcoreProvider and in any private or final methods called in the constructor (see https://psalm.dev/074)
> class �[30;47mProcoreProvider�[0m extends AbstractProvider
>
>
> INFO: PropertyNotSetInConstructor - src/Integrations/Procore/OAuth/ProcoreProvider.php:16:7 - Property Hyra\Integrations\Procore\OAuth\ProcoreProvider::$httpClient is not defined in constructor of Hyra\Integrations\Procore\OAuth\ProcoreProvider and in any private or final methods called in the constructor (see https://psalm.dev/074)
> class �[30;47mProcoreProvider�[0m extends AbstractProvider
>
>
> INFO: PropertyNotSetInConstructor - src/Integrations/Procore/OAuth/ProcoreProvider.php:16:7 - Property Hyra\Integrations\Procore\OAuth\ProcoreProvider::$optionProvider is not defined in constructor of Hyra\Integrations\Procore\OAuth\ProcoreProvider and in any private or final methods called in the constructor (see https://psalm.dev/074)
> class �[30;47mProcoreProvider�[0m extends AbstractProvider
>
>
60c88
< 10 other issues found.
---
> 17 other issues found.
63c91
< Checks took 28.36 seconds and used 1,746.899MB of memory
---
> Checks took 42.46 seconds and used 1,227.189MB of memory I then changed our psalm config to suppress PropertyNotSetInConstructor entirely, such that we would get 0 issue raised. The xml report generates successfully at this point (probably because it's empty). I then added a type error into the code and ran it again, which caused the xml conversion error. Here's the console output with a single issue raised: Psalm v3.15
Psalm v3.16
Diff10c10
< Checks took 47.66 seconds and used 1,221.033MB of memory
---
> Checks took 37.02 seconds and used 1,748.340MB of memory Which confirms as I suspected, that the diff in the original run is because v3.16 picks up on a few extra PropertyNotSetInConstructor issues. Unsure if this output is helpful or not. Is there anything else I can do that will help you to track down the issue? |
I'd try the same above with mono output. That's a very strange character... |
Good idea, I think the strange characters are to put colors in the terminal. It's interesting that checkstyle.xml and junit.xml reports still work, and that there is absolutely no difference between any of the output styles running on 3.15 and 3.16. 3.15 console monochrome
3.16 console monochrome
3.15 compact monochrome
3.16 compact monochrome
3.15 text
3.16 text
3.15 json[
{
"severity": "error",
"line_from": 28,
"line_to": 28,
"type": "UndefinedMethod",
"message": "Method Hyra\\Construction\\Entity\\Review::foobar does not exist",
"file_name": "src\/Construction\/Controller\/Api\/Review\/CancelController.php",
"file_path": "\/srv\/www\/app\/current\/src\/Construction\/Controller\/Api\/Review\/CancelController.php",
"snippet": " $review->foobar();",
"selected_text": "foobar",
"from": 765,
"to": 771,
"snippet_from": 748,
"snippet_to": 774,
"column_from": 18,
"column_to": 24,
"error_level": 6,
"shortcode": 22,
"link": "https:\/\/psalm.dev\/022",
"taint_trace": null
}
] 3.16 json[
{
"severity": "error",
"line_from": 28,
"line_to": 28,
"type": "UndefinedMethod",
"message": "Method Hyra\\Construction\\Entity\\Review::foobar does not exist",
"file_name": "src\/Construction\/Controller\/Api\/Review\/CancelController.php",
"file_path": "\/srv\/www\/app\/current\/src\/Construction\/Controller\/Api\/Review\/CancelController.php",
"snippet": " $review->foobar();",
"selected_text": "foobar",
"from": 765,
"to": 771,
"snippet_from": 748,
"snippet_to": 774,
"column_from": 18,
"column_to": 24,
"error_level": 6,
"shortcode": 22,
"link": "https:\/\/psalm.dev\/022",
"taint_trace": null
}
] 3.15 checkstyle<?xml version="1.0" encoding="UTF-8"?>
<checkstyle>
<file name="src/Construction/Controller/Api/Review/CancelController.php">
<error line="28" column="18" severity="error" message="UndefinedMethod: Method Hyra\Construction\Entity\Review::foobar does not exist"/>
</file>
</checkstyle>
3.16 checkstyle<?xml version="1.0" encoding="UTF-8"?>
<checkstyle>
<file name="src/Construction/Controller/Api/Review/CancelController.php">
<error line="28" column="18" severity="error" message="UndefinedMethod: Method Hyra\Construction\Entity\Review::foobar does not exist"/>
</file>
</checkstyle> 3.15 junit<?xml version="1.0" encoding="UTF-8"?>
<testsuites failures="1" errors="0" name="psalm" tests="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/junit-team/junit5/r5.5.1/platform-tests/src/test/resources/jenkins-junit.xsd">
<testsuite name="src/Construction/Controller/Api/Review/CancelController.php" failures="1" errors="0" tests="1">
<testcase name="src/Construction/Controller/Api/Review/CancelController.php:28" classname="UndefinedMethod" assertions="1">
<failure type="UndefinedMethod">message: Method Hyra\Construction\Entity\Review::foobar does not exist
type: UndefinedMethod
snippet: $review->foobar();
selected_text: foobar
line: 28
column_from: 18
column_to: 24
</failure>
</testcase>
</testsuite>
</testsuites> 3.16 junit<?xml version="1.0" encoding="UTF-8"?>
<testsuites failures="1" errors="0" name="psalm" tests="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/junit-team/junit5/r5.5.1/platform-tests/src/test/resources/jenkins-junit.xsd">
<testsuite name="src/Construction/Controller/Api/Review/CancelController.php" failures="1" errors="0" tests="1">
<testcase name="src/Construction/Controller/Api/Review/CancelController.php:28" classname="UndefinedMethod" assertions="1">
<failure type="UndefinedMethod">message: Method Hyra\Construction\Entity\Review::foobar does not exist
type: UndefinedMethod
snippet: $review->foobar();
selected_text: foobar
line: 28
column_from: 18
column_to: 24
</failure>
</testcase>
</testsuite>
</testsuites> |
Running Psalm at v3.16 with the following command produces an xml error:
Downgrading to v3.15 allows psalm to run successfully without a problem. I'm unsure how to debug this much further, happy to provide more information if required though.
PHP: 7.4.9
Ubuntu: 16.04
Symfony: 4.4.14
The text was updated successfully, but these errors were encountered: