The Maven dependency proxy API: cache miss path
When the Maven dependency proxy API receives a requests for a Maven package, we will have two paths:
- The package exists in the project's package registry and can be simply returned. (cache hit)
- The package doesn't exist and needs to be pulled (+ uploaded to the project's registry). (cache miss)
This issue is for (2.). Issue for (1.) is The Maven dependency proxy API: cache hit path (#410717 - closed).
We thus need here:
- HEAD the package on the external registry.
- We will need the service described below.
- compare the digest with existing packages.
- if the package doesn't exist, use the workhorse dependency proxy helper function to download + upload the package to the project package's registry. (see below).
🐴 The workhorse updates
For the dependency proxy for Maven packages, we're going to leverage an existing workhorse feature: #send_dependency
.
We will need to update that logic so that:
- We can set a custom Content type.
- We can set a custom authorize url.
- We can set a custom upload url.
- (We can set a custom content disposition).
All these updates should be options on the existing function. The existing behavior should not be impacted at all.
These options should be implemented on the workhorse side.
🔭 The Plan
From the investigation:
- Database model for the dependency proxy settings (#410714 - closed).
- The dependency proxy API skeleton for Maven pac... (#410721 - closed).
- The Maven dependency proxy API: cache hit path (#410717 - closed).
- API cache miss path. (
👈 this issue) - The dependency proxy settings GraphQL API (#410725 - closed).
- Dependency proxy for Maven: frontend changes (#410726 - closed).
- (Option) Dependency proxy for Maven: the prefill option (#410730 - closed).
- Document the dependency proxy for Maven (#410731 - closed).
Edited by David Fernandez