WordPress / wordpress-playground

Run WordPress in the browser via WebAssembly PHP
https://w.org/playground/
GNU General Public License v2.0
1.65k stars 261 forks source link

[CLI] Restore the "login" argument handler #1985

Closed bgrgicak closed 2 weeks ago

bgrgicak commented 2 weeks ago

This PR restores support for login in the CLI using a login argument.

The support was previously removed in #1811.

Testing Instructions (or ideally a Blueprint)

bgrgicak commented 2 weeks ago

@adamziel I realized my mistake with removing login support. While working on #1811 I kept running into issues with login and made an incorrect assumption that it won't work anymore with autologin.

What caused the confusion for me is that I expected the --login argument to override the Blueprint, but we don't override Blueprints in the CLI. https://github.com/WordPress/wordpress-playground/blob/236c236197b23beddc4dc170991ad17d2bdfe1b1/packages/playground/cli/src/cli.ts#L209-L220

Should we allow the wp, php, and login arguments to override Blueprints? We did that recently on the Website with query arguments and Blueprints, so it should make the experience more consistent.

adamziel commented 2 weeks ago

Should we allow the wp, php, and login arguments to override Blueprints?

Potentially – this is a nice moment to explore reusing the same code paths for resolving the Blueprint in the web app and in the CLI. Would doing that be useful? If yes, what would be the most effective way to do it?

bgrgicak commented 2 weeks ago

Potentially – this is a nice moment to explore reusing the same code paths for resolving the Blueprint in the web app and in the CLI. Would doing that be useful? If yes, what would be the most effective way to do it?

Thanks! I will leave it as is for now, but if it comes up in the future we can take a look at it.

bgrgicak commented 1 week ago

Thanks! I will leave it as is for now, but if it comes up in the future we can take a look at it.

We already have an open issue to allow the wp, php arguments to override Blueprints.