Skip to content

chore(ecc-utils-ga4gh-tes): tes migration - #516

Merged
anuragxxd merged 23 commits into
devfrom
chore/tes-migration
Nov 13, 2026
Merged

anuragxxd merged 23 commits into
devfrom
chore/tes-migration

Conversation

@salihudickson

@salihudickson salihudickson commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Migrate @elixir-cloud/tes package to the v2 architecture

Closes #443

Verification

Declined review findings

Open questions

Checklist

  • Tests are added or updated where the change affects behaviour, and
    pass.
  • The documentation is updated where the change affects it.
  • The title follows Conventional
    Commits
    (at most 50 characters,
    imperative mood, no trailing period).

Summary by Sourcery

Migrate the TES package to the v2 provider architecture and modernize its components, APIs, styling, documentation, and test coverage.

New Features:

  • Add provider-based TES integrations with TesProvider and RestTesProvider, including injectable custom providers and typed task-related events.
  • Introduce the ecc-client-ga4gh-tes-run task-detail component alongside the renamed run-creation component.
  • Support task creation, monitoring, filtering, pagination, cancellation, and detailed task views through the updated TES components.

Bug Fixes:

  • Fix Tailwind border utilities in shadow roots and improve theme-aware, accessible success messaging for WES and TES components.

Enhancements:

  • Migrate the TES package to the v2 architecture with updated component names, package exports, API properties, GA4GH TES types, and design-system styling.

Build:

  • Update TES build, development, testing, TypeScript, and Tailwind tooling for the new architecture.

Documentation:

  • Add documentation for TES components, providers, APIs, usage, events, and breaking changes.

Tests:

  • Add comprehensive component, provider integration, validation, event, pagination, cancellation, and design consistency tests for TES.

Chores:

  • Enable the TES package in release handling and update shared lint configuration for type-aware definitions.

@salihudickson
salihudickson requested a balanced review from Copilot October 29, 2026 22:17
@sourcery-ai

sourcery-ai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Data structures

Define the TES task, state, provider, and service-info types that underpin the migrated components and public provider API.

  • packages/ecc-client-ga4gh-tes/src/providers/tes-provider.ts L1-189

API

Expose the REST provider and TES component entry points, including the renamed run-create element and new run-detail element.

  • packages/ecc-client-ga4gh-tes/package.json L15-22, L36-50 (+5 small edits)
  • packages/ecc-client-ga4gh-tes/src/components/run-create/index.ts L1-15
  • packages/ecc-client-ga4gh-tes/src/components/run/index.ts L1-12
  • packages/ecc-client-ga4gh-tes/src/events/ecc-run-create-failed.ts L1-7
  • packages/ecc-client-ga4gh-tes/src/events/ecc-run-create-reset.ts L1-7
  • packages/ecc-client-ga4gh-tes/src/events/ecc-run-log-changed.ts L1-8
  • packages/ecc-client-ga4gh-tes/src/events/ecc-run-submitted.ts L1-7
  • packages/ecc-client-ga4gh-tes/src/events/ecc-runs-changed.ts L1-7
  • packages/ecc-client-ga4gh-tes/src/events/ecc-runs-selected.ts L1-7
  • packages/ecc-client-ga4gh-tes/src/events/index.ts L1-6
  • packages/ecc-client-ga4gh-tes/src/providers/index.ts L1-2
  • packages/ecc-client-ga4gh-tes/src/providers/rest-tes-provider.ts L1-103
  • packages/ecc-client-ga4gh-wes/src/events/ecc-run-log-changed.ts L1-7

Add accessible-name properties to design input and textarea primitives so callers can label native controls across shadow roots.

  • packages/ecc-utils-design/src/components/input/input.ts L3, L40-41, L52
  • packages/ecc-utils-design/src/components/textarea/textarea.ts L3, L22-23, L36

Record the TES major migration and the design primitive accessibility patch in release changesets.

  • .changeset/design-input-label.md L1-5
  • .changeset/tes-providers-architecture.md L1-17

Uses of the API

Implement the run list against TesProvider, including filtering, pagination, task selection, and cancellation.

  • packages/ecc-client-ga4gh-tes/src/components/runs/runs.ts L1-481

Implementation

Provide shared TES component theme tokens and shadow-root Tailwind base styles for the new component implementation.

  • packages/ecc-client-ga4gh-tes/src/global.ts L1-202
  • packages/ecc-client-ga4gh-tes/src/tailwind.css L1-84
  • packages/ecc-client-ga4gh-wes/src/tailwind.css L35-80

UI

Build the renamed run-creation form with provider submission, validation, accessible controls, and status messaging.

  • packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts L1-846

Add a TES task-detail view with overview, executor, file, log, and cancellation interfaces.

  • packages/ecc-client-ga4gh-tes/src/components/run/run.ts L1-590

Update the WES run-creation success message to use theme-aware coloring and screen-reader status announcement.

  • packages/ecc-client-ga4gh-wes/src/components/run-create/run-create.ts L50-55, L755-759

Configuration

Configure the TES package build, test, TypeScript, and development tooling for the migrated architecture.

  • packages/ecc-client-ga4gh-tes/.eslintignore L1-8, L25-27
  • packages/ecc-client-ga4gh-tes/.eslintrc L2-5
  • packages/ecc-client-ga4gh-tes/.gitignore L1-15, L33, L38-46
  • packages/ecc-client-ga4gh-tes/demo/index.html L2-27
  • packages/ecc-client-ga4gh-tes/demo/run-create/index.html L1-25
  • packages/ecc-client-ga4gh-tes/demo/run/index.html L1-25
  • packages/ecc-client-ga4gh-tes/demo/runs/index.html L2-22
  • packages/ecc-client-ga4gh-tes/tsconfig.json L4-5
  • packages/ecc-client-ga4gh-tes/web-test-runner.config.mjs L30
  • web-test.runner-config.mjs L6
  • packages/ecc-client-ga4gh-tes/assets/delete.svg (deleted)
  • packages/ecc-client-ga4gh-tes/demo/create-run/index.html (deleted)
  • packages/ecc-client-ga4gh-tes/src/API/Task/README.md (deleted)
  • packages/ecc-client-ga4gh-tes/src/API/Task/tesGet.ts (deleted)
  • packages/ecc-client-ga4gh-tes/src/API/index.ts (deleted)
  • packages/ecc-client-ga4gh-tes/src/components/create-run/create-run.ts (deleted)
  • packages/ecc-client-ga4gh-tes/src/components/create-run/create-runs.styles.ts (deleted)
  • packages/ecc-client-ga4gh-tes/src/components/create-run/index.ts (deleted)
  • packages/ecc-client-ga4gh-tes/src/components/create-run/create-run.test.ts

Adjust shared lint rules to handle type-aware use-before-definition checks.

  • packages/eslint-config-elixir/index.js L19-24

Documentation

Document the TES v2 package, its components, provider interface, usage patterns, and migration-facing APIs.

  • apps/documentation/pages/docs/_meta.json L42-47, L58 (removed lines)
  • apps/documentation/pages/docs/tes/_meta.json L1-5
  • apps/documentation/pages/docs/tes/components/_meta.json L1-5
  • apps/documentation/pages/docs/tes/components/run-create.mdx L1-58
  • apps/documentation/pages/docs/tes/components/run.mdx L1-57
  • apps/documentation/pages/docs/tes/components/runs.mdx L1-61
  • apps/documentation/pages/docs/tes/introduction.mdx L1-22
  • apps/documentation/pages/docs/tes/providers.mdx L1-492

Tests

Exercise the new run-create form behavior, request mapping, validation, events, and accessible control naming.

  • packages/ecc-client-ga4gh-tes/src/components/design.test.ts L1-49
  • packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.test.ts L1-581

Verify TES task-list provider loading, filtering, pagination, cancellation, and error handling.

  • packages/ecc-client-ga4gh-tes/src/components/runs/runs.test.ts L1-348

Update release-script expectations now that TES participates in package releases.

  • scripts/release.test.js L458

Lock files and vendored code

Regenerate the dependency lockfile for the migrated TES package and updated tooling.

  • package-lock.json L32208-33040, L33345-33381, L33572-33799 (+8 small edits)

Other changes

Files not grouped.

  • .changeset/wes-shadow-borders.md L1-5
  • packages/ecc-client-ga4gh-tes/src/components/index.ts L1-3
  • packages/ecc-client-ga4gh-wes/src/components/run/run.ts L11, L31, L138-145

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

Copilot AI 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.

🟡 Changes recommended

Unresolved request races can overwrite current data and cancel the wrong task, and the mock API cannot start because its server implementation is missing.

9 open issues
What changed in this PR

Migrates @elixir-cloud/tes to the v2 provider architecture described in #443, aligning TES integration with the other client packages.

Changes:

  • Introduces a TES provider interface, REST implementation, API models, and event exports.
  • Replaces legacy components with task listing, detail, and creation views using shared design primitives and Tailwind styling.
  • Updates package exports, build tooling, demos, documentation navigation, and provider-backed listing tests.
File Description
packages/​mock-api/​package.json Adds mock-service package metadata and start scripts.
packages/​ecc-client-ga4gh-tes/​web-test-runner.config.mjs Sets the test transformation target to ES2020.
packages/​ecc-client-ga4gh-tes/​tsconfig.json Switches to Node16 module resolution.
packages/​ecc-client-ga4gh-tes/​src/​tailwind.css Defines Tailwind theme mappings and variants.
packages/​ecc-client-ga4gh-tes/​src/​providers/​tes-provider.ts Defines TES models and provider operations.
packages/​ecc-client-ga4gh-tes/​src/​providers/​rest-tes-provider.ts Implements REST-backed TES operations.
packages/​ecc-client-ga4gh-tes/​src/​providers/​index.ts Exports provider APIs.
packages/​ecc-client-ga4gh-tes/​src/​global.ts Adds shared light and dark theme tokens.
packages/​ecc-client-ga4gh-tes/​src/​events/​index.ts Exports component event types.
packages/​ecc-client-ga4gh-tes/​src/​events/​ecc-runs-selected.ts Declares the task-selection event type.
packages/​ecc-client-ga4gh-tes/​src/​events/​ecc-runs-changed.ts Declares the task-list change event type.
packages/​ecc-client-ga4gh-tes/​src/​events/​ecc-run-submitted.ts Declares the task-submission event type.
packages/​ecc-client-ga4gh-tes/​src/​events/​ecc-run-log-changed.ts Declares the task-data change event type.
packages/​ecc-client-ga4gh-tes/​src/​events/​ecc-run-create-reset.ts Declares the creation-form reset event type.
packages/​ecc-client-ga4gh-tes/​src/​events/​ecc-run-create-failed.ts Declares the task-creation failure event type.
packages/​ecc-client-ga4gh-tes/​src/​components/​runs/​runs.ts Rebuilds listing with providers, filters, pagination, and cancellation.
packages/​ecc-client-ga4gh-tes/​src/​components/​runs/​runs.test.ts Tests provider-backed listing, selection, and cancellation.
packages/​ecc-client-ga4gh-tes/​src/​components/​run/​run.ts Adds task details, logs, and cancellation.
packages/​ecc-client-ga4gh-tes/​src/​components/​run/​index.ts Registers the task-detail element.
packages/​ecc-client-ga4gh-tes/​src/​components/​run-create/​run-create.ts Adds the provider-backed task-creation form.
packages/​ecc-client-ga4gh-tes/​src/​components/​run-create/​index.ts Registers the new task-creation element.
packages/​ecc-client-ga4gh-tes/​src/​components/​index.ts Loads all migrated component registrations.
packages/​ecc-client-ga4gh-tes/​src/​components/​create-run/​index.ts Removes the legacy creation-element registration.
packages/​ecc-client-ga4gh-tes/​src/​components/​create-run/​create-runs.styles.ts Removes the legacy style placeholder.
packages/​ecc-client-ga4gh-tes/​src/​components/​create-run/​create-run.ts Removes the legacy creation component.
packages/​ecc-client-ga4gh-tes/​src/​components/​create-run/​create-run.test.ts Legacy creation-test file; no diff supplied.
packages/​ecc-client-ga4gh-tes/​src/​API/​Task/​tesGet.ts Removes API helpers superseded by providers.
packages/​ecc-client-ga4gh-tes/​src/​API/​Task/​README.md Removes legacy helper documentation.
packages/​ecc-client-ga4gh-tes/​src/​API/​index.ts Removes the legacy API entry point.
packages/​ecc-client-ga4gh-tes/​package.json Updates release version, exports, dependencies, and scripts.
packages/​ecc-client-ga4gh-tes/​demo/​runs/​index.html Updates the listing demo and detail navigation.
packages/​ecc-client-ga4gh-tes/​demo/​run/​index.html Adds a task-detail demo.
packages/​ecc-client-ga4gh-tes/​demo/​run-create/​index.html Adds a task-creation demo.
packages/​ecc-client-ga4gh-tes/​demo/​index.html Updates links to the migrated demos.
packages/​ecc-client-ga4gh-tes/​demo/​create-run/​index.html Removes the legacy creation demo.
packages/​ecc-client-ga4gh-tes/​assets/​delete.svg Removes the legacy delete icon.
packages/​ecc-client-ga4gh-tes/​.gitignore Excludes generated styles and build artifacts.
packages/​ecc-client-ga4gh-tes/​.eslintrc Adjusts package lint rules.
packages/​ecc-client-ga4gh-tes/​.eslintignore Excludes generated styling files from linting.
package-lock.json Records updated TES dependencies.
apps/​documentation/​pages/​docs/​tes/​components/​_meta.json Adds TES component navigation labels.
apps/​documentation/​pages/​docs/​tes/​_meta.json Defines TES documentation navigation.
apps/​documentation/​pages/​docs/​_meta.json Adds the TES documentation section.
.changeset/​tes-providers-architecture.md Records the migration as a major package change.

Review effort: Balanced

Comment thread packages/mock-api/package.json Resolved
@salihudickson
salihudickson force-pushed the chore/tes-migration branch 2 times, most recently from cb56922 to f73f42b Compare October 30, 2026 20:17
@salihudickson salihudickson changed the title Chore/tes migration Chore(ecc-utils-ga4gh-tes): tes migration Oct 30, 2026
@salihudickson salihudickson changed the title Chore(ecc-utils-ga4gh-tes): tes migration chore(ecc-utils-ga4gh-tes): tes migration Oct 30, 2026
@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.75010% with 536 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.53%. Comparing base (1fa86b8) to head (4d381f0).

Files with missing lines Patch % Lines
...ges/ecc-client-ga4gh-tes/src/components/run/run.ts 22.88% 455 Missing ⚠️
...s/ecc-client-ga4gh-tes/src/components/runs/runs.ts 92.30% 32 Missing and 1 partial ⚠️
...lient-ga4gh-tes/src/providers/rest-tes-provider.ts 67.96% 33 Missing ⚠️
...ges/ecc-client-ga4gh-wes/src/components/run/run.ts 20.00% 8 Missing ⚠️
...-ga4gh-tes/src/components/run-create/run-create.ts 99.52% 3 Missing and 1 partial ⚠️
...-ga4gh-wes/src/components/run-create/run-create.ts 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #516      +/-   ##
==========================================
+ Coverage   71.40%   73.53%   +2.12%     
==========================================
  Files          23       33      +10     
  Lines        5655     8123    +2468     
  Branches      199      381     +182     
==========================================
+ Hits         4038     5973    +1935     
- Misses       1610     2141     +531     
- Partials        7        9       +2     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@salihudickson
salihudickson marked this pull request as ready for review November 1, 2026 14:28
@uniqueg uniqueg mentioned this pull request Nov 1, 2026
3 tasks

@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 11 issues

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

## Individual Comments

### Comment 1
<location path="packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts" line_range="733-736" />
<code_context>
+            Reset
+          </ecc-utils-design-button>
+          <ecc-utils-design-button
+            type="submit"
+            ?disabled=${this.submitting}
+            @click=${this.handleSubmit}
+          >
+            ${this.submitting ? "Submitting..." : "Submit Task"}
+          </ecc-utils-design-button>
</code_context>
<issue_to_address>
**Task submissions run twice**

When a user clicks Submit Task or another design button in the create form, the design button’s internal native `<button>` has no `type`, so it defaults to `submit` inside this form; the host’s `type` attribute does not set the internal button’s type. The submit button therefore calls `handleSubmit` from its click listener and again from the form’s submit handler, creating two tasks; Add controls also submit the form.

Make the design button forward its `type` property to the internal button, and handle submission through only one of the click or form-submit paths.

Also at `packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts:367-371`.
</issue_to_address>

### Comment 2
<location path="packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts" line_range="277" />
<code_context>
+---
+"@elixir-cloud/tes": major
+---
</code_context>
<issue_to_address>
**Retry can duplicate a created task**

When the TES service creates the task but the response is lost or the request times out, `createTask` can commit remotely before a network error reaches the component; the catch path reports failure and retains the form, so retrying posts the same task again. The caller can end up with duplicate tasks despite seeing a failed submission.

Use server-supported idempotency or provide a recovery path for ambiguous outcomes before allowing the same submission to be retried.
</issue_to_address>

### Comment 3
<location path="packages/ecc-client-ga4gh-tes/src/components/runs/runs.ts" line_range="104" />
<code_context>
+    } else if (this.baseUrl) {
+      this._provider = new RestTesProvider(this.baseUrl);
+    } else {
+      this.error =
+        "Please provide either a base URL for the TES API or a custom provider.";
+    }
</code_context>
<issue_to_address>
**Requests keep using the removed provider**

When the component has a configured source and its `provider` and `baseUrl` are later cleared, `initializeProvider()` records the missing-source error but leaves `_provider` set, so reset or reload still calls the old provider and can emit its data.

Clear `_provider` in the no-source branch of `initializeProvider()`.

Also at `packages/ecc-client-ga4gh-tes/src/components/run/run.ts:83-86`.
</issue_to_address>

### Comment 4
<location path="packages/ecc-client-ga4gh-tes/src/components/run/run.ts" line_range="79-86" />
<code_context>
+  }
+
+  private initializeProvider(): void {
+    if (this.provider) {
+      this._provider = this.provider;
+    } else if (this.baseUrl) {
+      this._provider = new RestTesProvider(this.baseUrl);
+    } else {
+      this.error =
+        "Please provide either a base URL for the TES API or a custom provider.";
+    }
+  }
+
</code_context>
<issue_to_address>
**Requests keep using the removed provider**

When the component's configured provider and base URL are later cleared, `initializeProvider()` sets an error but leaves `_provider` set, so `loadTask()` or `loadData()` still calls the old provider and requests continue to the removed service.

Clear `_provider` in the no-source branch of `initializeProvider()`.

Also at `packages/ecc-client-ga4gh-tes/src/components/runs/runs.ts:98-106`.
</issue_to_address>

### Comment 5
<location path="packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts" line_range="243-244" />
<code_context>
+      this.form[key].filter((r) => r.path?.trim() || r.url?.trim());
+    for (const [i, r] of rows("inputs").entries()) {
+      if (!r.path?.trim()) return `Input ${i + 1}: path is required`;
+      if (!r.url?.trim()) return `Input ${i + 1}: url is required`;
+    }
+    for (const [i, r] of rows("outputs").entries()) {
+      if (!r.path?.trim()) return `Output ${i + 1}: path is required`;
</code_context>
<issue_to_address>
**Valid inline inputs are rejected**

When a task input supplies inline `content` without a URL, `validate()` requires every input to have a URL, and the form provides no content field, so a valid TES input is rejected before `createTask` is called.

Expose inline content in the form and accept either a URL or content when validating inputs.

Also at `packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts:636-640`.
</issue_to_address>

### Comment 6
<location path="packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts" line_range="246-247" />
<code_context>
+      if (!r.url?.trim()) return `Input ${i + 1}: url is required`;
+    }
+    for (const [i, r] of rows("outputs").entries()) {
+      if (!r.path?.trim()) return `Output ${i + 1}: path is required`;
+      if (!r.url?.trim()) return `Output ${i + 1}: url is required`;
+    }
+    const badType = [...rows("inputs"), ...rows("outputs")].find(
</code_context>
<issue_to_address>
**Wildcard outputs fail TES validation**

When an output path contains wildcards and its path prefix is empty, `validate()` checks the output path and URL but not its path prefix, so the request reaches the provider without a required prefix and the TES server rejects task creation.

Reject wildcard output paths unless a path prefix is provided.

Also at `packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts:645`.
</issue_to_address>

### Comment 7
<location path="packages/ecc-client-ga4gh-tes/src/providers/rest-tes-provider.ts" line_range="29-30" />
<code_context>
+   * headers (e.g. `Authorization`) or otherwise change requests.
+   */
+  // eslint-disable-next-line class-methods-use-this
+  protected fetch(input: RequestInfo | URL, init?: RequestInit) {
+    return fetch(input, init);
+  }
+
</code_context>
<issue_to_address>
**Hung requests never resolve**

When the TES endpoint or network connection stalls without closing, `fetch()` has no timeout or abort signal, so a TES endpoint that accepts a connection but never responds leaves list, detail, submission, or cancellation operations pending indefinitely; components remain loading or submitting without a result.

Apply a configurable request deadline with an abort signal and surface timeout failures to callers.
</issue_to_address>

### Comment 8
<location path="packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts" line_range="250" />
<code_context>
+      if (!r.url?.trim()) return `Output ${i + 1}: url is required`;
+    }
+    const badType = [...rows("inputs"), ...rows("outputs")].find(
+      (r) => r.type && !["FILE", "DIRECTORY"].includes(r.type.trim())
+    );
+    if (badType) return "Type must be FILE or DIRECTORY";
</code_context>
<issue_to_address>
**Padded file types pass validation**

When a user enters or pastes whitespace around `FILE` or `DIRECTORY`, the type check trims the value only for comparison, while `buildRequest` preserves the original row value. A value such as ` FILE ` therefore passes validation but is sent as an invalid TES enum, and the server rejects the task.

Normalize the type value in the request builder or reject values that are not exactly valid enum strings.

Also at `packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts:210`.
</issue_to_address>

### Comment 9
<location path="packages/ecc-client-ga4gh-tes/src/events/ecc-run-submitted.ts" line_range="1" />
<code_context>
+export type EccRunSubmittedEvent = CustomEvent<Record<string, any>>;
+
+declare global {
</code_context>
<issue_to_address>
**Event details accept arbitrary fields**

When a TypeScript consumer reads an event's detail, the exported event types use `CustomEvent<Record<string, any>>`, so TypeScript accepts misspelled or nonexistent payload fields instead of checking the event-specific contract.

Give each exported event type its specific detail shape.

Also at `packages/ecc-client-ga4gh-tes/src/events/ecc-run-create-failed.ts:1`, `packages/ecc-client-ga4gh-tes/src/events/ecc-run-create-reset.ts:1`, `packages/ecc-client-ga4gh-tes/src/events/ecc-run-log-changed.ts:1`, `packages/ecc-client-ga4gh-tes/src/events/ecc-runs-changed.ts:1`, `packages/ecc-client-ga4gh-tes/src/events/ecc-runs-selected.ts:1`.
</issue_to_address>

### Comment 10
<location path="apps/documentation/pages/docs/tes/providers.mdx" line_range="406" />
<code_context>
+import type { TesProvider } from '@elixir-cloud/tes/providers';
+
+const provider: TesProvider = {
+  getServiceInfo: async () => ({}),
+  listTasks: async () => ({ tasks: [] }),
+  getTask: async (id) => ({ id, state: 'QUEUED' }),
</code_context>
<issue_to_address>
**Provider example fails type-checking**

When a reader copies the documented provider example, `getServiceInfo` returns `{}`, which lacks required `ServiceInfo` fields, so TypeScript rejects the `TesProvider` literal and users cannot copy the example.

Return a `ServiceInfo` object with all required fields from `getServiceInfo`.
</issue_to_address>

### Comment 11
<location path="apps/documentation/pages/docs/tes/components/runs.mdx" line_range="54" />
<code_context>
+| `provider` | `TesProvider` | `undefined` | Custom provider; overrides `baseUrl` (see [Providers](/docs/tes/providers)). |
+| `pageSize` | `number`      | `10`    | Tasks per page. |
+| `search`   | `boolean`     | `true`  | Show the name-prefix search field. |
+| `filter`   | `boolean`     | `true`  | Show the state filter (applies to the current page). |
+
+## Events
</code_context>
<issue_to_address>
**Filter scope is documented incorrectly**

The table says the state filter applies only to the current page, but the component sends `state` to `listTasks` and resets pagination when it changes; consumers are told to expect different filtering behavior than the implementation provides.

Update the description to state that the filter is sent to the provider and reloads the task list.
</issue_to_address>

Linked issues

#443 Cloud Components: migrate `@elixir-cloud/tes` to the v2 provider architecture · 7 of 8 met · 1 to check by hand

# Requirement Status Notes
1 Add the TES provider interface, REST implementation, and events/ ✅ Met The provider interface and REST implementation are in src/providers/, and event types are added under src/events/.
2 Port the runs and create-run components to use the provider ✅ Met The listing and task-creation components use a custom provider or construct a RestTesProvider from baseUrl; a task-detail component is also added.
3 Keep element names stable or document breaking changes ✅ Met The create-run element is renamed, and the changeset documents the old and new names.
4 Align property naming with WES: baseUrl ✅ Met The components use baseUrl.
5 Bump to the 2.0.0-alpha line and update the docs app ✅ Met The package version is 2.0.0-alpha.49, and TES documentation pages are added.
6 Components accept either baseUrl or a custom provider ✅ Met Both options are supported, with the custom provider taking precedence when both are set.
7 Existing tests pass or are ported ✅ Met Tests are added for the migrated task-list and task-creation components, including provider and baseUrl paths.
8 The docs app demo works against a public TES 👀 Check by hand (runtime) Run the docs examples against the configured public TES endpoint and confirm the demo can load or submit tasks.

Sourcery assessment

Needs a human reviewer. 9 findings to address first, and the new form sends task requests to a TES service, where an incorrect request can start workloads, consume compute, or write outputs; reverting the package does not undo tasks that have already run or their effects. The provider migration also promotes @lit/react to a runtime dependency.

Blocking findings: packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts:736, packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts:277, packages/ecc-client-ga4gh-tes/src/components/runs/runs.ts:104, packages/ecc-client-ga4gh-tes/src/components/run/run.ts:86, packages/ecc-client-ga4gh-tes/src/components/run-create/run-create.ts:244, and 4 more


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

@anuragxxd

Copy link
Copy Markdown
Member

Awesome work on the TES migration! The provider injection, authentication hook, and REST endpoints look consistent with the other components and TES 1.1. A few things to tighten up:

  • The cancellation action should say “Cancel”, not “Delete”—it stops execution without deleting the task.
  • TES and WES share ecc-run-log-changed, but send different payloads (task vs runLog). Let’s clarify that contract and add explicit event types so consumers don’t have to guess.
  • Clear the previous service’s tasks when switching providers. If the new request fails, old tasks can reappear with cancellation actions pointing at the new service.
  • Validate integer CPU counts, finite resource values, and absolute input/output and stdin/stdout/stderr paths.
  • Restrict the service artifact type to "tes" and validate pageSize as an integer below 2048.
  • Small nit: update the REST provider’s version comment from TES 1.0.0 to 1.1.0.

@sourcery-ai

sourcery-ai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Linked issues

Checked at commit 2507b7c

#443 Cloud Components: migrate `@elixir-cloud/tes` to the v2 provider architecture · 7 of 8 met · 1 to check by hand

# Requirement Status Notes
1 Mirror the WES providers/events layout with a TES provider interface and REST implementation. ✅ Met The PR adds providers/tes-provider.ts, providers/rest-tes-provider.ts, and an events/ directory.
2 Port runs and create-run to the provider. ✅ Met The listing, detail, and creation components use TesProvider operations, with RestTesProvider used when baseUrl is supplied.
3 Keep element names stable, or document the breaking change. ✅ Met The changeset documents renaming <ecc-client-ga4gh-tes-create-run> to <ecc-client-ga4gh-tes-run-create>.
4 Align property naming with WES (baseUrl). ✅ Met TES components expose baseUrl; the changeset also documents the replacement of baseURL.
5 Bump to the 2.0.0-alpha line and update the docs app. ✅ Met The TES package version is 2.0.0-alpha.50, and the docs app gains TES introduction, provider, and component pages.
6 Have TES components accept either baseUrl or a custom provider. ✅ Met The runs, run-detail, and run-create components support both; their provider selection gives a supplied custom provider precedence.
7 Have existing tests pass or be ported. ✅ Met The PR adds provider-based component tests for runs and run creation, along with a design test.
8 Have the docs app demo work against a public TES. 👀 Check by hand (runtime) Manually run the docs app examples against the public TES endpoint and verify task listing, details, and submission work.

@salihudickson

Copy link
Copy Markdown
Contributor Author

hey @anuragxxd, I've implemented the suggested fixes, please review again.

@anuragxxd

Copy link
Copy Markdown
Member

@salihudickson This looks good to me, thanks! I'll make some styling changes (see #573), push them to this branch, and then merge it.

Resolve conflicts from the dev-tools alignment (#561): drop the unused
tsup dev dependency, keep tw-animate-css, take dev's esbuild tsconfig
setting in the test runner, and regenerate the lockfile with npm 9.2.0.
Add a label property to the design input and textarea primitives,
forwarded to the native control as aria-label, so a label can name a
control that lives in another shadow root. Label every TES form control
and the task search field, and test that each control has a name.
@anuragxxd
anuragxxd merged commit 4655158 into dev Nov 13, 2026
13 checks passed
@anuragxxd
anuragxxd deleted the chore/tes-migration branch November 13, 2026 05:00
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.

Cloud Components: migrate @elixir-cloud/tes to the v2 provider architecture

3 participants