Cache per-version artifacthub response in Helm ecosystem - #1783
Merged
Conversation
versions_metadata and dependencies_metadata both fetched
/api/v1/packages/helm/{repo}/{name}/{version} for each new version,
so a package with N new versions made 1 + 2N artifacthub requests
per sync. At rate_limit=1 that still produced ~10 429/min because
each helm sync was making ~25 calls.
fetch_version_details memoizes the per-version response on the
ecosystem instance so both callers share one fetch, halving the
per-version request count to 1 + N. Errors are cached as nil so a
failed version fetch is not retried within the same job.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Helm#versions_metadataandHelm#dependencies_metadataboth fetched/api/v1/packages/helm/{repo}/{name}/{version}for each new version (once forcontent_url, again fordependencies), so a package with N new versions made1 + 2Nartifacthub requests per sync. Atrate_limit: 1that still produced ~10 429/min because each helm sync was averaging ~25 calls.fetch_version_detailsmemoizes the per-version response on the ecosystem instance so both callers share one fetch, halving the per-version request count to1 + N. Errors are cached asnilso a failed version fetch is not retried within the same job.