Repository navigation
Conversation
The repodata.json cooldown filter, the publish-time index, the sharded repodata index rewrite and shard filter, the timestamp rule and the filename parser move from internal/handler to internal/metadata/conda, which takes its inputs explicitly and doesn't depend on handler.Proxy. The repodata filter still streams. Fetching, caches, ETag reuse, size bounds and the zstd framing of shards stay in the handler, whose function names remain as thin wrappers. Shards are now checked with Evaluate at one EvaluatedAt per shard instead of IsAllowed per record, as repodata already was.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Part of #501, the Conda step.
As in #612 for npm, the Conda metadata transformations move out of
internal/handlerintointernal/metadata/conda:NewFilterandFilter.Copy, the streaming repodata.json filter that leaves out entries inpackagesandpackages.condastill in cooldown and writes everything else with its upstream bytes.WithheldandUntilreport what it left out and when the first of those leaves cooldown, which the handler uses to reuse the filtered copy's ETag.ReadIndex, which maps each package file to its timestamp for download checksDecodeShardIndex,ShardIndex.ShardsLayout,RewriteShardIndexandFilterShardfor sharded repodata (CEP 16), withShardMaskandIsShardFile. They take and return the decompressed msgpack; the zstd framing stays in the handler.Time, which reads a repodata timestamp as seconds or milliseconds, andFilenameIdentityThe package takes its inputs explicitly in
Options: the cooldown policy and the time cooldown is evaluated at. It reports each package file cooldown leaves out throughOnCooldownFilter, which the handler logs as before. It doesn't depend onhandler.Proxy.What stays in the handler: fetching, the metadata cache, the filtered copy's ETag, the decompressed size bound, gzip and zstd, routes and downloads. The handler's function names stay as thin wrappers, so the handler tests run unchanged against the real routes.
internal/mirrorstill callshandler.CondaFilenameIdentity, to keep this PR off the import block #803 changes.Shards are now checked with
Evaluateat oneEvaluatedAtper shard instead ofIsAllowedper record, as repodata already was. The handler passestime.Now(), so results are the same unless a shard is filtered across a cooldown boundary.TestCooldownSupportedCoversHandlersalso readsinternal/metadata, the same change as in #804.Portability:
GOOS=wasip1 GOARCH=wasm go build ./internal/metadata/condaworks.imports_test.gofails on any non-standard import outside an allowlist (cooldown, purl, vers, packageurl-go,internal/packageurl,internal/jsonstream, and vmihailenco/msgpack with tagparser) and onnet,net/http,log/slogordatabase/sql.Benchmarks (
internal/handler, main vs this branch, on a generated 23 MB repodata.json with 60,000 entries since the real-data benchmarks needCONDA_REPODATA_BENCH, test binaries run alternately, n=8, medians):Bytes and allocations per op are unchanged within a few allocations.
New tests in
internal/metadata/condacover the filter with cooldown evaluated atEvaluatedAt, upstream bytes kept, entries without a name or timestamp, the callback, the withheld digest andUntil, and a disabled or missing policy; the index reader; the shard index layout checks, the rewrite and its refusals; the shard filter with integer and float timestamps; and the timestamp rule and the filename parser. They were mutation-checked, as was the handler's wiring.go test ./...andgolangci-lint run ./...pass.