Update Directory
artifacts to use blobs
#7
Merged
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.
This PR updates how
Directory
artifacts are represented: rather than storing a map of file/entry names, it now stores a blob ID (much like a file artifact does). The blob referred to by this ID will then contain a (canonicalized) JSON payload that can be deserialized into aDirectoryListing
structure (which in turn, contains a map of file/entry names).This new representation was inspired by Git's representation of directories, which internally use "directory tree objects", or plain text files listing the other objects making up the directory's entries (I found the "inside .git" zine especially helpful for understanding this!)
I was hoping this new implementation would be noticeably faster. While testing did show some improvements in some areas, it was only on a scale of 10-100ms or so. The main reason I pressed forward with this implementation anyways was because I felt like introducing this layer of indirection was a bit cleaner, and could make some future work easier (hopefully, anyway!)