Skip to content

feat: filter tasks by state and tags #143

Closed

Description

@uniqueg

Description

TES 1.1 adds three filters to GET /tasks: state, and tag_key with
tag_value (arrays, zipped into a map of tags). TESK API doesn't declare
them, and Spring ignores unknown query parameters, so a client asking for
?state=RUNNING or ?tag_key=WORKFLOW_ID&tag_value=cwl-01234 gets all
its tasks, unfiltered (TasksApi.java:127, TasksApiController.java:73-107,
TesServiceImpl.java:265-312).

Tags are only in the task JSON stored as the taskmaster job's annotation,
and the state is computed from the task's jobs, so neither can be a
Kubernetes selector: like name_prefix, both filter each page after
reading it, and pages can be shorter than page_size.

Doesn't depend on #133/#134. If B (states) hasn't landed, add CANCELING
and PREEMPTED to TesState here, so that all TES 1.1 values are accepted.

Expected result

  • state accepts every tesState value of TES 1.1; other values give 400 Bad Request naming state
  • tag_key/tag_value match as in the specification's table (empty or missing tag_value matches any value, also ""; a task without the key never matches; all pairs must match)
  • More tag_values than tag_keys give 400 Bad Request
  • Filters combine with name_prefix, page_size, page_token and all views; paging behaves as documented for name_prefix
  • The parameters are in the OpenAPI description (/v2/api-docs)
  • Unit and controller tests, incl. the specification's tag match table
  • docs/api.md "Listing tasks" describes both filters and short pages

Activity

  1. self-assigned this
    on Nov 12, 2026
  2. added
    type: feature
    priority: high
    status: in progress
    type flag: required by specs
    workload: hours
    on Nov 12, 2026
  3. removed
    status: in progress
    on Nov 12, 2026
  4. added this to the v2.0.0 milestone on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: hightype flag: required by specstype: featureworkload: hours

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions