Skip to content

feat: default page_size to 256 as TES specifies - #158

Merged
uniqueg merged 4 commits into
devfrom
feat/137-tes-1-1-page-size
Nov 13, 2026
Merged

uniqueg merged 4 commits into
devfrom
feat/137-tes-1-1-page-size

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes the last TES 1.1 gap that TESK API can close on its own, and documents the ones that remain:

  • GET /tasks without page_size (or with an empty one) now returns at most 256 tasks per page, the default that TES gives. Before, it read all taskmaster jobs at once. Explicit values (1 to 2048) are unchanged.
  • docs/upgrading.md: upgrade note for the new default.
  • docs/api.md: removes merge conflict markers that were left in "Listing tasks" (they are on dev now) and adds a "Differences from TES 1.1" section.

Tests: a new unit test for the default (left out and empty), the integration-test stubs of the taskmaster list now expect limit=256, and NoAuthIT.getList checks the limit query parameter.

Closes #137

Gap list (TES 1.1 OpenAPI at tag v1.1 vs. dev 7c86a4a and #155)

Item                                        State
------------------------------------------  ------------------------------------------
Task fields (path_prefix, streamable,       done on dev (#133, #147, #150, #152)
  ignore_error, backend_parameters(_strict),
  type optional/null)
GET /tasks state, tag_key, tag_value        done on dev (#149)
States CANCELING, PREEMPTED                 done on dev (#151)
Service info type.version 1.1.0,            done on dev (#133, #147)
  tesResources_backend_parameters
Cancel answers {}                           done on dev
page_size limits (1..2048)                  done on dev (#114; 2048 accepted, TES: <2048)
page_size defaults to 256                   THIS PR
Views MINIMAL/BASIC/FULL                    done on dev
executors[].ignore_error: true              refused (400); needs tesk-core: #159
logs[].outputs (tesOutputFileLog)           always []; needs filer reporting: #160
executor log exit_code required,            left out until terminated / never set;
  stderr                                      documented difference (no issue)
CORS (new section in TES 1.1)               no CORS headers; documented: configure in ingress
resources.preemptible, zones; streamable    accepted, no effect (allowed by TES); documented

The remaining gaps are tracked in #159 and #160. With this PR, TESK API reports TES 1.1.0 and documents every difference, so #137 can close.

Verification

  • ./mvnw -B spotless:check checkstyle:check clean verify (Temurin 8): BUILD SUCCESS, all unit tests and 99 integration tests pass, coverage checks met. Before the fix, the new unit test failed and 12 list integration tests got 500 (stubs without limit), as expected.
  • mkdocs build --strict: passes.
  • CI on the head commit: all checks passed (CI passed, Test, Lint, Docs, Smoke test, Scan image, PR title, CodeQL, codecov project and patch).

Declined review findings

  • Adversarial (low): page_size=%20 (whitespace only) gives 400, while page_size= gives the default. Declined: cosmetic. Whitespace is not a number, and the docs only promise the default for an empty value.
  • Quality (low): the "Differences from TES 1.1" section repeats items from other sections and isn't linked from index.md. Declined: the section is a summary that links to the detailed sections, and index.md has no per-section index of api.md.
  • Quality (medium): an extra test that an explicit page_size is passed through. Declined: listTasks_validPageSize already checks eq(pageSize) for 1 and 2048.

Open questions

None. The upgrade note for the page_size default is in docs/upgrading.md ("To the next release"); if #155 merges first, whoever merges second resolves the conflict there.

🤖 Generated with Claude Code

Summary by Sourcery

Align task listing pagination with the TES 1.1 default while documenting compatibility differences and upgrade impact.

New Features:

  • Default GET /tasks pagination to 256 tasks when page_size is omitted or empty, matching TES 1.1 behavior.

Enhancements:

  • Document TESK API differences from TES 1.1 and the changed default pagination behavior.

Documentation:

  • Add upgrade guidance for clients affected by the new default page size.
  • Clarify task listing pagination behavior and remove stale documentation conflict markers.

Tests:

  • Update unit and integration coverage to verify the 256-task default and Kubernetes limit parameter.

uniqueg and others added 3 commits November 13, 2026 07:56
The listing section of docs/api.md kept the conflict markers of a merge
of dev into the branch of #151. Keep the side that matches the merged
behaviour: TESK API reports CANCELING and PREEMPTED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GET /tasks without page_size, or with an empty one, read all taskmaster
jobs in one page. TES (1.0 and 1.1) says page_size defaults to 256, so
the controller now passes 256 to Kubernetes when it is left out.

Also list the remaining differences from TES 1.1 in the API docs.

Refs #137

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Make an omitted or empty page_size default to 256 for task listing, and document the service contract that the controller now passes that default.

  • src/main/java/uk/ac/ebi/tsc/tesk/tes/api/TasksApiController.java L43-146 (4 small edits)
  • src/main/java/uk/ac/ebi/tsc/tesk/tes/service/TesService.java L54-55

Documentation

Explain the new default and pagination behavior, resolve the listing-state conflict, document remaining TES 1.1 differences, and note the upgrade impact.

  • docs/api.md L30-35, L129-154 (+2 small edits)
  • docs/upgrading.md L14-18

Tests

Update Kubernetes list stubs to expect the default limit and verify that an omitted page_size requests 256 tasks.

  • src/integration-test/java/uk/ac/ebi/tsc/tesk/AuthIT.java L564-627 (4 small edits)
  • src/integration-test/java/uk/ac/ebi/tsc/tesk/ClaimAuthIT.java L220-221, L240-241, L257-258
  • src/integration-test/java/uk/ac/ebi/tsc/tesk/LegacyUserLabelsIT.java L115-116
  • src/integration-test/java/uk/ac/ebi/tsc/tesk/NoAuthIT.java L255-256, L264-269, L323-324
  • src/integration-test/java/uk/ac/ebi/tsc/tesk/ServiceClientAuthIT.java L213-214, L313-314
  • src/test/java/uk/ac/ebi/tsc/tesk/tes/api/TasksApiControllerTest.java L635-648 (+4 small edits)

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.02%. Comparing base (7c86a4a) to head (ffd2957).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #158   +/-   ##
=======================================
  Coverage   75.01%   75.02%           
=======================================
  Files          71       71           
  Lines        3266     3267    +1     
  Branches      384      385    +1     
=======================================
+ Hits         2450     2451    +1     
  Misses        663      663           
  Partials      153      153           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Also link the differences from TES 1.1 to their issues (#159, #160).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@uniqueg
uniqueg marked this pull request as ready for review November 13, 2026 08:25
@sourcery-ai

sourcery-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit ffd2957

#137 feat: support TES 1.1 · 2 of 3 met

# Requirement Status Notes
1 List the gaps between TESK API and TES 1.1, field by field and endpoint by endpoint. ✅ Met The new “Differences from TES 1.1” section itemizes the remaining behavioral differences.
2 Close the TES 1.1 gaps, using child issues where needed. 🟡 Partly met The default page size is fixed, but executors[].ignore_error: true and logs[].outputs remain unsupported and are deferred to #159 and #160.
3 Report TES 1.1.0 in service info. ✅ Met src/main/resources/service-info.yaml reports version 1.1.0, and the service-info controller test checks it.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/api.md" line_range="134-137" />
<code_context>
+TESK API implements TES 1.1 with these differences, which clients should
+know about:
+
+- `executors[].ignore_error: true` is refused with `400 Bad Request` (see
+  [TES 1.1 fields](#tes-11-fields);
+  [#159](https://github.com/elixir-cloud-aai/tesk-api/issues/159) is about
+  supporting it).
+- `resources.preemptible` and `resources.zones` are accepted and returned,
+  but have no effect on where the task runs, as TES allows.
</code_context>
<issue_to_address>
**Support ignore_error true**

TESK still refuses `executors[].ignore_error: true` with `400 Bad Request`; this change documents the limitation and refers to #159, but does not close it.
</issue_to_address>

### Comment 2
<location path="docs/api.md" line_range="147-150" />
<code_context>
+- In executor logs, `exit_code` is left out until the executor's container
+  has terminated, and `stdout` holds both output streams of the executor,
+  while `stderr` is left out (see [Executor logs](#executor-logs)).
+- `logs[].outputs` is always empty (see [Output file
+  logs](#output-file-logs);
+  [#160](https://github.com/elixir-cloud-aai/tesk-api/issues/160) is about
+  reporting them).
+- TESK API sends no CORS headers. To use it from web pages of other origins,
+  as TES asks of such implementations, configure CORS where you expose it,
</code_context>
<issue_to_address>
**Report output logs**

`logs[].outputs` remains empty; this change documents the limitation and refers to #160, but does not close it.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: docs/api.md:137, docs/api.md:150


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread docs/api.md Resolved
Comment thread docs/api.md Resolved
@uniqueg
uniqueg merged commit 0d6904f into dev Nov 13, 2026
43 checks passed
@uniqueg
uniqueg deleted the feat/137-tes-1-1-page-size branch November 13, 2026 08:37
uniqueg added a commit that referenced this pull request Nov 13, 2026
Keep both upgrade notes for 1.3.0 (the page_size default from #158
joins the section "To 1.3.0") and add #137, #158, #159 and #160 to
the release notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support TES 1.1

1 participant