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

ConfigFileOverrideAction() should only override if no config exists yet, fixes #900 #964

Merged
merged 2 commits into from
Jul 5, 2018

Conversation

rfay
Copy link
Member

@rfay rfay commented Jul 2, 2018

The Problem/Issue/Bug:

#900 - ddev config incorrectly updates php version in some situations.

How this PR Solves The Problem:

ConfigOverrideAction() really should only override on a new config, and had only been used for D7 and D6. Both places it didn't work correctly.

It now only does its job if the config doesn't already exist.

Manual Testing Instructions:

Described in OP #900

Automated Testing Overview:

TestPostConfigAction() tests the expected behavior of ConfigFileOverrideAction().

Related Issue Link(s):

OP #900

@rfay rfay self-assigned this Jul 2, 2018
@rfay rfay requested a review from andrewfrench July 2, 2018 19:34
@rfay rfay added this to the v1.0.0 milestone Jul 2, 2018
@rfay rfay force-pushed the 20180702_config_respect_php branch from c30ffed to fa3a240 Compare July 3, 2018 13:57
@rfay rfay force-pushed the 20180702_config_respect_php branch from 30c3f74 to f4c9a53 Compare July 3, 2018 15:44

// testcommon.Chdir()() and CleanupDir() checks their own errors (and exit)
defer testcommon.CleanupDir(testDir)
defer testcommon.Chdir(testDir)()
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be what you intend, but these deferred calls won't be executed until after the entire test is complete (when TestPostConfigAction returns) and not at the end of the for block.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that pattern is used all over the place, it's just what we did back in the day. The cleanup after test completion is fine, it's all just about cleaning up the various crap directories.

Copy link
Contributor

@andrewfrench andrewfrench left a comment

Choose a reason for hiding this comment

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

cli   	v0.20.0-7-gf4c9a53d
web   	drud/nginx-php-fpm-local:v0.20.0
db    	drud/mariadb-local:20180630_mariabackup
dba   	drud/phpmyadmin:v0.20.0
router	drud/ddev-router:v0.20.0
commit	v0.20.0-7-gf4c9a53d
domain	ddev.local

Using the steps in #900, I was able to recreate the issue and overwrite the PHP version in config.yaml repeatedly.

After building this branch, specified PHP versions are preserved after multiple executions of ddev config.

@rfay rfay merged commit 57f8e86 into ddev:master Jul 5, 2018
@rfay rfay deleted the 20180702_config_respect_php branch July 5, 2018 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants