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

Auto config breaks if project contains period . #367

Open
2 tasks done
IanEdington opened this issue Sep 13, 2024 · 5 comments
Open
2 tasks done

Auto config breaks if project contains period . #367

IanEdington opened this issue Sep 13, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@IanEdington
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Are you sure that this bug is related to this DDEV Integration Plugin?

  • I am sure

Enter your error report ID (If available)

No response

Describe the bug

I have a project called gpo.ca (the URL of the site I'm working on) in ddev is fine with me calling it that and sanitizes the name where necessary.

I installed this plugin to use the ddev interpreter in phpstorm. The auto load was awesome but appears not to have done the same sanitization.

I was receiving an error Failed to start docker-compose service, start it in a command line and retry and found that the issue was with COMPOSE_PROJECT_NAME=ddev-secure.gpo.ca.

In the ./.ddev/.ddev-docker-compose-full.yaml file the project name is ddev-securegpoca

Changing COMPOSE_PROJECT_NAME to ddev-securegpoca fixed my issue.

Steps to reproduce

No response

Additional context

No response

@IanEdington IanEdington added the bug Something isn't working label Sep 13, 2024
@rfay
Copy link
Collaborator

rfay commented Sep 13, 2024

docker-compose project names cannot contain a dot. DDEV removes the dot for compose project names. So COMPOSE_PROJECT_NAME must not have a dot and should be lower case.

This was all discussed in

for about 2 years. I guess maybe we have to look again @nico-loeber @AkibaAT ?

@IanEdington
Copy link
Author

Thanks for the speedy reply! And nice to meet you.

My understanding is that the referenced issue is about removing the envvar. From what I've read on some IntelliJ tickets, it's still needed.

The fix for me was to change the value of the envvar not remove it. I'll try removing it though and see if that also works.

@rfay
Copy link
Collaborator

rfay commented Sep 13, 2024

We decided that removing COMPOSE_PROJECT_NAME broke PhpStorm, because PhpStorm used it for an additional reason.

But I thought we had solved the "dot" problem elsewhere in PhpStorm.

@bofalke
Copy link

bofalke commented Oct 4, 2024

I took a look at this issue together with @edditor. The COMPOSE_PROJECT_NAME seems not to strip any dots or have any other sanitization. See the DockerComposeCredentialProviderImpl.java#L30. This seems not to cause any problems during the project setup, issues appear if you try to execute something inside the container via PHPStorm (e.g. PHPUnit).

I guess it should not be to much of a problem to update the COMPOSE_PROJECT_NAME to match the sanitization that is used by DDEV to generate the .ddev-docker-compose-full.yaml? DDEV seems to just strip the dots, check out the code here: ddevapp.go#L3209-L3210

edditor added a commit to edditor/ddev-intellij-plugin that referenced this issue Oct 4, 2024
@AkibaAT
Copy link
Contributor

AkibaAT commented Oct 21, 2024

Here's a test build with added period removal: ddev-intellij-plugin-0.0.1-dev.zip

Closed my PR after realizing there already was one doing exactly the same thing right above.

nico-loeber added a commit that referenced this issue Nov 24, 2024
Fix COMPOSE_PROJECT_NAME period issue #367
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants