-
-
Notifications
You must be signed in to change notification settings - Fork 585
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: avoid type: php
to detected project type but instead show a warning, fixes #4403, fixes #1919
#5011
Conversation
Download the artifacts for this pull request:
See Testing a PR |
2c81c2a
to
121f225
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work as specified, but still emits the message:
You have specified a project type of 'php' but a project of type 'drupal9' was discovered in /home/rfay/workspace/d9/web
- is that intended? (Edit: I see from the title that it is intended.)
However, if you use the simple ddev config
command, it discovers the docroot and then switches to the discovered type. That's not what you want is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for solving this problem.
It looks to me like this mostly solves the problem, except that it doesn't respect existing with ddev config
interactive configuration.
Could we use none
for the no-project-type option? Have a better idea?
The ddev config --project-type
would then have to take "none", but I imagine it already would with GetAppTypes() having the listed items.
Docs will need update to explain the situation of "none"; I'm pretty sure they say "php" is the default.
Don't forget that "none" in a python or django4 project would be controlled by webserver_type and may be a bit different.
@@ -82,6 +82,7 @@ var ValidNodeJSVersions = []string{"14", "16", "18", "20"} | |||
|
|||
// App types | |||
const ( | |||
AppTypeNone = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be better as "none", not sure. Hate empty values like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an internal thing which never gets saved to the config, so value is not important here but we can change it to none if you prefer.
type: php
to detected project type but instead show a warning, fixes #4403, fixes #1919
Have to check interactive config again... |
Will check again...
No, like explained above
|
Interactive config works for me so far. Can you please explain your exact case a bit more @rfay ? |
Here's interactive config with it changing the project type from
|
Got it now. Okay, we have to discuss the desired behavior then. At the moment the discovered project type is suggested during interactive setup but the user can change it again to another type. To me this looks fine but well, one could have an other opinion. I'm open for both ways... |
121f225
to
c7621a4
Compare
type: php
to detected project type but instead show a warning, fixes #4403, fixes #1919type: php
to detected project type but instead show a warning, fixes #4403, fixes #1919
c7621a4
to
62cce53
Compare
62cce53
to
f1bc8f0
Compare
Rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me, did manual testing again. Thanks!
The Issue
ddev config
automatically changes a project type from 'php' to the discovered codebase type #4403How This PR Solves The Issue
If an app type was set already before running
ddev config
it won't longer be overwritten by the detected app type but a warning is shown to let the user know about. The only way to change the type config is to provide a new value using--projecttype
flag.Not implemented so far but could be an option to allow the type
auto
to enforce the value from the detection. But to me this currently looks superfluous.Manual Testing Instructions
Use
ddev config --projecttype=...
with an other type than already specified in the project. This should set the new value and not using the auto detected type.Automated Testing Overview
No new tests are introduced.
Related Issue Link(s)
Release/Deployment Notes