Force installing the same version for all Symfony components during the CI #480
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While trying to understand why some end-to-end tests recently started to fail during the CI due to deprecation notices coming from some Symfony components, I found out that components from different versions are installed at the same time. For example, let's suppose that we want to test the compatibility of our lib with Symfony
3.4
: what the current GitHub Action workflow does is replacing the version of all entries that start withsymfony/
in thecomposer.json
with3.4.x
.sentry-symfony/.github/workflows/tests.yaml
Line 59 in 43cd505
However, this does not guarante at all that the dependencies of those packages are installed at that version too. In fact, Symfony components often declare their compatibility with older or newer versions as well, but there is no guarantee that no deprecation is thrown if you mix two major versions. With this PR, I'm installing Flex globally and then using the
SYMFONY_REQUIRE
environment variable we force the same version for all components. I also discovered that apparently the4.0
version of the SDK was uninstallable on Symfony3.4
in certain cases because we were requiringsymfony/psr-http-message:^2.0
which needs some components from Symfony4.x
instead, so I widened the Composer constraint to allow installing an older version of the package: this effectively allows installing our lib on a project that uses only components of the3.4
version