Repository navigation
feat(runs): list runs with their annotations - #8349
Conversation
5fe165b to
7ccf990
Compare
|
@pingsutw could you have a look at this PR? It’s the annotations counterpart to flyteorg/flyte#8292. Happy to adopt in any way, e.g. make it opt-in if you’d rather not send annotations by default. |
|
|
||
| // User-defined annotations attached to this run at creation time, the same as | ||
| // RunSpec.annotations. It is part of Run so that it gets returned in a list request. | ||
| map<string, string> annotations = 3; |
There was a problem hiding this comment.
we already have list by labels, so no, we do not want to support list by annotations please
There was a problem hiding this comment.
no filter here, this only returns the annotations in the list response, like flyte 1 did when listing executions. no new index or query, the list already loads them
There was a problem hiding this comment.
+1 on this
Where do you show annotations: on a run's detail page or in a list of runs?
The detail page already gets them from GetRunDetails, so this PR helps only for list views.
There was a problem hiding this comment.
in a list of runs, our dashboard lists all runs of a job and shows a value we keep in an annotation for each one. right now that's one GetRunDetails call per run
A client showing runs by their annotations has to fetch every listed run's details. ListRuns already loads each run's spec, so it returns the annotations from there. Signed-off-by: Moritz Althaus <moritzalthaus@gmx.de>
7ccf990 to
f1f476d
Compare
Tracking issue
Related to #8292
Why are the changes needed?
ListRunsreturns each run's labels but not its annotations, so a client that shows runs by an annotation has to callGetRunDetailsfor every listed run.What changes were proposed in this pull request?
Run.annotations, a new field set toRunSpec.annotations.ListRuns,WatchRunsandCreateRunreturn it with no extra query. The spec is decoded once per run, for labels and annotations alike.Annotations can be larger than labels and now ride along on every listed run; happy to put them behind an opt-in on the request if you'd rather.
How was this patch tested?
TestListRuns_Annotationslists a run with the annotations in its run spec;go test ./runs/service/...passes. Bindings were regenerated with buf 1.58.0 and the repo'sbuf.gen.*.yamltemplates, asmake gendoes.Labels