Automattic / vip-cli

The VIP CLI
https://docs.wpvip.com/vip-cli/
MIT License
58 stars 16 forks source link

Add retries to the fetching of jobs data #1909

Closed abdullah-kasim closed 2 months ago

abdullah-kasim commented 2 months ago

Description

We've received a few errors on this endpoint that can be mitigated by simply fetching the data again by retrying. The error is intermittent, and is likely because the endpoint returned a 500 - hence no longer a JSON and we could ignore it.

This PR adds retrying to the job fetch API safely - by limiting the retries only to this specific error. This is so that we don't accidentally retry on other errors such as rate limiting, or valid errors like permission errors!

Pull request checklist

New release checklist

Steps to Test

The unit tests should be fine - changes are pretty minor.

github-actions[bot] commented 2 months ago

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud