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

Fix addon checks not being executed when running runtime checks #751

Merged
merged 7 commits into from
Oct 26, 2024

Conversation

felixarntz
Copy link
Member

This is a child PR of #749. Please merge that one first.

Fixes #607.

As noted prior, despite our various fixes related to e.g. #597, addon runtime checks still don't work as of today. This PR aims to fix that.

It looks like the underlying problem is that the Default_Check_Repository runs the wp_plugin_check_checks filter too early when any runtime checks are being run. Now that I noticed it, it seems like an obvious oversight, but was kind of hard to spot 😅

To address this problem, we simply need to ensure the filter is run again after plugins have been loaded.

For the scenario where the Default_Check_Repository is instantiated when plugins are already loaded, no change is needed, in this case we can set a flag that the checks are "fully initialized" from the start.

@felixarntz felixarntz added [Type] Bug An existing feature is broken WP Admin Issues for the WP Admin screen WP-CLI Issues related to WP-CLI labels Oct 25, 2024
@felixarntz felixarntz added this to the 1.3.0 milestone Oct 25, 2024
Copy link

github-actions bot commented Oct 25, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: felixarntz <[email protected]>
Co-authored-by: swissspidy <[email protected]>
Co-authored-by: ernilambar <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@felixarntz felixarntz changed the base branch from fix/inconsistent-runtime-setup to trunk October 25, 2024 20:59
@swissspidy
Copy link
Member

This is a child PR of #749. Please merge that one first.

Wanna rebase to make that more clear?

@felixarntz felixarntz changed the base branch from trunk to fix/inconsistent-runtime-setup October 25, 2024 21:14
@felixarntz
Copy link
Member Author

This is a child PR of #749. Please merge that one first.

Wanna rebase to make that more clear?

Yes, I just had this open against trunk so that all the tests run and I can verify they pass. Just changed it back to the other branch.

Here you can see the Behat tests passing with the latest state of this PR, including all the ones that used to be commented out: https://github.com/WordPress/plugin-check/actions/runs/11525465349

# """
And STDOUT should contain:
"""
ExampleRuntimeCheck.ForbiddenScript,WARNING
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

Base automatically changed from fix/inconsistent-runtime-setup to trunk October 26, 2024 00:21
@ernilambar ernilambar merged commit cf7bfa5 into trunk Oct 26, 2024
3 checks passed
@ernilambar ernilambar deleted the fix/runtime-checks branch October 26, 2024 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature is broken WP Admin Issues for the WP Admin screen WP-CLI Issues related to WP-CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add end-to-end (e2e) tests
3 participants