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

CI: fix test failure for the VIPCS VariableAnalysis sniff #630

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Mar 2, 2021

PR #450 deprecated the VIPCS native VariableAnalysis sniff in favour of using the upstream VariableAnalysis standard.

While the process() method - after throwing deprecation notices - would correctly hand off to the parent::process() method to let the upstream sniff handle throwing the errors, the register() method did not defer to the parent method.

This meant that the sniff would only listen to the original tokens the VIPCS native sniff was previously listening too and process those.
At the time of the switch-over, the tokens the VIPCS sniff was listening to and the tokens the VA sniff was listening to, happened to be the same.

However, in the mean time, in particularly in the VA 2.10.0 release, the tokens the VA sniff is listening to have been updated, while the VIPCS sniff was not updated to match.

In practice, that meant that the VIPCS sniff was "missing" some tokens, and therefore not receiving them to process().

One of the checks affected, luckily, was covered by a unit test in the VIPCS sniff, which means we have now caught this issue, which could otherwise have remained in the codebase until the VIPCS native sniff was removed.

Fixed now by letting the (deprecated) VIPCS native version of the sniff defer to the upstream parent for the register() method as well (by removing the method in the VIPCS sniff so the call will fall through to the parent sniff).

PR 450 deprecated the VIPCS native VariableAnalysis sniff in favour of using the upstream `VariableAnalysis` standard.

While the `process()` method - after throwing deprecation notices - would correctly hand off to the `parent::process()` method to let the upstream sniff handle throwing the errors, the `register()` method did not defer to the parent method.

This meant that the sniff would only listen to the original tokens the VIPCS native sniff was previously listening too and process those.
At the time of the switch-over, the tokens the VIPCS sniff was listening to and the tokens the VA sniff was listening to, happened to be the same.

However, in the mean time, in particularly in the VA `2.10.0` release, the tokens the VA sniff is listening to have been updated, while the VIPCS sniff was not updated to match.

In practice, that meant that the VIPCS sniff was "missing" some tokens, and therefore not receiving them to `process()`.

One of the checks affected, luckily, was covered by a unit test in the VIPCS sniff, which means we have now caught this issue, which could otherwise have remained in the codebase until the VIPCS native sniff was removed.

Fixed now by letting the (deprecated) VIPCS native version of the sniff defer to the upstream parent for the `register()` method as well (by removing the method in the VIPCS sniff so the call will fall through to the parent sniff).
@jrfnl jrfnl added the Type: Bug label Mar 2, 2021
@jrfnl jrfnl added this to the 2.3.0 milestone Mar 2, 2021
@jrfnl jrfnl requested a review from a team as a code owner March 2, 2021 19:52
Copy link
Contributor

@rebeccahum rebeccahum left a comment

Choose a reason for hiding this comment

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

🎉

@rebeccahum rebeccahum merged commit d199359 into develop Mar 2, 2021
@rebeccahum rebeccahum deleted the fix/tests-variableanalysis-sniff-failures branch March 2, 2021 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants