Repository navigation
feat: drop unsupported backend_parameters - #147
Conversation
TES 1.1 says that backends neither store nor return unsupported backend_parameters keys and log a warning about them. TESK supports none: remove them from the task before it is stored (annotation and ConfigMap), note their keys in the annotation ignored-backend-parameters of the taskmaster's job, log a warning and return it in logs[0].system_logs with the view FULL. Stored tasks of earlier versions don't return them either. Service info gets tesResources_backend_parameters, which the YAML file can now set (SnakeYAML maps the key to the Java property); the built-in file sets it to []. Closes #145 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Keep HTML characters in the quoted keys, put the warning after the taskmaster's log in system_logs, warn if a service info file lists backend parameters, and restructure the docs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Reviewer's GuideData structuresAdd TES resource accessors for backend parameters and strictness, and include both fields in value semantics.
ImplementationRemove unsupported parameters, preserve their sorted keys in taskmaster-job metadata, and derive the warning used for logs.
Map the TES service-info YAML property and normalize the reported supported-key list to empty, warning when configuration lists unsupported keys.
DocumentationDocument how TESK drops unsupported backend parameters, reports ignored keys, and advertises its empty supported-key list.
TestsTest removal, key annotation and warning formatting for ignored backend parameters.
Test that legacy tasks do not return previously stored backend parameters.
Test that the service-info API returns an empty supported backend-parameter list.
Test service-info YAML parsing, warnings, normalization, and model value semantics.
Test that creation strips parameters, records their keys, warns without values, and retains the annotation across retries.
Test FULL-view system-log ordering and ensure BASIC view omits the warning.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #147 +/- ##
==========================================
+ Coverage 70.49% 72.52% +2.02%
==========================================
Files 67 68 +1
Lines 2827 2883 +56
Branches 312 318 +6
==========================================
+ Hits 1993 2091 +98
+ Misses 690 651 -39
+ Partials 144 141 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Linked issuesChecked at commit 1f363a0 #145 feat: drop unsupported backend_parameters · 4 of 4 met
|
There was a problem hiding this comment.
Hey - I've found 3 issues
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/tes/service/TesServiceImpl.java" line_range="81-82" />
<code_context>
}
V1Job taskMasterJob = this.converter.fromTesTaskToK8sJob(task, user);
+ IgnoredBackendParameters.annotate(
+ taskMasterJob.getMetadata(), ignoredBackendParameters);
V1ConfigMap taskMasterConfigMap =
this.converter.fromTesTaskToK8sConfigMap(task, user, taskMasterJob);
</code_context>
<issue_to_address>
**Large key lists reject task creation**
When a task is near Kubernetes' annotation-size limit and the added serialized key list pushes its Job annotations over that limit, the ignored-key annotation duplicates backend-parameter keys that were removed from `json-input`; when the resulting Job annotations exceed Kubernetes' annotation-size limit, `createJob` is rejected and the caller sees task creation fail. The ConfigMap dry run does not validate the Job annotations, and there is no size guard before `createJob`.
Account for the added annotation when validating the Job, or avoid duplicating keys in annotations when they would exceed Kubernetes' limit.
</issue_to_address>
### Comment 2
<location path="src/main/java/uk/ac/ebi/tsc/tesk/tes/service/ServiceInfoService.java" line_range="55-57" />
<code_context>
Yaml yaml = new Yaml(new OffsetDateTimePropertyConstructor());
try (InputStream is = resourceFile.getInputStream()) {
serviceInfo = yaml.loadAs(is, TesServiceInfo.class);
+ List<String> backendParameters = serviceInfo.getTesResourcesBackendParameters();
+ if (backendParameters != null && !backendParameters.isEmpty()) {
+ log.warn(
+ "Service info lists tesResources_backend_parameters, but TESK supports"
+ + " none and ignores them in tasks; set it to []");
</code_context>
<issue_to_address>
**Unsupported keys appear supported**
When the service-info YAML lists one or more backend parameter keys, `loadYaml` retains the list after logging a warning, and `getServiceInfo` returns it unchanged, so `/service-info` advertises keys that task creation ignores and clients can rely on unsupported parameters.
Clear the backend-parameter list before returning the service info, or omit it from the response.
Also at `src/main/java/uk/ac/ebi/tsc/tesk/tes/model/TesServiceInfo.java:62-64`.
</issue_to_address>
### Comment 3
<location path="src/main/java/uk/ac/ebi/tsc/tesk/tes/service/TesServiceImpl.java" line_range="99-104" />
<code_context>
}
V1Job createdJob = this.kubernetesClientWrapper.createJob(taskMasterJob);
this.createOwnedResources(taskMasterConfigMap, imagePullSecrets, createdJob);
+ // only for tasks that exist: a failed create leaves no task to warn about
+ if (!ignoredBackendParameters.isEmpty()) {
+ logger.warn(
+ "Task {}: {}",
+ createdJob.getMetadata().getName(),
+ IgnoredBackendParameters.message(ignoredBackendParameters));
+ }
return this.converter.fromK8sJobToTesCreateTaskResponse(createdJob);
</code_context>
<issue_to_address>
**Failed tasks lack creation warnings**
When owned ConfigMap or Secret creation fails after the taskmaster job is created, `createOwnedResources` throws before `logger.warn` runs, so the creation warning is absent even when the taskmaster job is left behind.
Log the ignored-key warning on the failure path whenever the taskmaster job has already been created.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 3 findings to address first, and task creation removes the submitted backend-parameter map before it is persisted, so those values cannot be recovered from tasks created while this change is live. Reverting restores future behavior but does not restore values already omitted from existing tasks.
Blocking findings: src/main/java/uk/ac/ebi/tsc/tesk/tes/service/TesServiceImpl.java:82, src/main/java/uk/ac/ebi/tsc/tesk/tes/service/ServiceInfoService.java:57, src/main/java/uk/ac/ebi/tsc/tesk/tes/service/TesServiceImpl.java:104
Service info reports tesResources_backend_parameters as [] whatever the YAML file lists, as TESK supports none (Sourcery review). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Codecov's patch target is 100%: cover the accessors and equality of the backend parameters in TesResources and TesServiceInfo. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Summary
TES 1.1 says three things about
resources.backend_parameters: service info lists the keys a backend supports, backends log a warning for unsupported keys, and they don't store or return them. TESK supports no keys. This PR:POST /tasksremovesbackend_parametersfrom the task before it is converted. They are no longer in the taskmaster job'sjson-inputannotation, its ConfigMap or any response, also on retries after a job name collision. Strict tasks are still refused with400(feat: accept the task fields of TES 1.1 #133).ignored-backend-parameters(a JSON array). A warning naming them is logged when the task is created. With the viewFULL, it is also returned inlogs[0].system_logs, after the taskmaster's log:Ignored backend_parameters, which TESK doesn't support: ["VmSize"]. Keys are quoted as JSON without HTML escaping, so the message stays on one line whatever the keys are.TesServiceInfohastesResources_backend_parameters. SnakeYAML now maps that key to the Java property; before, a file with the key failed to load. The built-inservice-info.yamlsets it to[]. Service info always reports[], whatever the file lists; a file that lists keys logs a warning on every load and reload.TesResourcesgets accessors forbackend_parametersandbackend_parameters_strict, and both now count inequals/hashCode/toString.docs/api.md("TES 1.1 fields", "Service info") anddocs/configuration.md("Service info").Verification
Run locally on JDK 8 (
eclipse-temurin:8-jdkcontainer) with Maven 3.10.0, the wrapper's version:mvn -B spotless:check checkstyle:check clean verify: BUILD SUCCESS. Unit tests: 11962 run, 0 failures. Integration tests: 84 run, 0 failures.mkdocs build --strict(Python 3.13,docs/requirements.txt): built with no warnings.IgnoredBackendParametersTestTesServiceImplSystemLogsTest(views FULL and BASIC)TesServiceImplCreateTest: parameters removed before conversion, annotation, warning without values, retryTesKubernetesConverterTest#fromK8sToTask_dropsStoredBackendParametersServiceInfoServiceTest#getServiceInfo_backendParameters: loads a file with the key, reports[], warnsServiceInfoApiControllerTest#getServiceInfo_listsNoBackendParametersCI on 1f363a0: all checks passed (CI passed, Lint, Test, Docs, Smoke test, Scan image, CodeQL, codecov project and patch, Sourcery). The 30 open Trivy alerts listed for this PR are image dependency findings that dev already has (Spring 5.3, Bouncy Castle 1.70 and others); this PR changes no dependencies.
Declined review findings
backend_parametersare no longer stored or returned.system_logs.tesResources_backend_parameters; operators should keep it at[].ignored-backend-parametersannotation (quality, low): it holds only the keys, andjson-inputno longer holds them, so the job's annotations are never larger than before.task.getLogs().get(0)(quality, low): the basic conversion always adds that log, and the line above uses it the same way.Fixed after the reviews:
Sourcery threads (all answered and resolved):
[](adf8671).dev, as the keys move out ofjson-input.Open questions
None.
Closes #145
🤖 Generated with Claude Code
https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV