Skip to content

feat(runs): list runs with their annotations - #8349

Merged
pingsutw merged 1 commit into
flyteorg:mainfrom
moldhouse:runs-list-annotations
Nov 16, 2026
Merged

pingsutw merged 1 commit into
flyteorg:mainfrom
moldhouse:runs-list-annotations

Conversation

@moldhouse

@moldhouse moldhouse commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Tracking issue

Related to #8292

Why are the changes needed?

ListRuns returns each run's labels but not its annotations, so a client that shows runs by an annotation has to call GetRunDetails for every listed run.

What changes were proposed in this pull request?

  • Run.annotations, a new field set to RunSpec.annotations.
  • The runs service fills it from the run spec it already loads for every listed run, so ListRuns, WatchRuns and CreateRun return 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_Annotations lists 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's buf.gen.*.yaml templates, as make gen does.

Labels

  • added

@github-actions github-actions Bot added the flyte2 label Nov 6, 2026
@moldhouse
moldhouse marked this pull request as ready for review November 6, 2026 19:16
@moldhouse
moldhouse force-pushed the runs-list-annotations branch from 5fe165b to 7ccf990 Compare November 6, 2026 19:17
@moldhouse

Copy link
Copy Markdown
Contributor Author

@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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have list by labels, so no, we do not want to support list by annotations please

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@moldhouse
moldhouse force-pushed the runs-list-annotations branch from 7ccf990 to f1f476d Compare November 14, 2026 06:10
@pingsutw
pingsutw merged commit 3c016e4 into flyteorg:main Nov 16, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants