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

task: generate supported php version ranges for shopware #1

Merged
merged 8 commits into from
May 25, 2023

Conversation

cngJo
Copy link
Contributor

@cngJo cngJo commented May 23, 2023

Add a new generator to load all supported PHP versions for each shopware/platform version.

The data in the following format and gets generated based on the php semver constraint in composer.json for each version.

{
    "6.5.0.0": [
        "8.1",
        "8.2"
    ],
    // [...]
}

The change is made to have the data available in https://github.com/FriendsOfShopware/platform-plugin-dev-docker to specify which PHP versions we need to build for each Shopware release. See FriendsOfShopware/platform-plugin-dev-docker#25 for more details.

There is one small issue with this approach, but I think we can ignore that.
Older Shopware 6 versions had a very open PHP Version constraint like >=7.2 which allows all PHP versions after 7.2.
This seems to be fixed in shopware/platform with 6.4.0.0 and only affects older versions.

@cngJo
Copy link
Contributor Author

cngJo commented May 23, 2023

Updated the PR to include the built data from the changes in the script.

What kinda "hits" us here, is that older SW6 Versions have a very open PHP version constraint like >=7.2 which basically means that every PHP version after 7.2 is valid - which includes e.g. 8.x.

Not sure if this is even relevant, since the newer versions seem to handle the constraint correctly, like 6.5.0.0 depends on PHP ~8.1.0 || ~8.2.0.
If it's relevant, I guess we need to hard code the versions, since there is no (reasonable) way to change the PHP constraint for old SW 6 Versions.

@cngJo
Copy link
Contributor Author

cngJo commented May 23, 2023

Check Shopware-CLI for usages of this.

  • update Shopware-CLI
  • generate a different file to not brand old versions

@cngJo
Copy link
Contributor Author

cngJo commented May 24, 2023

Updated the code to not introduce a breaking change, since that would break shopware-cli which has a link to data/php-version.json built into the binary.

I've named the new file data/all-supported-php-versions-by-shopware-version.json to have a name that represents what's in there. But I'm open to change the file name when someone comes up with a better one ;)

@shyim shyim merged commit 77c7b14 into FriendsOfShopware:main May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants