Idea: Add a reference for linking to recipes
weaverryan opened this issue · 6 comments
Sometimes we link to a file in a recipe. That's pretty easy - it's just a link to a file on GitHub. Except for one interesting complication. For example, on Symfony 4.1, if I want to link to a file in the FrameworkBundle recipe, I need to link to the 3.3 directory (e.g. https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/3.3/config/bootstrap.php). But on 4.2, suddenly there is a new recipe and so a new directory (e.g. https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/4.2/config/bootstrap.php).
This is a perfect example of something that we should not need to handle by hand, and in fact IF we handle it by hand, we will eventually mess it up (e.g. forget to update the URLs when there is a new recipe for Symfony 4.3).
what do you recommand?
we could test if recipe for current version exists (i.e. https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/4.1/config/bootstrap.php returns 200)
and if not, we iterate on each lower version, until we find one which is working
but that sounds a little bit cumbersome
I think it probably must work like that. At least it’s during the build process only? Maybe we (during the build) clone the recipes repo into a tmp dir?
Hmm, or possibly there may be a Flex endpoint that would give some info...
how could we know ?
Yea, I’m not sure the Flex api is technically public. So probably not a good option