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

feat: POC for ddev config --update #6053

Conversation

penyaskito
Copy link
Member

@penyaskito penyaskito commented Apr 5, 2024

The Issue

How This PR Solves The Issue

For supporting discussion on #6035.

If we end up going this path I'd create a cleaner PR.

Manual Testing Instructions

Automated Testing Overview

Related Issue Link(s)

Release/Deployment Notes

@rfay
Copy link
Member

rfay commented Apr 5, 2024

WOW!

Copy link

github-actions bot commented Apr 5, 2024

@rfay rfay changed the title POC for ddev config --update feat: POC for ddev config --update Apr 5, 2024
cmd/ddev/cmd/config.go Outdated Show resolved Hide resolved
apptypeMsg := fmt.Sprintf("Apptype is %s", app.Type)
output.UserOut.Print(apptypeMsg)

if app.Type == nodeps.AppTypeDrupal {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you should need to mention specific project types here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it was only for debugging purposes when I did that. I just thought that we might want to take this chance to change apptype drupal8, drupal9, drupal10 to drupal if we find those.

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

The way I was thinking about this was that it would just be like any other config action (including --auto), except that it would not respect existing config. The key there is one line IIRC. Will take a look.

@rfay
Copy link
Member

rfay commented Apr 5, 2024

I think the fundamental difference is shown in

Essentially we need to do what it was doing before that... but only on update?

@penyaskito
Copy link
Member Author

Essentially we need to do what it was doing before that... but only on update?

Oh right I was accidentally hit by that one! Makes sense, it would be probably cleaner.

One question I have if we go either path is: should we really change db? That might be dangerous. Even if I don't think data loss could happen, people might not find their data if the db versions change. I suggest if a change in db is found, we leave it as is and provide instructions on updating/migrating it.

if appFuncs, ok := appTypeMatrix[app.Type]; ok && appFuncs.configOverrideAction != nil && !app.ConfigExists() {
// of config.yaml that it needs to
func (app *DdevApp) ConfigFileOverrideAction(overrideExistingConfig bool) error {
if appFuncs, ok := appTypeMatrix[app.Type]; ok && appFuncs.configOverrideAction != nil && (overrideExistingConfig || !app.ConfigExists()) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@rfay Even if we go the other path, we probably still need this.

Copy link
Member

Choose a reason for hiding this comment

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

Absolutely

@rfay
Copy link
Member

rfay commented Apr 5, 2024

if we go either path is: should we really change db

We should not change database type or version. It would make people crazy. Thanks for paying attention to this.

I see that this would affect CraftCMS, which really wants MySQL 8.0. But I don't see why we'd change existing.

I see drupal8/9 have override to mariadb:10.4, but I don't think those belong in there in the first place? Why would we not use defaults?

Silverstripe is probably a mistake. @GuySartorelli should we be overriding database type and version in

app.Database.Type = nodeps.MariaDB
app.Database.Version = nodeps.MariaDB104
? For that matter, should we even have silverstripeConfigOverrideAction or should it be removed?

@penyaskito
Copy link
Member Author

@rfay I've created #6055. It's definitively cleaner that way. I'll leave this one open still in case we want to keep these conversations here, but feel free to close it if you feel so.

@rfay
Copy link
Member

rfay commented Apr 5, 2024

Closing just to avoid confusion, can be reopened.

@rfay rfay closed this Apr 5, 2024
@GuySartorelli
Copy link
Collaborator

I recognise this was closed but just answering what was asked:

Silverstripe is probably a mistake. @GuySartorelli should we be overriding database type and version in? For that matter, should we even have silverstripeConfigOverrideAction or should it be removed?

I'm a bit removed from the workflow of someone who uses Silverstripe CMS to make websites - my workflow is very specific to the maintenance work I do so I'm not sure whether this would be a useful or harmful.

It is worth noting that there have been a few discussions about how DDEV overrides values in .env (e.g. database name, user, and password) which some people have found to disrupt their preferred workflow. I think that's a separate concern, but worth mentioning. I actually explicitly avoid using the "silverstripe" project type because of it.

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.

None yet

3 participants