Skip to content

fix(audit-action): retry, chunk and bound npm advisory requests - #17

Open
cherviakovtaskworld wants to merge 1 commit into
mainfrom
cherviakovtaskworld/audit-registry-retries
Open

fix(audit-action): retry, chunk and bound npm advisory requests#17
cherviakovtaskworld wants to merge 1 commit into
mainfrom
cherviakovtaskworld/audit-registry-retries

Conversation

@cherviakovtaskworld

Copy link
Copy Markdown
Contributor

The bulk advisory client made a single attempt with a 10s budget for the whole
prod closure in one body, so a transient registry 503 or a slow upload on a
loaded runner turned into a red CI check.

Extract the transport into registryClient.ts: retry 429/5xx/timeouts up to 4
times with exponential backoff (honouring Retry-After), split the payload into
chunks of 400 packages sent with a concurrency of 3, and bound the whole run by
a shared 120s deadline so a degraded registry cannot stall the CI step. Registry
unavailability now surfaces as RegistryUnavailableError and as a new
registry-unavailable output, so an infrastructure failure is distinguishable
from an audit failure.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

The bulk advisory client made a single attempt with a 10s budget for the whole
prod closure in one body, so a transient registry 503 or a slow upload on a
loaded runner turned into a red CI check.

Extract the transport into registryClient.ts: retry 429/5xx/timeouts up to 4
times with exponential backoff (honouring Retry-After), split the payload into
chunks of 400 packages sent with a concurrency of 3, and bound the whole run by
a shared 120s deadline so a degraded registry cannot stall the CI step. Registry
unavailability now surfaces as RegistryUnavailableError and as a new
registry-unavailable output, so an infrastructure failure is distinguishable
from an audit failure.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant