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

Results from WPCLI that allows implement in w.org #480

Open
wants to merge 12 commits into
base: trunk
Choose a base branch
from

Conversation

davidperezgar
Copy link
Member

We need to give a result from WPCLI that fits meta team in order to execute this plugin in form submission.

This results fits the need asked by Meta #441 (comment), so we could implement as well as this #478 , and it would be the minimal needs to achieve that.

The results has a json format like this:
{"pass":true,"errors":[],"warnings":[]}

The Pass value is true if it has no errors.

I'd need some feedback if the approach is correct, or we could do something more.

@davidperezgar davidperezgar linked an issue Jun 28, 2024 that may be closed by this pull request
@joemcgill
Copy link
Member

As asked in #441 (comment)

I'm curious if the presence of any errors returned by the CLI command would be sufficient as a pass/fail signal, or if the command needs to also return a specific error code as well?

@davidperezgar
Copy link
Member Author

As asked in #441 (comment)

I'm curious if the presence of any errors returned by the CLI command would be sufficient as a pass/fail signal, or if the command needs to also return a specific error code as well?

I think is the easiest way. We have to be sure that errors haven't got any false positive.

Copy link

github-actions bot commented Jul 2, 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: davidperezgar <davidperez@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
Co-authored-by: joemcgill <joemcgill@git.wordpress.org>
Co-authored-by: ernilambar <rabmalin@git.wordpress.org>
Co-authored-by: felixarntz <flixos90@git.wordpress.org>
Co-authored-by: barrykooij <barrykooij@git.wordpress.org>
Co-authored-by: dd32 <dd32@git.wordpress.org>
Co-authored-by: bordoni <bordoni@git.wordpress.org>

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

@davidperezgar davidperezgar changed the title WIK: Results from WPCLI that allows implement in w.org Jul 3, 2024
Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Thanks @davidperezgar for the PR! Let some feedbacks other then it looks good to me.

  • Fix composer phpmd errors.
    • Add @SuppressWarnings(PHPMD.ExcessiveClassComplexity) in class Plugin_Check_Command docblock.
    • Add @SuppressWarnings(PHPMD.CyclomaticComplexity) in check method docblck.
  • Additionally if you add Behat tests for new args then it would be great.
includes/CLI/Plugin_Check_Command.php Show resolved Hide resolved
includes/CLI/Plugin_Check_Command.php Outdated Show resolved Hide resolved
includes/CLI/Plugin_Check_Command.php Outdated Show resolved Hide resolved
davidperezgar and others added 2 commits July 4, 2024 08:03
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
@davidperezgar
Copy link
Member Author

Thanks for your suggestions!

@joemcgill
Copy link
Member

I don't particularly like the approach of creating a new output format specific for wporg if we are instead able to consume one of the exiting formats when passing the correct arguments to the CLI script.

Before trying to implement a solution here, can we get an answer from systems (e.g., @dd32) to the question asked in #441 (comment)? We also need to decide if #479 is a blocker to this issue, because we may not need a special CLI command at all if we can configure what errors are returned based on severity levels.

@davidperezgar davidperezgar requested review from dd32 and removed request for dd32 July 14, 2024 07:35
@davidperezgar
Copy link
Member Author

Related with #479 and #440 .

@mukeshpanchal27
Copy link
Member

@davidperezgar I have fixed PHPMD issues and added behat test for new argument.

@ernilambar
Copy link
Member

I tried this command:

wp plugin check foo-single.php --fields=line,column,code --format=wporg

Argument --fields is not respected when using wporg format.

@davidperezgar
Copy link
Member Author

Yes, and it's correct. The format for wporg is very strict and I shouldn't be customized.

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