Vendor upstream URL parsing to simplify internal config#209
Merged
kylebarron merged 3 commits intomainfrom Feb 4, 2025
Merged
Conversation
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.
Because
urlhas deferred parsing in theobject_storebuilders, we need to special-caseurlhandling. Naturally, passingurlto a store withwith_urlmeans thatobject_storedoesn't actually parse the URL until thebuild()method, and at that point we can no longer access config information from the builtAmazonS3. Without special-casing this URL handling, pickling would fail for instances created fromfrom_url.Therefore, we handle this by vendoring the small amount of URL parsing from upstream. So we apply the URL parsing onto our config
HashMaps and then apply those to the builder. So our configs and those used by the raw stores stay in sync.We originally stored the
urlseparately, but that meant that the bucket name was stored in up to three different places (bucketvariable, in theurl, and in the config). This simplifies the internal config by ensuring we only store each piece of config data in only one place.