-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remote Asset API: clarification about Qualifier #301
Comments
Nitpicking: COULD is not part of RFC 2119. https://datatracker.ietf.org/doc/html/rfc2119 If we were to make a change along these lines, we should use MAY instead. |
This not being forward-compatible is correct. The client likely needs to pay attention to the version of the server it is being used with, and not pass qualifiers that are not supported. The reason that unknown qualifiers SHOULD be rejected is that doing otherwise is a correctness issue. If a client asks for a checksum.sri and the server returns a response that doesn't match that SRI, that's a problem. If a client asks for a response at one commit, and gets a different commit back, that's a problem. Now, if there are qualifiers that are actually benign to ignore, the server can maybe be updated to do so. But most of the time I'd expect all qualifiers to be meaningful, and so none should be ignored.
It'd be nice to document them there, yeah. Not strictly required - if bazel and a server agree on a qualifier, it need not be generally standardized - but still, it'd sure make interop with bazel and between other systems if there was one single place we could document the "system-specific" qualifiers, and turn them into proper standards as appropriate. |
In addition to the checksum.sri qualifier from remote api spec, Bazel includes it's own set of qualifiers to each FetchBlob requests. https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/remote/downloader/GrpcRemoteDownloader.java;l=76-85;drc=618c0abbfe518f4e29de523a2e63ca9179050e94 This change adds initial support for the http_header qualifier as well as acknoledge the existence of bazel.canonical_id header (without actually using it). Relevant tests were also added to demonstrate the current behavior. In a future patch, we may start rejecting unknown qualifiers as recommended by the Remote Asset API spec and thus, flip the assertions in the test. See bazelbuild/remote-apis#301 for more info. Another change to consider in the future is support for custom url-specific header credentials. This is being proposed in Bazel via bazelbuild/bazel#23578.
In addition to the checksum.sri qualifier from remote api spec, Bazel includes it's own set of qualifiers to each FetchBlob requests. https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/remote/downloader/GrpcRemoteDownloader.java;l=76-85;drc=618c0abbfe518f4e29de523a2e63ca9179050e94 This change adds initial support for the http_header qualifier as well as acknoledge the existence of bazel.canonical_id header (without actually using it). Relevant tests were also added to demonstrate the current behavior. In a future patch, we may start rejecting unknown qualifiers as recommended by the Remote Asset API spec and thus, flip the assertions in the test. See bazelbuild/remote-apis#301 for more info. Another change to consider in the future is support for custom url-specific header credentials. This is being proposed in Bazel via bazelbuild/bazel#23578.
I have been working with Remote Asset API for a bit recently and I noticed a few points:
First of all, most implementations I found in the wild do not follow this specification and won't reject qualifiers that they don't support.
If servers were to follow this paragraph, it would lock the implementation to a set of qualifiers and make it non-forward compatible with newer clients. So I think we should consider removing this paragraph entirely or changing the wording to
COULD
instead ofSHOULD
.Another related point is that for Bazel, there are non-standard qualifiers used https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/remote/downloader/GrpcRemoteDownloader.java;l=76-85;drc=618c0abbfe518f4e29de523a2e63ca9179050e94
Should we document these in
build/bazel/remote/asset/v1/qualifiers.md
?The text was updated successfully, but these errors were encountered: