Repository navigation
Read virtual chunk containers from config.yaml for v1 repositories - #31
Merged
Merged
Conversation
Collaborator
Author
|
Mostly written by claude; merging as is (already had an adversarial review, doesn't change behavior for v2 stores and fixes it for v1 stores). |
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.
A v2 repository keeps its config in the
repofile, and since #27 its virtual chunk containers (URL prefix, S3 region, endpoint, path style) decide how ans3://chunk location becomes an HTTPS URL. A v1 repository keeps the same config inconfig.yaml, which was never read, so v1 sessions ran with no containers.For a bucket with a dot in its name that means path-style addressing on the global endpoint,
https://s3.amazonaws.com/<bucket>/<key>. Outsideus-east-1that answers with a 301 that carries no CORS headers, so a browser cannot read the chunk even when the bucket's CORS is set up correctly. Node follows the redirect, which is why this only shows up in browsers. It came up opening the ISMIP6 store on source.coop (us-west-2.opendata.source.coop, spec v1) in gridlook.What changes
checkoutBranch,checkoutTagandcheckoutSnapshotreadconfig.yamland give the session its containers, as the v2 path already does. The read runs alongside the ref lookup and is cached perRepository.src/format/config-yaml.tsreads thevirtual_chunk_containerssection and hands it to the same code that reads the v2 config, so both formats produce the same containers.Behaviour changes for v1 repositories
endpoint_url, region or path style now has its virtual chunks addressed that way, matching v2. Two integration tests encoded the old URL (testbucket.s3.amazonaws.com) for the v1 fixture and now expect what the v2 test already expected (localhost:4200/testbucket).config.yaml, so opening it in a browser logs a 404 (403 on an S3 bucket that cannot be listed).vcc://names are checked. With containers present, avcc://name/...location whose name is unknown is an error, as in v2.v2 repositories are unaffected and never request
config.yaml.The config.yaml reader
It handles nested
key: valuemappings, plain and quoted scalars, the!s3/!s3_compatible/!tigrisstore tags, and the? key/: valueform Icechunk writes for a key longer than 128 characters. Anything else in the section (a sequence, a comment, a block or flow value, a double-quoted escape JSON lacks) makes it report no containers for that config.To check it against real output, 69 configs were written with Python icechunk 1.1.18 (dotted buckets, spaces, quotes, unicode,
#,:, values such asnull/yes/1as strings, long keys, mixed store types) and compared with the containers Icechunk itself reports: 64 match exactly, 5 are read as no containers (prefixes or regions holding control characters or a line break), none is read wrongly.Failure handling
config.yaml(404, or 403 from S3): no containers, cached.Testing
npm test: 452 passed, 2 skipped (was 432 passed).typecheck,format:checkandbuildare clean.repofile of the same repository after upgrade (test-repo-v2-migrated).s3.us-west-2.amazonaws.comdirectly.Not in this PR
Repositorycan each fetchconfig.yaml. Sharing the in-flight request would let one caller's abort fail another's checkout, so it is left as a duplicate request.