nessie
nessie copied to clipboard
Document CEL application to Nessie filters
Nessie APIs accept CEL expressions to allow filtering various model objects (e.g. commit log).
However, it proves difficult for end users to construct correct CEL filters even for common use cases.
It would be nice to have a doc page on how to apply CEL expressions to Nessie objects and what data is available to those expressions.
could it make sense to add methods to the builder to generate common filter expressions?
or at least override QueryBuilder.filter
method to provide javadoc how common cel filters would look like for that particular builder?
for example for GetEntriesBuilder
we could document things like size(entry.keyElements) == 4
or entry.encodedKey.startsWith('foo.')
right now a caller has to know about the element name (i.e. entry
) and its properties and their structure (i.e. encodedKey
being separated by dots)
That would result in a builder-pattern for "all the things CEL", which is maybe a bit too much.
Some good/useful examples would be nice though. And links to CEL docs/specs.
not "all things CEL" but the suggestion would be to only build context specific things like:
String buildFilterEntryKeyLength(int size)
String buildFilterEntryKeyStartsWith(List<String> keyElements)
but this assumes that there are "common filter"-usecases of course the boundaries are fluent between "undiscoverable" and "too specific"
If we add API methods for filters, it might be best to delegate the impl. to the server, which can do it more efficiently.
That said, I do not mean to say that we should add API methods for specific filters.
Prefix-based lookup will be improved by #5591