symfony / recipes

Symfony Recipes Repository
https://github.com/symfony/recipes/blob/flex/main/RECIPES.md
MIT License
953 stars 472 forks source link

Use "resolve" processor for MAILER_DSN env variable #1294

Closed leonboot closed 2 months ago

leonboot commented 4 months ago
Q A
License MIT

For the Doctrine bundle, the DATABASE_URL variable is processed by the resolve env var processor. This is nice, since the value can be read from file by using the file processor when defining its value, for instance. It would be nice if this would be applied to the MAILER_DSN for the Symfony Mailer as well, for the same reasons.

github-actions[bot] commented 4 months ago

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1294/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1294/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'symfony/mailer:^4.3'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. I'm going keep this comment up to date with any updates of the attached patch.

leonboot commented 4 months ago

It seems the "Run updated recipes" job fails because the package version to install is distilled from the modified files of the PR, but symfony/mailer:^4.3 can't be installed because of its dependency on symfony/event-dispatcher.

Offering an updated PR by creating a 5.0 version of the recipe will probably still break the v6 test. And the change provided in this PR will still work for Symfony 4 as far as I can tell, since the resolve processor is already available there.

nicolas-grekas commented 3 months ago

Hi, I'm not sure I understand the motivation for this change. What's the relation to the file processor?

fabpot commented 2 months ago

Closing as there is no more feedback.

leonboot commented 1 month ago

Looking at the documentation again, this may have been a result of misinterpretation on my part. I believed the resolve: env var processor would allow for using other env var processors in the env var's value (like file:DATABASE_URL_FILE, for instance). But looking at the docs, the resolve processor only resolved %variable% notations.