Added Symfony serverless workflows #99
Merged
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.
Resources:
https://symfony.com/doc/5.4/setup/flex_private_recipes.html
https://symfony.com/blog/symfony-flex-is-going-serverless
Relevant part:
This PR adds the workflows used in
symfony/recipes
repository:https://github.com/symfony/recipes/blob/master/.github/workflows/flex-update.yml
It calls this workflow: https://github.com/symfony/recipes/blob/main/.github/workflows/callable-flex-update.yml
which parses the recipes and creates proper files so that they can be accessed by Flex - it's pushed to the
flex/main
branch.You can see that Symfony adds an additional argument, versions_json: https://github.com/symfony/recipes/blob/master/.github/workflows/flex-update.yml#L13-L17 This file (https://github.com/symfony/recipes/blob/master/.github/versions.json#L8 ) is used only for Symfony packages and automatically defines aliases for their packages (see: https://github.com/symfony-tools/recipes-checker/blob/86f5d7f8c12b8fa3faeadc5a5652aba1b2e369d2/src/GenerateFlexEndpointCommand.php#L44-L54)
https://github.com/symfony/recipes/blob/master/.github/workflows/flex-update-achived.yml
This is required for the
recipes:update
command to work. See:symfony/flex#857
symfony/recipes#1038
symfony-tools/recipes-checker#3
symfony/flex#845
Symfony has chosen manual trigger for now - this is fine, because it's a fallback in case something goes wrong in the update workflow and allos to rebuild the archive if needed. It's not needed on every push, because the archive should be updated during the update workflow (see "How it works" in symfony/flex#845 - symfony/recipes#1037 is the relevant PR that includes it in the
flex-update
workflow.Other changes that are needed:
--force
switch does not work for the official recipes as we're used to, see Fixed not working "--force" option if you want to reinstall a recipe symfony/flex#702 (and the updated --force description: https://github.com/symfony/flex/pull/714/files)To execute the recipe once again we need to use the
--force
option combined with--reset
option.PR: symfony/flex#795
So, we will have to replace the mentions of
composer recipes:install <edition> --force
in manual installation doc withcomposer recipes:install <edition> --force --reset
. Same for nightly and other tools.Migrations process
Added Symfony serverless workflows #99
[Composer] Allowed using symfony/flex v2 oss#44
https://flex.ibexa.co
tohttps://api.github.com/repos/mnocon/recipes/contents/index.json?ref=flex/main
- this way we don't have to change the value in https://github.com/ibexa/website-skeleton/blob/3.3/composer.json#L98We can do 1 and 2 right now, to test things - these steps are just preparation, only after step 3 our current solution (private Flex server) can be disabled and the new one will start working.
Testing process
If you'd like to see it in action locally you can use:
https://github.com/mnocon/website-skeleton/ (which uses our new endpoint endpoint: https://github.com/ibexa/website-skeleton/blob/3.3/composer.json#L98).
Install running:
Generated recipes:
https://github.com/ibexa/recipes/tree/flex/main
https://github.com/ibexa/recipes/blob/flex/main/index.json
Remember about the
--reset
flag during manual installation.