recipes icon indicating copy to clipboard operation
recipes copied to clipboard

[doctrine-bundle] v. 2.4 file does not exists `docker-compose.yml`

Open Chris53897 opened this issue 2 years ago • 6 comments

I get the warning that the file does not exists docker-composeyml. (Missing .). Mac M1. The file docker-compose.yml does exist in my project. As it is correct in https://github.com/symfony/recipes/blob/b3395a2477b6d58089f92ef3a0d2e58226825a3a/doctrine/doctrine-bundle/2.4/manifest.json it is maybe a problem of the system itself?

`composer recipes:update doctrine/doctrine-bundle Updating recipe for doctrine/doctrine-bundle...

Yes! Recipe updated!

The recipe was updated but with one or more conflicts. Run git status to see them. After resolving, commit your changes like normal.

NOTE: The file docker-composeyml was not updated because it doesn't exist in your app.

Would you like to save the "diff" to a file so you can review it? (Y/n) Y

Saved diff to doctrine.doctrine-bundle.updates-for-deleted-files.patch

  • [doctrine-bundle] Upgrade to Postgres 14 and MySQL 8 (PR https://github.com/symfony/recipes/pull/1115) `

P.S. The post-install notice should be updated to postgres 14 as well. https://github.com/symfony/recipes/blob/b3395a2477b6d58089f92ef3a0d2e58226825a3a/doctrine/doctrine-bundle/2.4/post-install.txt

Maybe this Line too. https://github.com/symfony/recipes/blob/main/doctrine/doctrine-bundle/2.4/config/packages/doctrine.yaml#L7

Chris53897 avatar Aug 23 '22 08:08 Chris53897

As you said, this is a warning and not an error. The docker-compose.yml file is not needed all the time. And for the doctrine.yaml file, the line is commented and as indicated above it is better to configure in the variable DATABASE_URL : https://github.com/symfony/recipes/blob/main/doctrine/doctrine-bundle/2.4/config/packages/doctrine.yaml#L5-L6

maxhelias avatar Aug 23 '22 08:08 maxhelias

But the file docker-compose.yml is changed for this recipe update. https://github.com/symfony/recipes/pull/1115/files#diff-165a659908533726dd8891a603861852a2dbb90d0cb5cd90045f1723acfe3e18

Chris53897 avatar Aug 23 '22 08:08 Chris53897

Do you use docker and docker-compose on your project?

maxhelias avatar Aug 23 '22 09:08 maxhelias

Yes

Chris53897 avatar Aug 23 '22 10:08 Chris53897

So you should have a docker-compose.yml file at the root of your project. See more info : https://symfony.com/doc/current/setup/docker.html#flex-recipes-docker-configuration

maxhelias avatar Aug 23 '22 13:08 maxhelias

Please see above The file docker-compose.yml does exist in my project. I guess that symfony/flex has an error with detect the correct filename. docker-composeyml vs docker-compose.yml

Maybe i am wrong. But the console output does say that.

Chris53897 avatar Aug 23 '22 13:08 Chris53897

I tried to upgrade from Symfony 6.2 to 6.3. The problem still exists. I already have a docker-composer.yml in the project root. Fortunatly a diff file is (or can be) created. But this also contains the filename without dot. Maybe someone has an idea why this happens.

diff --git a/docker-composeyml b/docker-composeyml
index 8aa1121..1067b9c 100644
--- a/docker-composeyml
+++ b/docker-composeyml
@@ -3,19 +3,19 @@ version: '3'
 services:
 ###> doctrine/doctrine-bundle ###
   database:
-    image: postgres:${POSTGRES_VERSION:-14}-alpine
+    image: postgres:${POSTGRES_VERSION:-15}-alpine
     environment:
       POSTGRES_DB: ${POSTGRES_DB:-app}
       # You should definitely change the password in production
       POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
       POSTGRES_USER: ${POSTGRES_USER:-app}
     volumes:
-      - db-data:/var/lib/postgresql/data:rw
+      - database_data:/var/lib/postgresql/data:rw
       # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
       # - ./docker/db/data:/var/lib/postgresql/data:rw
 ###< doctrine/doctrine-bundle ###
 
 volumes:
 ###> doctrine/doctrine-bundle ###
-  db-data:
+  database_data:
 ###< doctrine/doctrine-bundle ###%

mahono avatar Jul 29 '23 07:07 mahono

This must be a general issue. I also get it when upgrading the symfony/mailer recipe. It then says:

The file docker-composeoverrideyml was not updated because it doesn't exist in your app.

For some reason, all dots are removed from the file name.

So, I suppose the recipe update system is broken.

mahono avatar Jul 29 '23 08:07 mahono

yea, that's super weird. It, indeed, looks like something with the recipe update system is losing the . in some cases... and only under some conditions. I believe the diff you posted is generated here - https://github.com/symfony/flex/blob/2.x/src/Update/RecipePatcher.php#L109 - so it's generated FROM git, so it's hard to imagine how it would generate a diff that's missing the . in the filenames... and this is so rarely reported, it makes me think that it works on most systems, but breaks on just a few.

EDIT: Nevermind, I see this locally as well...

weaverryan avatar Jul 31 '23 20:07 weaverryan

Fixed at https://github.com/symfony/flex/pull/987

weaverryan avatar Aug 01 '23 19:08 weaverryan

Thanks @weaverryan

Chris53897 avatar Aug 01 '23 19:08 Chris53897