Skip to content

build: use tesk-api 2.0.0 in the chart - #309

Merged
uniqueg merged 7 commits into
devfrom
build/308-tesk-api-2.0.0
Nov 16, 2026
Merged

uniqueg merged 7 commits into
devfrom
build/308-tesk-api-2.0.0

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Closes #308

Summary

tesk-api 2.0.0 (release, image docker.io/elixircloud/tesk-api:2.0.0) and tesk-core 0.12.0 (release, taskmaster and filer images 0.12.0) are out; this makes them the chart's defaults and adapts the chart to them.

  • Images: appVersion (the default tag of the API's image) 2.0.0; tesk.taskmaster.image.tag and tesk.filer.image.tag 0.12.0.
  • Upgrade order (TESK API 2.0.0 before taskmaster 0.12.0): the API's Deployment already uses Recreate by default (feat: set the API's update strategy (Recreate) #305/feat: set the API's update strategy #306), so one helm upgrade that brings both is safe. The two-step path for RollingUpdate is documented, now with what happens between the steps. New: the chart refuses a taskmaster 0.12.0 or later with tesk-api before 2.0.0 (e.g. values that pin tesk.image.tag but not the taskmaster); helm install/upgrade fails with an error that names the tags to set and links the upgrade notes. The version checks accept only SemVer that semverCompare reads as written (helpers tesk.semver, tesk.checkApiTaskmaster).
  • Notes: the auth.tokenClients warning applies to tesk-api before 2.0.0 (<2.0.0-0; was <1.2.1-0); 2.0.0 pre-releases count as supporting it. All four version gates of the API now use one helper, tesk.apiBefore.
  • Service info: tesk-api 2.0.0 implements TES 1.1, so the chart's type.version is 1.1.0 for tesk-api 2.0.0 and later (and tags that aren't versions, e.g. dev), 1.0.0 before.
  • Hardened filer pods: taskmaster 0.12.0 runs filer pods with RuntimeDefault seccomp, non-root, read-only root filesystem. New values tesk.filer.podSecurityContext and tesk.filer.securityContext (default null = taskmaster's defaults; a map replaces them; {} leaves one out) go to the taskmaster as FILER_POD_SECURITY_CONTEXT / FILER_SECURITY_CONTEXT, for clusters that refuse RuntimeDefault (e.g. Rahti).
  • FTP credentials by reference: with an FTP secret, the chart also passes its name as TESK_FTP_SECRET_NAME, so filer jobs of taskmaster 0.12.0 reference the secret instead of holding the credentials as values.
  • Docs pulled into the site: docs-sources.yml pins tesk-api v2.0.0 (9d73a31) and tesk-core v0.12.0 (b78d5c9), so the links of the tesk-api release notes (tesk-api/upgrading/#to-200) and "Tokens of services" resolve on tesk.readthedocs.io.
  • Docs: upgrade notes for the new defaults (pinned tags and order, hardened filer pods, FTP secret, serviceInfo.existingConfigMap, client-visible API changes), configuration reference, deployment guide (seccomp section, token clients, /v3/api-docs), API page.
  • Chart version: unchanged (0.3.0); per docs/development.md, the release-prep PR sets it.

How it was verified

  • helm lint charts/tesk --strict (Helm 3.22.1): passed.
  • REQUIRE_HELM=1 pytest tests/test_chart.py: 691 passed. Tests were written first and failed before each change (new: test_default_images, test_service_info_type_version, test_filer_security_contexts(_invalid), test_new_taskmaster_old_api, test_malformed_version_tags; extended: test_notes_token_clients_old_api, test_ftp_secret_credentials).
  • coverage run -m pytest --ignore=tests/test_chart.py: 175 passed, 100% coverage.
  • pre-commit run --all-files: passed.
  • mkdocs build --strict: passed with the new pins; the anchors tesk-api/upgrading/#to-200, tesk-api/access-control/#tokens-of-services, tesk-core/upgrading/#0120, #hardened-filer-pods, #ftp-credentials-by-reference and tesk-core/filer/#pod-security exist in the built site.
  • kind (v0.33.0), two runs, clusters deleted afterwards:
    • installed the chart of origin/dev (tesk-api 1.2.0, tesk-core 0.11.0), then upgraded to this branch in one helm upgrade: strategy {"type":"Recreate"}, image tesk-api:2.0.0, taskmaster/filer 0.12.0, service info {"type":{"group":"org.ga4gh","artifact":"tes","version":"1.1.0"},"version":"2.0.0"}; tests/smoke/deployment.sh passed (task COMPLETE, cancel CANCELED); a task with a content input ran the hardened 0.12.0 filer (runAsNonRoot, RuntimeDefault) to COMPLETE, and its filer job carried taskmaster-name;
    • fresh install with tesk.filer.podSecurityContext={"runAsNonRoot":true}: the filer pod ran with exactly that security context (no seccomp profile) and the task completed.
  • CI: all checks passed at 6225b88 (CI passed, Chart, Chart install on kind, Docs, Lint, Test, Release readiness, CodeQL, Codecov, Sourcery, Read the Docs preview).
  • Sourcery: 5 findings (2 here, 2 on feat: set the tesk-api CORS origins in the chart #310 about this PR's code, 1 on the re-review). Fixed: an old API with a new taskmaster now fails instead of warning; tags with leading zeros (01.2.3, 1.2.3-01) count as tags that aren't versions (6225b88). Answered: the notes no longer warn about that pair because the chart refuses it (the build: use tesk-api 2.0.0 in the chart #308 checklist says so now). Also fixed: malformed version-like tags (e.g. 1.2.3-) failed semverCompare; the checks now accept only SemVer suffixes (c492e63, test_malformed_version_tags). Declined: validating the filer security contexts field by field in the schema (would duplicate the Kubernetes API schema; the taskmaster validates them and falls back to its defaults, now documented).

Declined review findings

Two review rounds (adversarial and quality). All high and medium findings were fixed: values for the filer's security contexts, the warning for a new taskmaster with an old API, the FTP secret by reference, the version helper, and the test and docs fixes. Declined:

  • Merging of tesk.filer.*SecurityContext across values layers ({} in an override file doesn't clear a map from a base file): this is how Helm treats every map. It is documented rather than handled with a sentinel value, which would add a schema special case.
  • Bare-major tags (1, 2) and V1.2.0 count as "newer", as in the existing checks.

Open questions

None.

🤖 Generated with Claude Code

uniqueg and others added 5 commits November 16, 2026 12:33
The chart's appVersion (the default tag of the API's image) is 2.0.0,
and the taskmaster and filer images default to 0.12.0. One helm upgrade
brings both in the order they need, as the API's Deployment uses the
Recreate strategy (#305).

The notes warn about auth.tokenClients for tesk-api before 2.0.0, the
first release with the setting (was: before 1.2.1-0). The chart's
service info reports TES 1.1.0 for tesk-api 2.0.0 and later (and for
tags that aren't versions), and TES 1.0.0 before, as tesk-api 2.0.0
implements TES 1.1.

Refs #308

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pull the docs of tesk-api v2.0.0 and tesk-core v0.12.0 into the site,
so that the links of the tesk-api 2.0.0 release notes (upgrading/#to-200,
"Tokens of services") resolve. Add upgrade notes for the new default
images: pinned tags and the upgrade order, the hardened filer pods on
clusters that refuse the RuntimeDefault seccomp profile, the service
info's TES version, and the API changes for clients. The configuration
reference and the deployment guide name the new defaults.

Refs #308

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tesk.apiBefore replaces four copies of the version check of the API's
tag (notes and service info). Docs: /v3/api-docs of tesk-api 2.0.0,
the tokenClients requirement in the configuration reference, one place
for the filer's seccomp advice; test_default_images checks the
rendered image.

Refs #308

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- tesk.filer.podSecurityContext and tesk.filer.securityContext replace
  the taskmaster's defaults for the filer pods (FILER_POD_SECURITY_CONTEXT
  and FILER_SECURITY_CONTEXT), e.g. on clusters that refuse pods asking
  for the RuntimeDefault seccomp profile; null keeps the defaults.
- The FTP secret's name also goes to the taskmasters as
  TESK_FTP_SECRET_NAME, so that filer jobs of taskmaster 0.12.0
  reference it instead of holding the credentials.
- The notes warn about taskmaster 0.12.0 or later with tesk-api before
  2.0.0, which reports wrong task states.

Docs: upgrade notes, configuration reference, deployment guide.

Refs #308

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add pre-release cases to the notes test for taskmaster 0.12.0 with an
older tesk-api, parametrize the filer security context test on JSON
values, and read tesk.apiBefore the same way everywhere. Docs: rewrap
lines, note that Helm merges the filer's security contexts across
values files, and the ignore_error exception with taskmaster 0.11.0.

Refs #308

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

sourcery-ai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Implementation

Add shared SemVer-aware API-version checks, use them for the existing compatibility warnings and service-info TES version, and reject taskmaster versions that require a newer API.

  • charts/tesk/templates/_helpers.tpl L96-133, L395-404, L439-442 (+3 small edits)
  • charts/tesk/templates/common/tesk-deployment.yaml L7-8

Configuration

Set the chart's API version and default taskmaster and filer releases to the compatible 2.0.0 and 0.12.0 combination, and define the filer security-context values.

  • charts/tesk/Chart.yaml L13
  • charts/tesk/values.yaml L57-72 (+3 small edits)

Pass the FTP secret name and optional filer security contexts to the taskmaster environment.

  • charts/tesk/templates/common/tesk-deployment.yaml L121-138

Update the values schema to validate the new filer security-context settings.

  • charts/tesk/values.schema.json L138-151

Pin the tesk-api and tesk-core documentation sources to the releases covered by this chart update.

  • docs-sources.yml L9-14

Documentation

Document the new defaults, upgrade sequencing and compatibility checks, filer security contexts, FTP secret reference, TES service-info version, and API changes.

  • docs/upgrading.md L15-86, L121-126, L177-181

Update the configuration and deployment references for the new image versions, filer settings, token-client requirement, and API documentation endpoint.

  • docs/configuration.md L48-52, L186-190 (+2 small edits)
  • docs/deployment.md L285-304 (+5 small edits)

Explain that tesk-api 2.0.0 serves OpenAPI 3.1 at /v3/api-docs while retaining the deprecated Swagger 2.0 endpoint.

  • docs/api.md L26-28

Tests

Cover the new image defaults, API-version-dependent service info and warnings, taskmaster/API incompatibility, FTP secret propagation, and filer security-context rendering and validation.

  • tests/test_chart.py L1878-1910, L2723-2775, L3967-4055 (+15 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 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1cfbf85) to head (6225b88).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #309   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          422       422           
=========================================
  Hits           422       422           

☔ 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
uniqueg marked this pull request as ready for review November 16, 2026 12:50
@sourcery-ai

sourcery-ai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Linked issues

Checked at commit 6225b88

#308 build: use tesk-api 2.0.0 in the chart · 7 of 8 met

# Requirement Status Notes
1 Set the API appVersion to 2.0.0 and default taskmaster and filer images to 0.12.0. ✅ Met
2 Warn about auth.tokenClients with tesk-api before 2.0.0, with tests. ✅ Met
3 Pin the tesk-api and tesk-core docs to their new releases so the specified links resolve on tesk.readthedocs.io. ✅ Met
4 Document that the upgrade order is safe with the chart defaults and document the new default images. ✅ Met
5 Report TES 1.1.0 in service info with tesk-api 2.0.0 and later. ✅ Met
6 Allow configuring the filer's pod and container security contexts for taskmaster 0.12.0. ✅ Met
7 Pass the FTP secret name to taskmasters so filer jobs can reference the secret. ✅ Met
8 Warn about taskmaster 0.12.0 or later with tesk-api before 2.0.0. 🟡 Partly met The compatibility check catches this pair and reports why it is unsupported, but it fails rendering instead of issuing the requested chart note warning.

@sourcery-ai sourcery-ai Bot left a comment

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.

Hey - I've found 2 issues

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

## Individual Comments

### Comment 1
<location path="charts/tesk/templates/_helpers.tpl" line_range="104" />
<code_context>
+`version` (X.Y.Z) */ -}}
+{{- define "tesk.apiBefore" -}}
+{{- $apiTag := include "tesk.apiImageTag" .root | trimPrefix "v" -}}
+{{- if and (regexMatch "^[0-9]+\\.[0-9]+(\\.[0-9]+)?([-+][0-9A-Za-z.+-]*)?$" $apiTag) (semverCompare (printf "<%s-0" .version) $apiTag) -}}
+true
+{{- end -}}
</code_context>
<issue_to_address>
**Malformed tags stop chart rendering**

When an API or taskmaster image tag is version-shaped but has invalid SemVer syntax, such as `1.2.3-`, `0.12.0+` or `0.12.0-foo..bar`, and the chart renders its built-in service info, `regexMatch` accepts these tags, so `semverCompare` receives them and errors; Helm fails to render the chart instead of treating the tags as unchecked.

Tighten the regex or otherwise validate the tag before calling `semverCompare`.

Also at `charts/tesk/templates/_helpers.tpl:386`.
</issue_to_address>

### Comment 2
<location path="charts/tesk/templates/common/tesk-deployment.yaml" line_range="133" />
<code_context>
+          "podSecurityContext" "TESK_API_TASKMASTER_ENVIRONMENT_FILER_POD_SECURITY_CONTEXT"
+          "securityContext" "TESK_API_TASKMASTER_ENVIRONMENT_FILER_SECURITY_CONTEXT" }}
+        {{- $context := get $filer $key }}
+        {{- if kindIs "map" $context }}
+        - name: {{ $variable }}
+          value: {{ toJson $context | quote }}
</code_context>
<issue_to_address>
**Invalid filer contexts reach task creation**

