Hi folks.
# spicedb
m
Hi folks. My colleagues and I have been working with SpiceDB for a little while now, and have recently added a version check (as per https://authzed.com/blog/automatic-release-notification) to our client library. We made a couple of observations during the process, and we're interested to know if perhaps we've missed an easier way of doing things. Firstly, as per that link, the version is reported via a gRPC middleware implementation. This seems perhaps a little clunky, and we were wondering why it wasn't implemented (say) via a new service and/or RPC method? (Or maybe there is such a thing that we've missed?) Secondly, we use the
serve-testing
command extensively in our test suite, but it seems that the version middleware is not enabled when running SpiceDB in testing mode? We don't get the version back when running in testing mode, but do in normal
serve
mode. Is there a reason that's the case, or are we perhaps missing a config switch required to enable it in testing?
v
It's all implemented with a middleware, and if it's not in serve-testing, it should probably be there and it was just an oversight. Feel free to open an issue.
I'm not sure exactly what you mean with clunky, would appreciate if you could elaborate. I'd argue that server version is orthogonal concept to the gRPC API. You could be running different services at different versions, adding a version to each gRPC service does not seem very ergonomic for API consumers. Also I'd be interested to understand why would you consider this functionality useful in your own internal client. What can possibly a client of a SpiceDB instance do if the SpiceDB instance is running a few versions behind?
adding this to
zed
make sense as it is an interactive tool, typically used for development / debugging. Are you building your own CLI?
m
Thanks for the feedback @vroldanbet! The "clunky" was not in any way meant to be pejorative by the way, my apologies if it came across that way. I guess the reason it felt a little odd was because we can't just straight up ask SpiceDB for its version - we've got to "piggyback" by executing some other unrelated RPC, mutating the request, and intercepting the response. For context, we're working in a REST microservice architecture, with SpiceDB for permissions. Our services each have a metadata endpoint that reports back the service version and some status info. Since SpiceDB's behind the firewall, we're looking to report its version via one of our service's metadata endpoints, so our infrastructure monitoring tools can automatically let us know when an update is required. Given that context and being relatively new to gRPC, I guess a lot of my questions probably stem from being used to a RESTful approach and being somewhat unfamiliar with gRPC idioms. Since I gather there's no particular reason for the middleware to be absent from
serve-testing
, I'll go ahead and make that ticket.
v
No worries. FWIW I didn't take it as pejorative - I want to understand where that feeling comes from, clunky may mean different things for different individuals. I appreciate the context. Not something I've checked myself but have you seen if the metadata comes back from the health endpoint?
m
Oh, that's definitely interesting! I wasn't aware there was a health API - it doesn't appear to be documented in the [API docs](https://buf.build/authzed/api/docs/main:authzed.api.v1) ?
j
its part of the standard gRPC support we have
v
ideally it shows up in the API docs, yeah
3 Views