Maven VReg: use cached response if upstream in unavailable
What does this MR do and why?
In Maven virtual registry MVC (API only interactions) (&14137 - closed), we send a head request to the upstream in order to validate the cached response. In case of this head request raises an exception for any reason, we can fall back to the existing cached response instead of returning an error.
References
Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
- Follow these steps to create a cached response.
- Disconnect your Wi-Fi to simulate a broken head request.
- Try to pull the cached response again:
The cached response should be successfully returned. On master, an error is going to be returned.
curl -L --header "Private-Token: <PAT>" "http://gdk.test:3000/api/v4/virtual_registries/packages/maven/<r.id>/org/springframework/spring-web/6.1.12/spring-web-6.1.12.pom"
Related to #480360 (closed)