php-tuf / composer-integration

PHP-TUF Composer Plugin.
7 stars 5 forks source link

Remove the need to append `/targets` to the Composer repository URL #86

Closed phenaproxima closed 1 year ago

phenaproxima commented 1 year ago

There is a kludge in this plugin which was placed there to get around an opinion of the Python tool we use to generate our test fixture. If we shuffle the fixture around, we can remove that -- and indeed, we must, because real production TUF servers won't necessary prefix the targets with /targets.

This is an example of a small change which has outsized effects, because the way this repo generates its fixtures (and the way the tests use them) is very specifically tied to a particular layout. So if I change the layout, I have to change a lot of other stuff too. Because that's so painful to do, this also tries to clean the changes up - for example, test-project is now tests/client, which IMHO is clearer.

The main change here is in TufValidatedComposerRepository, where I remove the unconditional suffixing of the repo URL with /targets. But then I also moved the fixture generation into a more coherent set of directories, which necessitated changes in composer.json, GitHub Actions config, and generate.py to ensure the fixtures can still be generated.