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

Use longer option names in install_db() to avoid stalling CIs #255

Conversation

@stevegrunwell
Copy link
Contributor

@stevegrunwell stevegrunwell commented Mar 26, 2020

Since some platforms (such as Travis CI) use empty passwords for the database user, passing an empty string for $DB_PASS can result in a TTY prompt, e.g.:

$ DB_USER=someuser DB_PASS="" mysql -u "$DB_USER" -p"$DB_PASS" -e 'show databases;'
Enter password:

In a CI environment, this can cause the entire pipeline to hang until cancelled.

This PR rewrites the call to use the longer option names (--user, --password, and --execute) to prevent empty passwords from being interpreted as "please ask me to provide my password in an interactive prompt."

Since some platforms (such as Travis CI) use empty passwords for the database user, passing an empty string for `$DB_PASS` can result in a TTY prompt, e.g.:

```
$ DB_USER=someuser DB_PASS="" mysql -u "$DB_USER" -p"$DB_PASS" -e 'show databases;'
Enter password:
```

This commit rewrites the call to use the longer option names (`--user`, `--password`, and `--execute`) to prevent empty passwords from being interpreted as "please ask me to provide my password in an interactive prompt."
@stevegrunwell stevegrunwell requested a review from wp-cli/committers as a code owner Mar 26, 2020
stevegrunwell added a commit to assertwell/wp-core-test-framework that referenced this pull request Mar 26, 2020
stevegrunwell added a commit to assertwell/wp-core-test-framework that referenced this pull request Mar 26, 2020
@schlessera schlessera changed the title Use the longer option names while creating the database Use longer option names in install_db() to avoid stalling CIs Apr 1, 2020
@schlessera schlessera changed the title Use longer option names in install_db() to avoid stalling CIs Use longer option names in install_db() to avoid stalling CIs Apr 1, 2020
@schlessera schlessera merged commit e52f050 into wp-cli:master Apr 1, 2020
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@dep
DEP All dependencies are resolved
@schlessera
Copy link
Member

@schlessera schlessera commented Apr 1, 2020

Thanks for the PR, @stevegrunwell !

@schlessera schlessera added this to the 2.0.9 milestone Apr 1, 2020
@stevegrunwell stevegrunwell deleted the stevegrunwell:fix/install-tests-with-empty-password branch Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants