AC: use a RootDirectoryDigest for directory assets#40
AC: use a RootDirectoryDigest for directory assets#40tomcoldrick-ct merged 2 commits intobuildbarn:masterfrom
Conversation
|
As mentioned in #34 (comment), this is not supported on the bb-storage side, due to it not permitting ActionResults that only have |
7f13ebe to
eabe6bb
Compare
|
I guess to fix the blobs-that-unmarshall-as-directories-but-are-not bug whilst still setting Uploading an digest that does not reference a valid directory with |
eabe6bb to
cfc8493
Compare
|
See the latest commit which adds back the TreeDigest logic |
eb1f2ba to
cdfd4e0
Compare
tomcoldrick-ct
left a comment
There was a problem hiding this comment.
Could you squash the history down a little please? You should probably drop my commit altogether since this is essentially solving the problem entirely differently and just adds churn to the history.
064a7d9 to
fd11132
Compare
tomcoldrick-ct
left a comment
There was a problem hiding this comment.
You should probably change the author on the first commit -- it should be you! Other than that, this looks good to me.
bb-remote-asset does some cleverness to pop `Directory` objects into the OutputDirectories field of the ActionResult for semantic purposes. This commit cleans up that cleverness to allow blobs that look a bit like directories to be uploaded as asset. Prior to this commit we detected whether an object is a `Directory` by fetching it from CAS and attempting to unmarshal it into a `Directory` message. This commit requires all assets uploaded via `PushDirectory` are `Directories` (and treats assets uploaded via `PushBlob` as blobs). We still must convert Directories to a Tree to generate the `TreeDigest` needed by the `ActionResult`, so the action cache asset store will fetch from the CAS when putting a new directory. (The ActionResult needs a `TreeDigest` to satisfy bb-storage's completeness checking.) If the client decides to use `PushDirectory` to push something that isn't a `Directory` (which isn't explicitly banned by the spec), then we will error. The client will need to use `PushBlob` for these assets instead. Fixes buildbarn#33 Closes buildbarn#34
fd11132 to
5f8b6c1
Compare
Done! |
Which means we avoid needing to calculate TreeDigest`s whilst still
creating Actions/ActionResults that encode that an asset is a directory.
Note: the bb-remote-asset server does not validate that the
RootDirectoryDigest actually references a Directory proto because
bb-remote-asset treats the digest as an opaque digest.
This superseeds #34 based on the plan I wrote here #34 (comment).
Closes #33, #34