Extract common parts of the Maven dependency proxy
All threads resolved!
All threads resolved!
Compare changes
In Maven dependency proxy (&3610 - closed), we implemented and delivered the Maven dependency proxy. Read about it here: https://docs.gitlab.com/ee/user/packages/package_registry/dependency_proxy/.
We are now starting working on npm Virtual Registry MVC: Single Upstream and A... (&3608) which is exactly the same features set (GitLab acting as a pull through cache) but for the NPM package format.
The Maven dependency proxy has some interactions with the Package Registry as it uses it as a cache location (see https://docs.gitlab.com/ee/user/packages/package_registry/dependency_proxy/#advanced-caching). This is the core behavior of the dependency proxy for packages that we will need to implement for NPM.
To avoid a massive code duplication, in this MR, we're going to extract all the common logic that will be used by both dependency proxies.
This is preparatory work for the implementation of NPM dependency proxy: implement the download tg... (#435644 - closed) and later.
If you're interested to see these changes + the first step for the NPM proxy, see NPM dependency proxy tgz download file endpoint (!144320 - merged). If we look at the ee/lib/api/dependency_proxy/packages/npm.rb
, we only need 100 lines to implement the first endpoint of the NPM dependency proxy
DependencyProxy::Packages::Maven::VerifyPackageFileEtagService
to DependencyProxy::Packages::VerifyPackageFileEtagService
as this service is part of the caching logic and is not really tied to a package format (and we're going to use for NPM too).
No changelog here as this is a pure code extract with no impact on the existing Maven dependency proxy behaviors. If there is an impact, that will be considered as a typebug.
We are quite confident in this refactoring as the maven dependency proxy is covered by a pretty large requests spec and a feature spec (which also checks all the
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
No changes in the UI
Follow https://docs.gitlab.com/ee/user/packages/package_registry/dependency_proxy/