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

fix: don't call app.WriteConfig twice #5923

Merged
merged 1 commit into from Mar 7, 2024

Conversation

rfay
Copy link
Member

@rfay rfay commented Mar 1, 2024

The Issue

@ajibarra points out in

that the PostConfigAction is being called twice. It's being called twice because when ddev config is called with args, the WriteConfig() happens both inside handleMainConfigArgs() and also in the parent handleConfigRun. It should only be called once.

How This PR Solves The Issue

  • When ddev config is called without args, we do the WriteConfig() in its context
  • When called with args, let handleMainConfigArgs() do the write

Manual Testing Instructions

I think it requires debugger or adding a print statement, but just add a print statement to a PostConfigAction or to WriteConfig.

Automated Testing Overview

Related Issue Link(s)

Release/Deployment Notes

Copy link

github-actions bot commented Mar 1, 2024

@rfay rfay marked this pull request as ready for review March 2, 2024 13:50
@rfay rfay requested a review from a team as a code owner March 2, 2024 13:50
@rfay
Copy link
Member Author

rfay commented Mar 2, 2024

This could also be done with the opposite logic.

@rfay rfay requested a review from stasadev March 2, 2024 13:50
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

Tested, this is fine.

@rfay rfay merged commit 8da86ea into ddev:master Mar 7, 2024
23 checks passed
@rfay rfay deleted the 20240301_writeconfig_called_twice branch March 7, 2024 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants