Skip to content

feat: report output file logs - #176

Merged
uniqueg merged 7 commits into
devfrom
feat/160-output-file-logs
Nov 14, 2026
Merged

uniqueg merged 7 commits into
devfrom
feat/160-output-file-logs

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Summary

TESK API reports TES 1.1 logs[0].outputs: the files that the outputs
filer uploaded, each with its url, path and size_bytes.

  • The taskmaster stores the files as the annotation output-file-logs on
    the outputs filer's job (feat: record output file logs tesk-core#145, for
    tesk-core#144). TesKubernetesConverter.extractOutputFileLogs reads
    the annotation for the BASIC and FULL views, for single tasks and
    for lists.
  • Without the annotation, or with one that isn't a list of files, the
    array stays [], as before. A file needs text url and path, and
    size_bytes as a string of digits. Other keys are ignored. The log
    line names the reason, never the values, because URLs may carry
    credentials.
  • Docs:
    • API: the Output file logs section, the list of differences from TES
      1.1, and the cost of GET /tasks.
    • Upgrading: image versions and the taskmaster's permissions.
    • Deployment: the taskmaster needs patch on jobs and get on
      pods/log.

Closes #160

Verification

  • Lint on Java 8 (./mvnw -B spotless:check checkstyle:check): BUILD
    SUCCESS, 0 violations.

  • ./mvnw -B clean verify on Java 21: 18413 unit tests and 99 ITs pass.
    JaCoCo coverage checks are met.

  • mkdocs build --strict: clean.

  • New tests are in TesKubernetesConverterTest. They cover:

    • the files themselves, and other keys being ignored;
    • the list path, where the outputs filer's job is matched by name;
    • no outputs filer's job, and no annotations;
    • JSON that isn't valid, isn't a list, or is an empty list;
    • entries that aren't files, have a missing size, or have a numeric or
      negative size.
  • Review: adversarial-reviewer and quality-reviewer, two rounds.

    • Round 1 found a medium and several lows. The medium is the
      GET /tasks cost below. The lows: a URL in the log, a check that was
      too strict, a missing list-path test, and docs.
    • Round 2 found no medium or high findings. Its lows (docs, a stale IT
      comment) are fixed.
  • CI: all checks passed. The first run's codecov/patch flagged two
    branches without tests (a URL that isn't text, a missing path); both
    now have tests.

  • Sourcery: 1 finding, that a blank annotation makes readTree return
    null. With Jackson 2.18, it returns a missing node. Tests for empty,
    blank and null annotations were added and pass. The thread is
    answered and resolved.

Declined review findings

  • GET /tasks lists every filer job in the namespace, as before, to
    match them to the page's tasks. Each job of a finished task can now be
    up to about 200 KB larger.
  • The quality review suggested splitting the last invalid-entry test
    further. Each assertion has a message, so I left it as is.

Open questions

None. Note for deployment: the array stays empty until the taskmaster
and filer images are of a tesk-core release that includes
elixir-cloud-aai/tesk-core#145.

🤖 Generated with Claude Code

Summary by Sourcery

Expose output filer results through TES 1.1 output file logs while documenting compatibility and operational requirements.

New Features:

  • Report uploaded output files in TES 1.1 logs[].outputs for supported task views and task listings.

Enhancements:

  • Validate stored output-file metadata and safely fall back to an empty list when annotations are unavailable or invalid.
  • Document compatibility requirements, deployment permissions, upgrade steps, and the additional task-listing cost of output file logs.

Deployment:

  • Update taskmaster permission requirements to include patching jobs and reading pod logs.

Documentation:

  • Document output file log behavior, compatibility limitations, upgrade requirements, and GET /tasks performance implications.

Tests:

  • Add converter coverage for valid output file logs, task-list matching, missing data, malformed annotations, and invalid entries.

uniqueg and others added 3 commits November 14, 2026 01:03
logs[0].outputs now lists the uploaded files, read from the annotation
output-file-logs that the taskmaster stores on the outputs filer's job
(elixir-cloud-aai/tesk-core#144). Without it, or if it isn't a list of
files with text url, path and size_bytes, the list stays empty.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From the review: other keys of a stored file are ignored, so that a
later taskmaster can add some; size_bytes must be a whole number. The
log names no values, as URLs may carry credentials. Tests for the list
path and each invalid case; docs on the cost of GET /tasks and the
taskmaster's permissions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg uniqueg self-assigned this Nov 14, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Read the annotation key and converter logic that turn the outputs filer job’s stored JSON into TES output-file logs.

  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/constant/Constants.java L41-47
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverter.java L406-470, L611-612

Documentation

Review the API behavior, deployment permissions, upgrade requirements, and listing-cost documentation for output-file logs.

  • docs/api.md L165-169, L269-302
  • docs/deployment.md L64-69
  • docs/upgrading.md L27-39

Tests

Check converter coverage for valid and invalid annotations, task-list matching, and the updated integration-test expectation.

  • src/integration-test/java/uk/ac/ebi/tsc/tesk/NoAuthIT.java L221
  • src/test/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverterTest.java L21-24, L52-55, L525-673

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 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.81%. Comparing base (e12f8f1) to head (3d26f20).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #176      +/-   ##
==========================================
+ Coverage   75.33%   75.81%   +0.47%     
==========================================
  Files          71       71              
  Lines        3309     3345      +36     
  Branches      393      402       +9     
==========================================
+ Hits         2493     2536      +43     
+ Misses        663      651      -12     
- Partials      153      158       +5     

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

uniqueg and others added 2 commits November 14, 2026 01:31
Codecov's patch check missed the branches for a URL that isn't text
and a missing path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg marked this pull request as ready for review November 14, 2026 00:36
@sourcery-ai

sourcery-ai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Linked issues

Checked at commit 3d26f20

#160 feat: report output file logs · 2 of 3 met · 1 to check by hand

# Requirement Status Notes
1 The filer records uploaded files 👀 Check by hand (runtime) Run a compatible tesk-core taskmaster and filer and verify that successful uploads are recorded in the outputs filer's output-file-logs annotation; this PR documents that dependency but does not change the taskmaster or filer.
2 TESK API reads the files into logs[0].outputs ✅ Met extractOutputFileLogs reads the annotation from the outputs filer's job and maps its file entries to TES output logs; the converter tests cover populated annotations and task-list conversion.
3 Document output file logs ✅ Met The API docs describe the output file logs, their annotation source, limitations, and listing cost.

@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 1 issue

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

## Individual Comments

### Comment 1
<location path="src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverter.java" line_range="411" />
<code_context>
+        String reason = null;
+        try {
+            JsonNode files = this.objectMapper.readTree(json);
+            if (!files.isArray()) {
+                reason = "not a list";
+            } else {
</code_context>
<issue_to_address>
**Empty output annotations break task reads**

When the outputs filer job's `output-file-logs` annotation is empty or whitespace, `ObjectMapper.readTree(json)` returns null, so `files.isArray()` throws a `NullPointerException` that the `IOException` handler does not catch; task reads and task-detail or task-list requests fail instead of returning an empty outputs array.

Handle a null result from `readTree` as an empty outputs array.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverter.java:411


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

uniqueg and others added 2 commits November 14, 2026 01:46
Sourcery expected readTree to return null for blank text; Jackson
2.18 returns a missing node, which gives an empty list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit 2cbab7a into dev Nov 14, 2026
25 checks passed
@uniqueg
uniqueg deleted the feat/160-output-file-logs branch November 14, 2026 00:57
uniqueg added a commit that referenced this pull request Nov 14, 2026
Brings in #161, #174, #175, #176, #178, #181, #183 and #184. The
conflict in docs/upgrading.md is resolved by merging both lists under
"To 1.3.0": the upgrade order for filer labels and Java 21 come first,
and the TES 1.1 fields item no longer says that ignore_error: true is
refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg added a commit that referenced this pull request Nov 14, 2026
Lists the changes merged into dev since the notes were written:
Java 21 (#161), ignore_error (#174), the resource server (#175),
output file logs (#176), the Kubernetes client (#178), Dependabot
labels (#181), the executor job selector (#183) and full test coverage
(#184). Adds a Breaking changes section, as in the 1.2.0 notes, and
sets date-released to the planned tag date, 2026-11-16.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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: report output file logs

1 participant