Skip to content

build: use Cloud Components 2.0.0-alpha.51 - #90

Merged
AnonymousXC merged 9 commits into
devfrom
build/tes-alpha51
Nov 16, 2026
Merged

AnonymousXC merged 9 commits into
devfrom
build/tes-alpha51

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves Krini to Cloud Components 2.0.0-alpha.51, which is now on npm (@elixir-cloud/tes 1.0.1 → 2.0.0-alpha.51, @elixir-cloud/wes 2.0.0-alpha.49 → 2.0.0-alpha.51). The TES components now use the v2 provider pattern (elixir-cloud-aai/cloud-components#443), so TES requests carry the user's token the same way WES requests do.

Closes #91. Part of #41 and #44 (see "What's left" below). Supersedes the Dependabot PR #86.

  • Token for TES (feat(auth): send the user's token to services #44, point 1): a TokenTesProvider adds Authorization: Bearer … to every request, with the token taken per request from /auth/api/token. It lives in src/lib/service-providers.ts next to the WES provider, which moved there from the hook. Both have unit tests.
  • Only https TES services (feat(auth): send the user's token to services #44, point 4): /api/tasks/get-tes-servers keeps only entries with a valid https URL, as the WES list already does.
  • Base URL: the registry URL is the TES base URL (as for WES and in the mock registry), so Krini no longer appends /ga4gh/tes/v1.
  • Task details (feat: run TES tasks with the Cloud Components #41, point 4): the 1.0.1 list showed details inline, but the 2.0 list only fires ecc-runs-selected. A new page /dashboard/tasks/details?id=…&service=<registry id> renders ECCClientGa4ghTesRun (state, logs, cancel). The service is resolved only from the https registry list, and a linked task can't be looked up on another service.
  • Removed: the dead TEST SERVER entry (/tes-api, no rewrite serves it; feat: run TES tasks with the Cloud Components #41 point 2, also listed in fix: remove leftovers from the rewritten UI #67), and the e2e exemption for the Firefox :host-context error of design alpha.49, which alpha.51 fixes (feat: add surface, font and dark mode controls cloud-components#446).
  • Smaller change: useWESProvider now uses useMemo, like the new useTESProvider.
  • Docs: user guide (TES token, https rule, task details and cancel), operator guide (component versions, API base URLs, a warning that the registry must restrict who can register services because Krini sends the token to every listed service), and an upgrade note for TES entries that hold only the host.

Verification

All run locally on the branch head:

  • bun run lint: no findings
  • bunx next typegen && bunx tsc --noEmit: passed
  • npm run test:coverage: 248 tests passed, 100% coverage (new: src/lib/service-providers.test.ts, https filter in get-tes-servers/route.test.ts)
  • CI=1 bunx playwright test: 28 passed (Chromium and Firefox). New tests cover: anonymous users see only the https TES service; a member submits, lists, views (also after a reload) and cancels a task, and every TES request carries their token; the hints on the details page without an ID, without a service, and for a service that isn't in the list (no request is sent)
  • mkdocs build --strict: passed

CI: all checks passed (CI passed, both end-to-end jobs, image build and scan, docs, CodeQL, Codecov). The status Vercel – krini of the elixir-cloud-aai Vercel project fails, as it does on every open PR (#82, #84, #87). It isn't a required check, and the thearcanes-projects deployment of the same name passes on those PRs.

What's left in #41 and #44

These need follow-ups and are not in this PR:

Declined review findings

  • Merge TokenTesProvider and TokenWesProvider into a mixin: the shared logic is already in withToken. A mixin over two base classes with a protected fetch adds typing complexity to save about 8 lines.
  • Unit tests for the React wrappers: the repo has no component test setup (Vitest runs in node and covers src/lib and the API routes), so the e2e tests cover them.
  • A persistent message when loading the registry fails on the details page: this behaves like the existing list pages (a toast). Better left for feat: run TES tasks with the Cloud Components #41's "Log in to see your tasks" work.
  • An allowlist setting for token-bearing services: feat(auth): send the user's token to services #44 assigns this to the verified registry list (feat: browse services from a registry #40). This PR documents the requirement instead.

🤖 Generated with Claude Code

Summary by Sourcery

Upgrade Krini to Cloud Components 2.0.0-alpha.51 and add authenticated TES task management with service-safe task details.

New Features:

  • Add authenticated TES task operations, including task creation, listing, details, logs, and cancellation.
  • Add a task details page that preserves and validates the originating TES service.

Bug Fixes:

  • Restrict TES services to valid HTTPS registry URLs and use registry URLs directly as API base URLs.
  • Remove the obsolete test TES server and Firefox error exemption.

Enhancements:

  • Upgrade the TES and WES Cloud Components dependencies to 2.0.0-alpha.51 and align both integrations with the provider pattern.
  • Centralize token-bearing TES and WES providers so each request uses the current session token.

Build:

  • Update dependency lockfiles for the Cloud Components upgrade.

Documentation:

  • Document TES token forwarding, HTTPS and base URL requirements, task details and cancellation, trusted service registry configuration, and the upgrade path.

Tests:

  • Expand unit and end-to-end coverage for authenticated TES requests, HTTPS filtering, task workflows, and task details validation.

uniqueg and others added 8 commits November 15, 2026 17:45
Krini now sends the user's access token to the selected TES service, so
the TES list keeps only registry entries with a valid https URL, as the
WES list already does.

Refs #44

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bump @elixir-cloud/tes from 1.0.1 to 2.0.0-alpha.51 and
@elixir-cloud/wes from 2.0.0-alpha.49 to 2.0.0-alpha.51.

The TES components now take a provider. Krini passes a TokenTesProvider,
which, like the WES provider, adds the user's access token to every
request; both now live in src/lib/service-providers.ts, with tests. The
registry URL is the TES base URL, as for WES, so Krini no longer appends
/ga4gh/tes/v1. The task list opens the new task details page, which
shows the state and logs and can cancel the task. The TEST SERVER entry,
which pointed to a path that nothing serves, is gone.

Refs #41, #44

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mock services get a TES service and an http TES entry. The journey
tests check that anonymous visitors see only the https TES service, and
that a member submits, views and cancels a task with their token.

Drop the ignored Firefox page error of @elixir-cloud/design
2.0.0-alpha.49: alpha.51 has the fix (cloud-components#446).

Refs #41, #44

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The user and operator guides no longer say that TES requests carry no
token. They describe the https rule for TES services, the task details
and cancel actions, and the new component versions.

Refs #41, #44

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The details link now names the task's service by its registry ID, and
the details page selects that service from the (https-only) registry
list instead of offering a selector, so a task ID is never looked up on
another service. Links without a service ask for one; links to services
that aren't in the list show a hint and send no request.

The e2e tests cover these cases and a reload of the details page, and
the mock TES service records every request, including its service info.

Refs #41, #44

Co-Authored-By: Claude Opus 5.5 <[email protected]>
useWESProvider now creates the provider with useMemo, as useTESProvider
does, instead of an effect that rendered once without it. The unused
setWesProvider is gone.

Refs #44

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The operator guide says that registry URLs must be API base URLs, warns
that Krini sends the token to every listed service, so only
administrators may register services, and adds an upgrade note for TES
entries that hold only the host.

Refs #41, #44

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A details link without a service uses the current selection; it now
shows the selector, so the user can switch if the task is on another
service. The mock records requests to the http TES entry too, so the
e2e test can show that a link to it sends none. The user guide
describes the details links.

Refs #41, #44

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg uniqueg self-assigned this Nov 15, 2026
@uniqueg
uniqueg requested a review from AnonymousXC November 15, 2026 17:28
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
krini Ready Ready Preview Nov 16, 2026 5:21am UTC

@sourcery-ai

sourcery-ai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Filter the TES registry API to return only TES services with valid HTTPS URLs, protecting token-bearing requests from insecure endpoints.

  • src/app/api/tasks/get-tes-servers/route.test.ts L46-57
  • src/app/api/tasks/get-tes-servers/route.ts L5-12, L32-38

Add the task-details route and service-linked task view, including the query parameters that identify the task and its registry service.

  • src/app/dashboard/tasks/details/page.tsx L1-61

Uses of the API

Provide TES and WES Cloud Components with token-bearing providers that fetch the current session token for each service request.

  • src/hooks/index.ts L2, L7-13
  • src/hooks/use-tes-provider.ts L1-22
  • src/hooks/use-wes-provider.ts L1-21
  • src/lib/service-providers.ts L1-94

Adapt TES task creation and listing to the v2 provider API and route selected task links to details while preserving the originating service ID.

  • src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx L3-8 (+3 small edits)
  • src/app/dashboard/tasks/_components/ecc-tes-run-wrapper.tsx L23-32, L41-53 (+2 small edits)

Resolve a task's linked TES service only from the HTTPS registry list, restore that service on reload, and display task details or appropriate selection hints.

  • src/app/dashboard/tasks/_components/ecc-tes-task-wrapper.tsx L1-98
  • src/app/dashboard/tasks/_components/index.ts L3, L10
  • src/app/dashboard/tasks/_components/tes-server-list.tsx L108 (removed lines)

UI

Add browser-level coverage for HTTPS-only TES discovery, token-bearing task submission, task details and cancellation, and invalid or unlinked service cases.

  • e2e/fixtures.ts L3-7, L54-59 (+2 small edits)
  • e2e/journey.spec.ts L33-62, L139-208 (+2 small edits)
  • e2e/mock/server.ts L10-18, L312-319, L329-400 (+6 small edits)
  • e2e/settings.ts L10, L36-44, L53

Configuration

Upgrade the TES and WES dependencies to Cloud Components 2.0.0-alpha.51 and remove the obsolete TEST SERVER selector option.

  • bun.lock L136-140 (+19 small edits)
  • package.json L17-18

Documentation

Document token forwarding, HTTPS service requirements, task details and cancellation, trusted registry administration, API base URLs, and upgrade guidance.

  • docs/operator-guide/deployment.md L146-162
  • docs/operator-guide/index.md L27-28
  • docs/operator-guide/upgrading.md L20-26
  • docs/user-guide/index.md L18-21, L29-35 (+2 small edits)

Tests

Verify that the token sources and TES/WES providers send the current bearer token on requests and handle missing tokens or failed token retrieval.

  • src/lib/service-providers.test.ts L1-133

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

@read-the-docs-community

read-the-docs-community Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c782d18) to head (64a5309).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev       #90   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        20    +1     
  Lines          545       566   +21     
  Branches       157       161    +4     
=========================================
+ Hits           545       566   +21     

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

@uniqueg
uniqueg marked this pull request as ready for review November 15, 2026 17:32

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

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

## Individual Comments

### Comment 1
<location path="src/app/api/tasks/get-tes-servers/route.ts" line_range="34-38" />
<code_context>

+        // the components send the user's token to the selected service:
+        // only TES services and gateways over https
         const tesServices = res.data.filter(
             (service) =>
-                service?.type?.artifact === "tes" ||
-                service?.type?.artifact === "tes-gateway",
+                (service?.type?.artifact === "tes" ||
+                    service?.type?.artifact === "tes-gateway") &&
+                isHttps(service.url),
         );

</code_context>
<issue_to_address>
**Registry entries can steal access tokens**

When the registry permits an untrusted user to register services and a member selects that user's HTTPS TES entry, a regular registry user can add an HTTPS TES entry, which passes `get-tes-servers`; when a member selects it, `TokenTesProvider` fetches the session token and attaches it to TES requests, exposing the bearer token to the attacker-controlled service.

Require a verified/allowlisted service before exposing it as selectable, or otherwise enforce the trusted-registry policy in Krini before sending tokens.

Also at `src/lib/service-providers.ts:72`.
</issue_to_address>

### Comment 2
<location path="src/app/api/tasks/get-tes-servers/route.ts" line_range="38" />
<code_context>
-                service?.type?.artifact === "tes-gateway",
+                (service?.type?.artifact === "tes" ||
+                    service?.type?.artifact === "tes-gateway") &&
+                isHttps(service.url),
         );

</code_context>
<issue_to_address>
**Removed services keep receiving bearer tokens**

When the registry removes or changes a TES entry after a tab has loaded its service list, the cached server list and `selectedServer` remain unchanged, so `useTESProvider` continues sending the user's bearer token to the old service. The user sees requests go to a service no longer in the registry.

Refresh or revalidate the server list and selected service before sending requests with the user's token.

Also at `src/lib/service-providers.ts:52`.
</issue_to_address>

### Comment 3
<location path="src/lib/service-providers.ts" line_range="21-25" />
<code_context>
-
-async function getAccessToken(): Promise<string> {
-    try {
-        const response = await fetch("/auth/api/token", {
-            method: "GET",
-            credentials: "same-origin",
-            cache: "no-store",
-        });
-
-        if (!response.ok) {
</code_context>
<issue_to_address>
**Token lookup can hang task actions**

When the same-origin token endpoint stalls without returning a response, `getAccessToken` awaits this fetch before `withToken` calls the TES provider, so a token endpoint that accepts but never completes a request leaves the TES action pending indefinitely. No timeout or cancellation handles the stalled lookup.

Bound the token lookup with a timeout and surface a timeout failure instead of leaving the TES operation pending indefinitely.
</issue_to_address>

### Comment 4
<location path="src/lib/service-providers.ts" line_range="27-34" />
<code_context>
-            cache: "no-store",
-        });
-
-        if (!response.ok) {
-            return "";
-        }
-
</code_context>
<issue_to_address>
**Token failures become anonymous requests**

When the same-origin token request fails during a logged-in TES operation, `getAccessToken` returns an empty string for any non-OK response or fetch error, so `withToken` sends the TES request without authorization and the service rejects it. The caller sees a service failure rather than an indication that token retrieval failed.

Distinguish an absent session from a token-fetch failure and surface the latter instead of silently issuing an unauthenticated request.
</issue_to_address>

### Comment 5
<location path="src/app/api/tasks/get-tes-servers/route.ts" line_range="10" />
<code_context>
+ * @param url URL of a registry entry
+ */
+function isHttps(url: unknown): boolean {
+    return typeof url === "string" && URL.parse(url)?.protocol === "https:";
+}
+
</code_context>
<issue_to_address>
**Host-only TES URLs remain selectable**

When a registry entry still has a host-only HTTPS URL, as a TES entry could before this change, a host-only URL passes this check, so `useTESProvider` uses the host as the API base and the TES components send task requests to `/tasks` instead of `/ga4gh/tes/v1/tasks`; listing, creating, and viewing tasks fail.

Validate that each TES URL is an API base URL before returning it, for example by checking the expected path or probing its `service-info` endpoint.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 5 findings to address first, and the new TES provider attaches the user's bearer token to requests sent to the selected registry service; HTTPS protects the connection but does not make that service trustworthy. If an untrusted service is selectable, it can collect tokens, and reverting stops future sends but cannot recover tokens already exposed.

Blocking findings: src/app/api/tasks/get-tes-servers/route.ts:38, src/app/api/tasks/get-tes-servers/route.ts:38, src/lib/service-providers.ts:25, src/lib/service-providers.ts:34, src/app/api/tasks/get-tes-servers/route.ts:10


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

Comment thread src/lib/service-providers.ts Resolved
Comment thread src/lib/service-providers.ts Resolved
@sourcery-ai

sourcery-ai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Linked issues

Checked at commit 64a5309

#91 build: use Cloud Components 2.0.0-alpha.51 · 6 of 6 met

# Requirement Status Notes
1 Use @elixir-cloud/tes and @elixir-cloud/wes at 2.0.0-alpha.51 ✅ Met package.json and bun.lock specify alpha.51 for both packages.
2 Send the user's token with TES requests ✅ Met TokenTesProvider adds the bearer token per request, with unit and end-to-end coverage.
3 Use registry URLs as TES base URLs and list only https entries ✅ Met The TES provider receives the selected registry URL directly, and the TES server route filters out entries without a valid https URL.
4 Provide a separate task details page ✅ Met The new /dashboard/tasks/details page renders task state, logs, and cancellation through the TES component.
5 Remove the old-version workarounds ✅ Met The TEST SERVER option and the Firefox :host-context page-error exemption are removed.
6 Update user and operator documentation, including an upgrade note ✅ Met The guides document token forwarding, HTTPS services, task details, API base URLs, trusted registries, and the TES URL change for upgrades.

@vercel
vercel Bot temporarily deployed to Preview – krini November 16, 2026 05:21 Inactive
@AnonymousXC
AnonymousXC merged commit 0363f87 into dev Nov 16, 2026
42 checks passed
@AnonymousXC
AnonymousXC deleted the build/tes-alpha51 branch November 16, 2026 05:53
uniqueg added a commit that referenced this pull request Nov 19, 2026
Set date-released to 2026-11-19 and reorder the CITATION.cff authors
by lines added on dev (without lock files, public/ and
src/components/ui/, as in #74). Add everything merged since the first
draft to the release notes: TES tasks with the user's token (#90),
the WES run details (#100), the minimal dashboard (#108), the Helm
chart (#92, #95), the image end-to-end tests (#99), the deployment
docs (#101), the Next.js update (#102) and the fixes #109 and #110.

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

This branch was previously deployed

1 inactive deployment
Preview – krini — 64a53098 Deployed Nov 16, 2026 by vercel[bot]
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 Cloud Components 2.0.0-alpha.51

2 participants