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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packagist service improvements #7783

Open
chris48s opened this issue Mar 28, 2022 · 0 comments
Open

Packagist service improvements #7783

chris48s opened this issue Mar 28, 2022 · 0 comments
Labels
developer-experience Dev tooling, test framework, and CI service-badge Accepted and actionable changes, features, and bugs

Comments

@chris48s
Copy link
Member

馃搵 Description

Refs #7782 (comment)

At the moment we are validating the response before applying the decompression. This means we have to accept missing values and __unset in the validation. A better approach would be to do something like I suggested in #6508 (comment) - decompress the response first then validate it. This would have two advantages:

  • It would allow us to clean up the schemas/validation - we can .require() the things that are required
  • It would make it easier to "fall into the pit of success" when working on this code. At the moment if we add a new packagist badge it is really non-obvious that we need to call expandPackageVersions() on the response and if the latest release is stable you probably won't notice anything off. This should be handled transparently in the base class (both for fetch() and fetchDev()).

There may also be some test cases that need updating for this

Additionally at the moment there is a single BasePackagistService class for both the v2 API and the cached API but really these are two different APIs. If we're going to go down the route of overriding _requestJson we'll need to split this into two base classes as the cached API doesn't return compressed responses, but maybe this would be clearer what is going on to split into two base classes anyway.

@chris48s chris48s added service-badge Accepted and actionable changes, features, and bugs developer-experience Dev tooling, test framework, and CI labels Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-experience Dev tooling, test framework, and CI service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

No branches or pull requests

1 participant