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

Bug: Fixed method usage because of method signature change in docker-compose 0.24.6 #59184

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

Conversation

angcl
Copy link

@angcl angcl commented Feb 19, 2024

What?

Due to changes on the method signature in docker-compose 0.24.4, this PR updates the @wordpress/env package to use downAll() instead of down() which is not available anymore.

Why?

When installing @wordpress/env over npm in a new project or updating the docker-compose dependency to 0.24.6, it will break the usage of wp-env.

Fixes #59183

How?

The call to down() was changed to downAll() was changed in start.js and destroy.js and the version of docker-compose was raised to 0.24.6 in the package.json

Testing Instructions

Create a new project and use the original version of @wordpress/env. It should throw an error message like this:

❯ npx wp-env start
✖ dockerCompose.down is not a function
TypeError: dockerCompose.down is not a function
    at stop (/Users/.../node_modules/@wordpress/env/lib/commands/stop.js:27:22)
    at async start (/Users/.../node_modules/@wordpress/env/lib/commands/start.js:111:3)

Try to run wp-env with the files from this PR then, which should work flawlessly.

Copy link

github-actions bot commented Feb 19, 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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @[email protected], @angcl, @peperuda.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: [email protected], angcl, peperuda.

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

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

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Feb 19, 2024
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @angcl! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@angcl angcl changed the title fixed method usage because of dependency update for docker-compose 0.24.4 Bug: Fixed method usage because of method signature change in docker-compose 0.24.4 Feb 19, 2024
@petitphp
Copy link
Contributor

petitphp commented Feb 19, 2024

Ran into this issue with the latest version of wp-env (9.3.0) and docker-compose (0.24.4) on node@20.

I can confirm changing the calls from down to downAll fix the issue on my computer.

@swissspidy
Copy link
Member

Weird that the tests are all failing now because downAll can't be found 🤔

@petitphp
Copy link
Contributor

petitphp commented Feb 19, 2024

Looking at the raw package-lock.json, there are mentions of [email protected] in the package-lock.json :

"@wordpress/env": {
    "dependencies": {
        "packages/env/node_modules/docker-compose": {
			"version": "0.24.2",
...
"packages/env": {
    "dependencies": {
        "packages/env/node_modules/docker-compose": {
			"version": "0.24.2",

Github workflows must be using this version, which explain the failures.

@swissspidy
Copy link
Member

Alright, looks like the lock file just needs a proper update then

@angcl
Copy link
Author

angcl commented Feb 19, 2024

I've updated the lock file, now it looks good. I'll update the CHANGELOG.md file as well and push it again.

@angcl angcl changed the title Bug: Fixed method usage because of method signature change in docker-compose 0.24.4 Bug: Fixed method usage because of method signature change in docker-compose 0.24.5 Feb 19, 2024
@swissspidy swissspidy added the [Type] Bug An existing feature does not function as intended label Feb 19, 2024
@angcl
Copy link
Author

angcl commented Feb 20, 2024

Just FYI: There is also a PR for "adding down as alias for downAll" and an issue for "how to prevent such issues in the future". PDMLab/docker-compose#264

@angcl
Copy link
Author

angcl commented Feb 20, 2024

It was merged and a new version of docker-compose was released (0.24.6), which contains the aliases. PDMLab/docker-compose#264

@swissspidy
Copy link
Member

Very kind of the author, as in strict semver 0.x means it's not stable anyway. Let's update to that version. We could still keep the downAll change here.

I just double checked: the packages/env/package.json file required 0.24.3 but the lock file had 0.24.2 still. That's why there was no issue in this repo but consumers of the package had problems. So the lock file was not properly updated in #51339.

@angcl
Copy link
Author

angcl commented Feb 20, 2024

I've updated the version to 0.24.6.

@angcl angcl changed the title Bug: Fixed method usage because of method signature change in docker-compose 0.24.5 Bug: Fixed method usage because of method signature change in docker-compose 0.24.6 Feb 20, 2024
@ObliviousHarmony ObliviousHarmony removed their request for review August 26, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New installations of @wordpress/env installs docker-compose 0.24.4 and throws an error on usage
3 participants