When a `tesk.filer.podSecurityContext` or `tesk.filer.securityContext` map contains an invalid field or value, the chart accepts any map and passes it through as JSON, so a typo or invalid field type reaches the taskmaster instead of failing validation during installation; filer pods then fail to be created and tasks with inputs fail.

Validate the supported Kubernetes context fields and value types in the chart schema, or document that validation is deferred to task submission.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 2 findings to address first, and the chart now rolls deployments onto new API and taskmaster/filer versions, changing task execution and filer security behavior; a regression could leave incorrect task states or failed task outputs that remain after rollback. Reverting restores the old images, but affected tasks may need to be rerun.

Blocking findings: charts/tesk/templates/_helpers.tpl:104, charts/tesk/templates/common/tesk-deployment.yaml:133


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

Comment thread charts/tesk/templates/_helpers.tpl Resolved
Tags that look like versions but aren't SemVer (e.g. 1.2.3- or
0.12.0-foo..bar) made semverCompare fail the render. The API and
taskmaster checks now accept only SemVer pre-release and build parts,
and treat other tags as tags that aren't versions. Docs: the taskmaster
checks the filer's security contexts and falls back to its defaults.

Refs #308

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Taskmaster 0.12.0 and later with tesk-api before 2.0.0 report wrong
task states, e.g. after an upgrade with values that pin an older
tesk.image.tag but not the taskmaster. The installation now fails for
such a pair instead of the notes warning about it.

The version checks accept only SemVer that semverCompare reads as
written (no leading zeros in numbers and numeric pre-release parts), so
tags such as 01.2.3 or 1.2.3-01 count as tags that aren't versions.

Refs #308

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@sourcery-ai sourcery-ai Bot left a comment

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.

New gaps against the linked issues

Comment thread charts/tesk/templates/_helpers.tpl Resolved
@uniqueg
uniqueg merged commit 69e48fe into dev Nov 16, 2026
31 checks passed
@uniqueg
uniqueg deleted the build/308-tesk-api-2.0.0 branch November 16, 2026 15:36
uniqueg added a commit that referenced this pull request Nov 16, 2026
dev only adds the squash of #309, already merged here (tree of
6225b88 equals dev), so the branch tree is kept.
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.

build: use tesk-api 2.0.0 in the chart

1 participant