Skip to content

feat: add global phpmyadmin install command, fixes #6342 - #6343

Merged
rfay merged 15 commits into
ddev:masterfrom
nlighteneddesign:master
Jul 15, 2024
Merged

rfay merged 15 commits into
ddev:masterfrom
nlighteneddesign:master

Conversation

@nlighteneddesign

Copy link
Copy Markdown
Contributor

The Issue

Adds a global phpmyadmin command that asks the user if they want to install the phpmyadmin addon.

How This PR Solves The Issue

If the user answers yes then the ddev get ddev/ddev-phpmyadmin command is run.
Since this is global once the addon is installed it will override the phpmyadmin command.

Manual Testing Instructions

Configure a new directory for ddev ddev config
Run ddev phpmyadmin
You should be asked if you want to install the addon
If you answer no running ddev phpmyadmin will ask if you want to install again
If you answer yes you should receive a success message and a subsequent ddev phpmyadmin will launch phpmyadmin

Automated Testing Overview

No tests added

Release/Deployment Notes

Adds global phpmyadmin command.

@nlighteneddesign
nlighteneddesign requested a review from a team as a code owner June 24, 2024 17:01

@rfay rfay left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should have the standard directives on it

I saw there were there...

@github-actions

github-actions Bot commented Jun 24, 2024 •

Copy link
Copy Markdown

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add to TestCustomCommands,

// Make sure that all the official ddev-provided custom commands are usable by checking help
for _, c := range []string{"launch", "xdebug"} {
_, err = exec.RunHostCommand(DdevBin, c, "-h")
assert.NoError(err, "Failed to run ddev %s -h", c)
}
for _, c := range []string{"mysql", "npm", "php", "yarn"} {
_, err = exec.RunHostCommand(DdevBin, c, "--version")
assert.NoError(err, "Failed to run ddev %s --version", c)
}

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I haven't started the github tests yet because it seems like this is still stabilizing.

Please try running the test manually, see https://ddev.readthedocs.io/en/stable/developers/building-contributing/#testing

Also see the contributor training on running tests in https://ddev.com/blog/contributor-training/

Comment thread cmd/ddev/cmd/commands_test.go Resolved
@rfay
rfay requested review from rfay and stasadev June 24, 2024 22:52

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a good solution that will allow people to install phpMyAdmin without any problems.
I have made a few suggestions that need some attention.

Comment thread cmd/ddev/cmd/commands_test.go Resolved

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor wording suggestions in prompts.

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you @nlighteneddesign !

This command is doing a great job and expanding the DDEV ecosystem in the right direction.

I would even say that it was meant to be here, why wasn't it here before?

We might even want to do the same for some of the other popular add-ons.

@stasadev

Copy link
Copy Markdown
Member

Sorry, we're probably going to close it in favor of #6353.

But it's really impressive PR that got us to explore this area.

@nlighteneddesign, I'll give you commit credit in #6353 because I used your idea there.

@stasadev

stasadev commented Jul 3, 2024

Copy link
Copy Markdown
Member

Commit credit is given in c6581b0 (#6353)

Closing this PR.

@stasadev stasadev closed this Jul 3, 2024
@stasadev

stasadev commented Jul 5, 2024

Copy link
Copy Markdown
Member

This is a good thing to go in:

Even if we decide not to add the same script for other add-ons in the future, this is the most popular add-on and deserves to be automatically installed.

@stasadev stasadev reopened this Jul 5, 2024
@rfay

rfay commented Jul 5, 2024

Copy link
Copy Markdown
Member

I agree, this solves a classic problem that any number of people have asked about since PhpMyAdmin was removed from core DDEV.

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I reformatted the prompt a bit to make it look like Go prompt.

@rfay

rfay commented Jul 8, 2024

Copy link
Copy Markdown
Member

The one "interesting" bit of behavior here is that the global phpmyadmin command gets overridden by the project phpmyadmin command that gets installed by the add-on. It should work fine.

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's shocking how easy this is now. I didn't even have to ddev start to have the new command take effect. All good, thanks all!

@rfay
rfay merged commit ed48edd into ddev:master Jul 15, 2024
@rfay

rfay commented Jul 15, 2024

Copy link
Copy Markdown
Member

Thanks so much @nlighteneddesign ! Great idea, great implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants