Skip to content

Shorten Symfony Recipe URL Cache Keys#831

Merged
nicolas-grekas merged 1 commit intosymfony:1.xfrom
cjunge:main
Nov 22, 2021
Merged

Shorten Symfony Recipe URL Cache Keys#831
nicolas-grekas merged 1 commit intosymfony:1.xfrom
cjunge:main

Conversation

@cjunge
Copy link
Copy Markdown

@cjunge cjunge commented Nov 21, 2021

Fixes #830.

This change replaces the simple generated composer filesystem cache key with a slightly shorter one only for the Symfony Recipes repos.

/home/cameron/.cache/composer/repo/flex/https---api.github.com-repos-symfony-recipes-contrib-contents-friendsofsymfony.elastica-bundle.5.0.json-ref-flex-main
becomes
/home/cameron/.cache/composer/repo/flex/sf-recipes-contrib-friendsofsymfony.elastica-bundle.5.0.json-ref-flex-main

This won't fix other recipe files hosted on long paths.

@cjunge
Copy link
Copy Markdown
Author

cjunge commented Nov 21, 2021

The failing tests appear to be due to an API change in Composer, unrelated to my code changes. Should I fix these?

        $realPkg = new Package('real', '1.0.0', '1.0.0');
        $realPkgLink = new Link('lorem', 'real', class_exists(MatchAllConstraint::class) ? new MatchAllConstraint() : null, 'wraps', '1.0.0');

        $virtualPkgFoo = new Package('pack_foo', '1.0.0', '1.0.0');
        $virtualPkgFoo->setType('symfony-pack');
        $virtualPkgFoo->setRequires([$realPkgLink]);
        $realPkg = new Package('real', '1.0.0', '1.0.0');
        $realPkgLink = new Link('lorem', 'real', class_exists(MatchAllConstraint::class) ? new MatchAllConstraint() : null, 'wraps', '1.0.0');

        $virtualPkgFoo = new Package('pack_foo', '1.0.0', '1.0.0');
        $virtualPkgFoo->setType('symfony-pack');
        $virtualPkgFoo->setRequires(['real' => $realPkgLink]);

Comment thread src/Downloader.php Outdated
Comment thread src/Downloader.php
@nicolas-grekas nicolas-grekas changed the base branch from main to 1.x November 22, 2021 18:19
@nicolas-grekas nicolas-grekas changed the title 830: Shorten Symfony Recipe URL Cache Keys Shorten Symfony Recipe URL Cache Keys Nov 22, 2021
@nicolas-grekas
Copy link
Copy Markdown
Member

Thank you @cjunge.

@nicolas-grekas nicolas-grekas merged commit acd0b50 into symfony:1.x Nov 22, 2021
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.

File name too long

3 participants