-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Disable Xdebug by default unless specified by user #34324
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @brylie! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
It's spelled "Xdebug" (no capital "D").
FWIW, I don't think this is wise, as you're going to make it harder for people to get a working debugging setup. |
Thanks for pointing that out. I corrected the title and description 😃
From what I understand This pull request avoids automatically installing Xdebug when It may be worth pointing out that |
There is currently no way to disable the Xdebug installation, even when it is desirable to do so. I am encountering a bug during the Xdebug installation (#34320) step and would just like to bypass the Xdebug installation to continue with my development task. For simplicity's sake, it is important only to install dependencies that are needed. |
hope this gets through because I am working for a client that uses wp-env to set up unit tests on their precommit hook |
@koengabriels would you mind taking a close look at the code and possibly testing it on your end? Your peer review would be much appreciated 😃 |
@brylie I have to look into how to do that, I have zero experience with testing a PR from Github or wp-env code base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple comments, but I think we can move forward with this.
This doesn't change the public API for using xdebug with wp-env, so it isn't any harder to enable with wp-env. 👍
I tested locally, and it will create a wordpress image without xdebug by default, and one with xdebug as soon as the --xdebug
flag is passed.
Another note is to run prettier locally to get the lint check passing 👍
@noahtallen, I've incorporated your suggested changes to the nested logic and conditional as well as the suggestion from PR #35667 Are there any other changes you would recommend? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests well for me, thank you for implementing the suggestions!
I don't have access to merge unless the CI checks are passing. I'd recommend running prettier/eslint again and rebasing the PR on the latest trunk changes.
It would also be great if you could add a line to the changelog (https://github.com/WordPress/gutenberg/blob/trunk/packages/env/CHANGELOG.md) under the "unreleased" section (probably under a new heading ### Enhancement
)
Other than that, I think this is good to go 👍
Sorry for the review request bonanza. I tried to rebase changes from Would someone with admin rights please help bypass the CI review since most tasks are unrelated to this pull request? @noahtallen, would you please review the recent changes to this PR? I've refactored the PHP compatibility check into its own function so the |
Why bypass CI review? There are some actual lint errors in |
When I run
When I have tried running 2021-10-29T08_01_35_754Z-debug.log.txt I believe these issues are related to the monorepo nature of this project whereby it is necessary to install the entire Gutenberg development stack as well as any other libraries published by |
Yes it's a monorepo and you'd need to run You should also be using the latest Node LTS, Node 16 (run |
@noahtallen, it seems like the CI checks are all passing or skipped. Would you mind giving this another review? |
For future reference, I think this is because gutenberg still requires npm v6. I think there is a project to update that, though. But now that CI is passing, it shouldn't be a problem for this PR :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest changes also test well, thank you!
This change will get released to npm whenever the gutenberg project does its next npm release, though I'm not sure when that will be unfortunately. I think the schedule changes around WordPress release windows
Description
Currently,
wp-env
installs Xdebug regardless of whether the user has requested it. The only installation check is based on PHP version being 7.2+.Xdebug shouldn't be installed unless specified by the user. Likewise, the Docker file should be more careful when running the
pecl install xdebug
command, as noted by @noahtallen.The added complexity of the Xdebug installation is causing some other issues:
pecl install xdebug
#30213How has this been tested?
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).