Skip to content

feat(cloud-registry): verified badge in list - #581

Merged
uniqueg merged 37 commits into
devfrom
feat/579-verified-badge
Nov 17, 2026
Merged

uniqueg merged 37 commits into
devfrom
feat/579-verified-badge

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Shows which services are verified in a services list, with one request for all verifications.

Stacked on #578 (#459, the verification component and provider methods): this branch contains #578's commits, so the diff shows them until #578 is merged. Only these commits (and the merges of #578's branch) belong to this PR: 544b764, 5537339, cdf3da2, 503e1af, 93eca0f, 3588776, dc4143d, 523dfcc, b109ad8, 44ab85d, 4e7d183, e14af81, bd14efd, 52ed9e1.

  • New component ecc-client-elixir-cloud-registry-services in the cloud-registry package. It wraps the services list of the service-registry package (ecc-client-ga4gh-service-registry-services). It loads GET /verifications once per provider, matches the verifications to the services with verifiedServices(), and renders in each row the badge element ecc-client-elixir-cloud-registry-service-verification-badge (feat(cloud-registry): verifications #578) through the list's new rowBadges hook, next to the version, and the actions element ecc-client-elixir-cloud-registry-service-verification (Verify / Remove verification, admins) through its rowActions hook (review by anuragxxd). Each row gets its verification (or null), so rows send no requests of their own.
  • admin is passed to the badges. The list applies ecc-service-verification-changed from admins' verify and remove without loading again.
  • Reloads of the verifications are numbered: only the latest answer counts, and a reload running when an admin's change arrives is replaced by a new one, so an older answer can't bring back a removed badge. A failed verify or remove reloads only for no status, 409 or 5xx, as the component does (shared helpers in service-verification/failure.ts), and not for a provider that lacks the method. A failed reload keeps the last verifications. (Review by anuragxxd.)
  • The app's rowActions render after Verify / Remove, the app's rowBadges after the tag. Without them, rows keep a "View Details" button that fires ecc-service-selected.
  • A provider or baseUrl change creates a new inner list (keyed). Late answers from the previous provider, both verifications and ecc-services-changed, are ignored.
  • If loading the verifications fails, or the provider lacks getVerifications(), the list shows no badges and fires ecc-service-verification-failed with an empty serviceId and action: "load".
  • The new module defines the elements it renders only in browsers and only if they aren't defined yet. The index.ts files of the SR services list and the CR verification component now use the same guard, as the design package's files do. Without this, the docs build (Next.js SSR through the React wrappers) failed with window is not defined.
  • The cloud-registry tsconfig.json uses module/moduleResolution: node16, as drs-filer does, instead of paths into service-registry's dist (review by anuragxxd); cr-provider.ts therefore imports @elixir-cloud/service-registry/providers instead of .../dist/providers.
  • Changesets: cloud-registry minor and service-registry patch.

Docs: a new page cloud-registry/components/services.mdx, a link in the package introduction, and updated callouts on the service-verification page and the SR services page. The verified filter that #455 mentioned isn't part of #575; this PR only shows the badge.

Closes #579

Verification

  • npx web-test-runner in packages/ecc-client-elixir-cloud-registry: all tests pass in Chromium and Firefox, including 19 new tests for the component. Line coverage of services.ts is 100%. WebKit can't run on this machine (Playwright doesn't support Ubuntu 26.04); CI covers it.

  • npx web-test-runner in packages/ecc-client-ga4gh-service-registry: 92 tests pass in Chromium and Firefox.

  • npm run build in both packages: passes, and generates the React wrapper @elixir-cloud/cloud-registry/react/services.

  • npm run lint at the root (husky pre-commit, including the docs build): passes, with 0 errors.

  • CI: all checks pass (Lint, Test on Node 22 and 24 including WebKit, CodeQL, Codecov patch and project, Read the Docs preview).

  • Review: adversarial-reviewer and quality-reviewer, then a second adversarial round. Fixed:

    • a late ecc-services-changed from a replaced list overwrote the services (medium);
    • event types were imported from a dist/ path instead of the public events export (medium/low);
    • tests were missing for the stale list, early return, baseUrl change and failure status/cause (medium).

    Round 2 found nothing new.

Review round for anuragxxd's changes

  • Tests first: badge next to the version and actions in the actions cell, app rowBadges, a reload answering after a later remove, reloads answering out of order, the status rule (400/403/404 vs 409/500/none), unsupported providers, idle changes, a failed reload; a unit test table for needsReload, statusOf and failureDetail.
  • Locally in Chromium and Firefox: cloud-registry 267 tests and service-registry 100 tests pass; tsc -p tsconfig.prod.json clean; root npm run lint (incl. the docs build) and the package builds pass.
  • adversarial-reviewer and quality-reviewer, two rounds. Fixed: shared failure helpers so the list's load failures carry the same fields as the rows'; no reload for providers without the method; docs for failed reloads, provider swaps and rowActions replacing View Details; the tsconfig note dropped from the changeset; tests tightened.
  • CI: all checks pass on 523dfcc (Lint, Test on Node 22 and 24, CodeQL, Codecov patch and project, Read the Docs preview, Sourcery).

Review round 2 by anuragxxd

  • Merged feat(cloud-registry): verifications #578's branch: the wrapper now uses the badge element in rowBadges and the actions-only verification element in rowActions (display is gone).
  • Actions column (service-registry): the cell was w-1/12 and cut off "Remove verification" and "View Details". The design table's rows are flex rows, not a real table, so w-px whitespace-nowrap would size each row's cell on its own and misalign the columns between rows (e.g. "Verify" vs "Remove verification") and the header. The list now measures the widest actions of the rows shown (a ResizeObserver, as actions such as the verification element render later) and gives the header and every row's actions cell that width; the actions stay on one line and the other columns share the rest. Changeset: service-registry patch.
  • Tests first: actions fit their cell at 1280 and 1920 px (failed with w-1/12), columns stay aligned and the column narrows again, slotted actions that change after a reconnect; in cloud-registry, a click on Verify in the actions updates the badge in the name line without a reload.
  • Locally in Chromium and Firefox: service-registry 88 and cloud-registry 138 tests pass; root npm run lint (incl. the docs build) passes.
  • adversarial-reviewer and quality-reviewer, two rounds. Fixed: re-arming the observer after a reconnect, keeping the last width while the list is hidden, measuring the loading skeleton so the header lines up while loading, layout widths instead of transformed ones, re-observing only when the rows shown change, no width for rows without actions, an internal name for the width property, sturdier layout tests, docs and changeset wording.

Declined review findings

  • Long organization or service names can still overflow their columns (adversarial, low, round 2). The name and organization cells don't shrink below their content (no wrapping or truncation); that was already so before, and with a wider actions column it happens sooner. Truncating them is a separate design change of the list.

  • A clickPart() test helper (quality, low, round 2). One use so far.

  • Test that importing the entry points twice doesn't throw (quality, medium). Re-importing with a query string doesn't work in web-test-runner (the module fails to load). The guards follow the design package's pattern, and the docs build exercises SSR safety.

  • Shared defineOnce helper (quality, low). A helper would touch every package's index files, which is out of scope. The guards copy the existing pattern from the design package.

  • Docs version 2.0.0-alpha.52 (quality, low). This is the next release after the published alpha.51, the same version that feat(cloud-registry): verifications #578's page gives.

  • Results of a verify or remove still running when the app replaces the provider for the same registry are dropped (adversarial, low). Documented in the provider section; the next load shows the registry's state.

  • Declaration files import service-registry subpaths that need exports-aware resolution (adversarial, low). This was already so with the paths entries (they don't rewrite imports); consumers on moduleResolution: node would need typesVersions in service-registry, which is a separate change.

  • Events table lists events that the inner list fires (quality, low). They bubble and are composed, so apps receive them on this element; tests observe ecc-service-selected on it.

Open questions

None. The design choice (a wrapper component in cloud-registry rather than a hook in the SR list) is open for the maintainer's review.

🤖 Generated with Claude Code

Summary by Sourcery

Add a verified Cloud Registry services list with admin actions, robust verification state handling, and improved service-list action layout.

New Features:

  • Add a Cloud Registry services list that displays verification badges and provides admin verification actions with a single verification load for all services.

Bug Fixes:

  • Prevent stale provider, list, and verification responses from overwriting current state, and preserve existing verifications when reloads fail.
  • Make service-list custom element registration safe for server-side rendering and repeated imports.

Enhancements:

  • Improve service-list action-column sizing so wide actions remain visible on one line and columns stay aligned.
  • Share verification failure handling and reload rules between verification components.

Build:

  • Update cloud-registry TypeScript resolution to use Node16 settings and public service-registry package exports.

Documentation:

  • Document the new Cloud Registry services component, its properties and events, and how it integrates verification badges and actions.

Tests:

  • Add coverage for verification loading, stale responses, provider changes, failure handling, admin updates, custom row renderers, and action-column layout.

Chores:

  • Add release changesets for the Cloud Registry services component and service-registry improvements.

uniqueg and others added 10 commits November 13, 2026 08:13
Add provider methods and types for the verification endpoints of
Cloud Registry 0.4.0 and later (GET /verifications, GET, PUT and
DELETE /services/{id}/verification), optional in the interface so
that custom providers still conform, and helpers that tell whether a
verification still matches its service, as the registry compares
them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add ecc-client-elixir-cloud-registry-service-verification: a badge
for verified services, and "Verify" and "Remove verification" for
admins. It sends the URL and API type of the service shown as the
ones checked, takes a verification the app has loaded already (e.g.
for a list, from getVerifications()), reacts to a provider set after
the first update, and fires change and failure events with the
status and conflict code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add code to CloudRegistryError, so that apps and the verification
component read the conflict code of a 409 without digging into the
problem. Test the component's busy state, races and failures of
verify and remove, and link it from the package introduction.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A reload while a verify or remove ran (e.g. a new provider after a
token refresh) dropped the result: no change event, the old state
shown, and the button enabled again. Track loads apart from verify
and remove, always report a result the registry has applied, and
show it until the app sets verification again. Fold capital sharp s
and dotless i as Python does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Track running verify and remove requests by service ID, so that one
for a previous service doesn't block the service shown, and show a
result (also one kept over the app's verification) only while the
component shows the same service of the same registry (base URL).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Address automated review: load the verification again when the URL or
API type of the service changes and after a verify or remove fails
without a clear outcome (no status or a server error), and key
running requests by registry and service, so that a request to one
registry doesn't block another.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add ecc-client-elixir-cloud-registry-services, the services list of
the service-registry package with a verification badge in each row.
It loads all verifications with one request and follows verify and
remove by admins. The elements it renders are defined only in
browsers and only once, so that server-side rendering of the React
wrappers keeps working.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ignore ecc-services-changed from a list of a previous provider,
import the list's event types from the public events export, and test
the remaining branches.

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

sourcery-ai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

API

Expose the Cloud Registry services-list component and its forwarded service-list event types as public package APIs.

  • packages/ecc-client-elixir-cloud-registry/src/components/services/index.ts L1-22
  • packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts L58-78
  • packages/ecc-client-elixir-cloud-registry/src/events/index.ts L7-12

Make the service-registry services element safe to register from the Cloud Registry package or during server-side rendering.

  • packages/ecc-client-elixir-cloud-registry/src/components/service-verification/index.ts L6-19
  • packages/ecc-client-ga4gh-service-registry/src/components/services/index.ts L6-17

Implementation

Implement the Cloud Registry list wrapper, including provider-scoped loads, stale-result handling, verification updates, and row renderers.

  • packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts L1-57, L79-380

Share verification failure details and the reload rule between the verification actions and the services list.

  • packages/ecc-client-elixir-cloud-registry/src/components/service-verification/failure.ts L1-71
  • packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts L12-17, L20 (removed lines), L266

Fit the service-registry actions column to the widest visible row actions, keeping actions on one line and columns aligned.

  • packages/ecc-client-ga4gh-service-registry/src/components/services/services.ts L111-124, L177-185, L217-289 (+3 small edits)

Import the service-registry provider types through the package's public export.

  • packages/ecc-client-elixir-cloud-registry/src/providers/cr-provider.ts L14

Configuration

Switch Cloud Registry TypeScript resolution to Node16 so package exports resolve without dist path mappings.

  • packages/ecc-client-elixir-cloud-registry/tsconfig.json L4-5

Record the Cloud Registry feature release and the service-registry list fixes in changesets.

  • .changeset/cloud-registry-services-verified.md L1-5
  • .changeset/service-registry-actions-width.md L1-5
  • .changeset/service-registry-define-once.md L1-5

Documentation

Document the Cloud Registry services-list component, its properties, events, loading behavior, and integration hooks.

  • apps/documentation/pages/docs/cloud-registry/components/services.mdx L1-105

Link the combined services list from Cloud Registry verification guidance and package introduction.

  • apps/documentation/pages/docs/cloud-registry/components/service-verification.mdx L172-175
  • apps/documentation/pages/docs/cloud-registry/introduction.mdx L25

Explain the services-list badge integration and the actions-column sizing behavior in the service-registry docs.

  • apps/documentation/pages/docs/service-registry/components/services.mdx L172-274 (4 small edits)

Update the Cloud Registry component navigation metadata for the new services page.

  • apps/documentation/pages/docs/cloud-registry/components/_meta.json L5-6

Tests

Test Cloud Registry list rendering, verification loading and updates, provider changes, failures, events, and stale-response handling.

  • packages/ecc-client-elixir-cloud-registry/src/components/services/tests/services.test.ts L1-700

Unit-test shared verification failure and reload helpers.

  • packages/ecc-client-elixir-cloud-registry/src/components/service-verification/tests/failure.test.ts L1-61

Test actions sizing, alignment, narrowing, and resize observation across reconnects.

  • packages/ecc-client-ga4gh-service-registry/src/components/services/tests/services.test.ts L70-75, L517-620

Other changes

Files not grouped.

  • packages/ecc-client-elixir-cloud-registry/src/components/index.ts L4

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

❌ Patch coverage is 99.51140% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.22%. Comparing base (6114b9c) to head (792a560).

Files with missing lines Patch % Lines
...rvice-registry/src/components/services/services.ts 97.22% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #581      +/-   ##
==========================================
+ Coverage   75.46%   76.22%   +0.76%     
==========================================
  Files          68       71       +3     
  Lines       17576    18122     +546     
  Branches     1014     1088      +74     
==========================================
+ Hits        13263    13814     +551     
+ Misses       4296     4291       -5     
  Partials       17       17              

☔ 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 14, 2026 21:02
@uniqueg
uniqueg requested a review from anuragxxd as a code owner November 14, 2026 21:02
@sourcery-ai

sourcery-ai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Linked issues

Checked at commit 792a560

#579 feat: show the verified badge in the services list · 2 of 2 met

# Requirement Status Notes
1 Show which services are verified without one request per row ✅ Met The Cloud Registry list loads verifications with one getVerifications() call and matches them to services before rendering the badge through rowBadges.
2 Update the services-list documentation ✅ Met The service-registry services documentation describes rowBadges, and a Cloud Registry services-list page documents the new component and its usage.

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

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

## Individual Comments

### Comment 1
<location path="packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts" line_range="132-138" />
<code_context>
+
+// Only in browsers, and only once (the services list of the
+// cloud-registry package may have defined it already)
+if (
+  typeof window !== "undefined" &&
+  window.customElements &&
</code_context>
<issue_to_address>
**Actions target the previous registry**

When the provider changes from A to B and B’s verification load has not completed or fails, `renderRowActions` keeps the closure created for provider A: it captures A and A’s verification map, and the new list for provider B receives it. While B’s verification request is pending—or if it fails—B’s rows show A’s badge state and admin actions send requests to A, potentially changing the wrong registry.

Recreate `renderRowActions` when the shown provider changes, so the new list cannot use the previous provider’s callback.
</issue_to_address>

### Comment 2
<location path="packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts" line_range="186-197" />
<code_context>
+  }
+
+  /** Updates the verifications after an admin verified or removed one. */
+  private handleVerificationChanged(
+    e: EccServiceVerificationChangedEvent
+  ): void {
+    if (!this.verifications) return;
+    const { serviceId, verification } = e.detail;
+    const others = this.verifications.filter(
+      (item) => item.serviceId !== serviceId
+    );
+    this.verifications = verification
+      ? [...others, { serviceId, ...verification }]
+      : others;
+  }
+
+  private handleViewDetails(serviceId: string): void {
</code_context>
<issue_to_address>
**Old actions corrupt the new registry**

When an admin’s verify or remove request is pending while the provider changes, `handleVerificationChanged` accepts the detached list’s event and adds its verification to the current list by service ID, so the new registry can show a false Verified badge.

Ignore verification-change events unless they came from the currently shown provider and list.

Also at `packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts:241-253`.
</issue_to_address>

### Comment 3
<location path="packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts" line_range="251" />
<code_context>
+        .pageSize=${this.pageSize}
+        .rowActions=${this.renderRowActions}
+        @ecc-services-changed=${this.handleServicesChanged}
+        @ecc-service-verification-changed=${this.handleVerificationChanged}
+      ></ecc-client-ga4gh-service-registry-services>`
+    )}`;
</code_context>
<issue_to_address>
**Failed mutations leave stale badges**

When the registry applies a verify or remove but the response is lost or returns an error, the controlled `verification` prevents the verification component from reloading, and the list handles only successful change events, so the badge and available action remain out of sync with the registry.

Handle failed mutation events by reloading the service’s verification from the registry.

Also at `packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts:322`, `packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts:222`.
</issue_to_address>

### Comment 4
<location path="packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts" line_range="152" />
<code_context>
+        throw new Error("The provider doesn't support verifications.");
+      }
+      const verifications = await provider.getVerifications();
+      if (provider === this.shownProvider) this.verifications = verifications;
+    } catch (err) {
+      if (provider !== this.shownProvider) return;
</code_context>
<issue_to_address>
**Older requests overwrite current data**

When the app switches from provider A to B and back to the same A instance while A’s first list or verification request is pending, `loadVerifications` and `handleServicesChanged` accept results based only on provider object equality, so the first A request or event can overwrite newer services or verifications and leave the list stale.

Track the current provider request generation and ignore results or events from earlier generations.

Also at `packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts:179-181`.
</issue_to_address>

### Comment 5
<location path="packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts" line_range="251" />
<code_context>
+        .pageSize=${this.pageSize}
+        .rowActions=${this.renderRowActions}
+        @ecc-services-changed=${this.handleServicesChanged}
+        @ecc-service-verification-changed=${this.handleVerificationChanged}
+      ></ecc-client-ga4gh-service-registry-services>`
+    )}`;
</code_context>
<issue_to_address>
**Off-screen changes are lost**

When an admin pages or filters a row out before its verification request completes, `handleVerificationChanged` never receives the success event if a row is filtered or paginated out before its verify or remove request completes: the event is dispatched from a detached row and cannot bubble to the list. The list keeps its old verification map, so returning to the row shows a stale badge and action.

Keep row mutations in list-level state that survives row removal, or reload verifications when a row is mounted again.
</issue_to_address>

### Comment 6
<location path="packages/ecc-client-elixir-cloud-registry/src/providers/rest-cr-provider.ts" line_range="215" />
<code_context>
+   */
+  async getVerifications(): Promise<ServiceVerification[]> {
+    const url = `${this.baseUrl}/verifications`;
+    const response = await this.fetch(url);
+    if (!response.ok) {
+      throw await CloudRegistryError.fromResponse(
</code_context>
<issue_to_address>
**Stalled requests never resolve**

When the registry or network leaves one of these requests pending rather than returning a response or rejecting, `getVerifications` and the verification mutation methods await `fetch` without a timeout or cancellation path. A stalled request leaves the list without badges and emits no load-failure event, or leaves an admin control busy indefinitely.

Add a bounded request timeout or cancellation mechanism and route timeout failures through the existing failure events while clearing pending state.

Also at `packages/ecc-client-elixir-cloud-registry/src/providers/rest-cr-provider.ts:261`.
</issue_to_address>

### Comment 7
<location path="packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts" line_range="68-70" />
<code_context>
+ * Key of a running verify or remove: the service ID and the registry's base
+ * URL, if the provider has one
+ */
+const pendingKey = (id: string, provider: CloudRegistryProvider): string => {
+  const { baseUrl } = provider as { baseUrl?: unknown };
+  return JSON.stringify([typeof baseUrl === "string" ? baseUrl : "", id]);
+};
+
</code_context>
<issue_to_address>
**New provider actions stay disabled**

When a request for a service is pending while the component switches to a distinct custom provider without a string `baseUrl`, `pendingKey` maps both providers to the same key, so the new provider treats the old request as busy and keeps its Verify or Remove action disabled until that request settles.

Include a unique provider identity in the pending key when the provider has no string `baseUrl`.
</issue_to_address>

### Comment 8
<location path="packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts" line_range="88" />
<code_context>
+  @property({ type: Boolean }) admin = false;
+  @property({ type: Boolean }) filter = true;
+  @property({ type: Boolean }) search = true;
+  @property({ type: Number, attribute: "page-size" })
+  pageSize = DEFAULT_PAGE_SIZE;
+
</code_context>
<issue_to_address>
**Empty page size shows every service**

When the wrapper receives an empty `page-size` attribute, lit converts the empty attribute to `0`, and the inner list treats that value as “show all,” so callers see every service instead of the default page.

Use the default page size when the `page-size` attribute is empty.
</issue_to_address>

### Comment 9
<location path="packages/ecc-client-elixir-cloud-registry/src/components/services/tests/services.test.ts" line_range="207-208" />
<code_context>
+    );
+    await waitUntil(() => !!badge(el, "s1"), "verifications not shown");
+
+    expect(row(el, "s1")?.querySelector('[data-edit="s1"]')).to.not.equal(null);
+    expect(row(el, "s1")?.querySelector("[data-view-details]")).to.equal(null);
+  });
+
</code_context>
<issue_to_address>
**Actions before badge pass**

When the row renders the app's action before its verification badge, when the list renders app row actions before the verification badge, the test `renders the app's row actions after the badge` still passes: its assertions check that the app action exists and the default button is absent, not their order.

Assert that the badge precedes the app action in the row's rendered order.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 9 findings to address first, and a mistaken verification can persist in the registry and display a misleading “Verified” badge to users; reverting the component won’t remove that record. An admin can remove or correct the verification, so the effect is bounded and repairable.

Blocking findings: packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts:138, packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts:197, packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts:251, packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts:152, packages/ecc-client-elixir-cloud-registry/src/components/services/services.ts:251, and 4 more


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

Address Sourcery: number the lists so that answers and events of a
replaced list are ignored, listen for verification changes on the
badges so that rows off the page still count, reload the
verifications after a failed verify or remove, and treat an empty
page-size attribute as the default.

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

uniqueg commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

@anuragxxd could you review #581? It shows the "Verified" badge in a services list, as a new component, ecc-client-elixir-cloud-registry-services, in the cloud-registry package. The component wraps the service-registry list, loads GET /verifications once, and puts the verification component from #578 into each row through the rowActions hook from #575. Rows send no requests of their own.

It is stacked on #578; please review that one first. Only the last four commits belong to #581.

Points for your decision:

  • Wrapper component in cloud-registry vs. a hook in the generic SR list (the GA4GH list can't know Cloud Registry verifications, so I chose the wrapper).
  • customElements.define is now guarded (browser only, define once) in the SR services and CR verification index.ts files, like the design package's. Without the guard, the docs SSR build broke.
  • A paths entry in the cloud-registry tsconfig, because moduleResolution: node ignores package exports.

@anuragxxd anuragxxd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Happy with the wrapper. Following my #578 comment: once the SR list has a hook next to the version tag, could the wrapper put the tag there and keep only Verify/Remove in the actions? That also fixes the clipped actions column (the SR list's actions cell is w-1/12). Also:

  • The verifications reload has no request counter. If a reload after a failed verify answers after a later remove, the badge comes back.
  • Every failed verify or remove reloads all verifications, including 400/403. Could it use the same status rule as reconcile()?
  • The tsconfig paths resolve to service-registry's dist, so consumers using moduleResolution: node can't resolve RowActionsRenderer. Switching to node16, as drs-filer does, would fix that.

uniqueg and others added 9 commits November 16, 2026 09:45
The registry stores each verification with the URL and API type read
from the service itself and removes it when either changes, so the
client compares them exactly. Drops the strip()/casefold() emulation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The services list renders badges of each row from rowBadges in the
name line, next to the version badge, so that apps can add tags such as
"Verified" where the row's other tags are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The display property of the verification component shows the badge and
admin actions together (all, the default), only the badge, or only the
actions, so that lists can put the badge next to the version and keep
Verify and Remove in the actions column. Adds the changeset for the
verifications and moves the docs to the next release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	apps/documentation/pages/docs/cloud-registry/components/service-verification.mdx
Consumers with moduleResolution node couldn't resolve RowActionsRenderer
through the tsconfig paths into service-registry's dist. The package now
uses module and moduleResolution node16, as drs-filer does, so package
exports resolve without paths. cr-provider imports the public providers
export instead of the dist path, which node16 rejects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The services list now renders the verification badge through the SR
list's rowBadges hook, next to the version, and keeps only Verify or
Remove verification (display actions) in the actions column, which also
stops clipping it. Apps can add their own badges with rowBadges.

Reloads of the verifications carry a request counter: only the latest
answer counts, and a reload running when an admin's change arrives is
replaced by a new one, so an older answer can't bring back a removed
verification. A failed verify or remove reloads only with no status,
409 or 5xx, the same rule as the component (shared in reload.ts).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review fixes: document that split instances need the app's
verification, with an example for the SR list's rowBadges and
rowActions hooks (incl. its own View Details button); that rowBadges
content is part of the clickable row; and how the registry serves and
removes verifications. Adds tests for the default and reflected
display, two instances of one row, and rowBadges strings, nodes and
clicks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	apps/documentation/pages/docs/cloud-registry/components/service-verification.mdx
#	apps/documentation/pages/docs/service-registry/components/services.mdx
uniqueg and others added 4 commits November 16, 2026 11:25
Round-2 review fixes: the Lit example defines its map and change
handler, the docs name every case in which the registry removes a
verification, and the display tests check the actions disappear and
that non-admins see nothing also for verified services.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review fixes: statusOf, failureDetail and needsReload move to
service-verification/failure.ts, so the list's load failures carry the
same fields as the rows'. The list doesn't reload after a failure of a
provider without the method, documents that a failed reload keeps the
last verifications and that a provider swap drops running results, and
the rowActions docs say it replaces View Details. More tests: a status
table, idle changes, failed reloads, unsupported providers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The failed-reload test now checks that the badge is shown, and a test
covers a provider that can't remove.

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

uniqueg commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

Thanks! All points are done. The branch now has #578's changes merged in, and through them dev.

Placement: the wrapper renders the verification tag (display="badge") through the SR list's new rowBadges hook, next to the version. The actions column keeps only Verify / Remove verification (display="actions"), followed by the app's rowActions or "View Details". This also fixes the clipped w-1/12 cell. The wrapper also passes rowBadges through, so apps can add their own tags after "Verified".

Request counter: reloads of the verifications are now numbered, and only the latest answer counts. If an admin's verify or remove arrives while a reload is running, that reload's answer is dropped and a new reload starts, so an answer read before the change can't bring the badge back. There are tests for your scenario (a reload after a failed verify answers after a later remove) and for two reloads that answer out of order.

Status rule: a failed verify or remove now reloads only for no status, 409 or 5xx, the same rule as reconcile(). The rule lives in one helper, needsReload() in service-verification/failure.ts, which the component uses too. 400, 403 and 404 no longer reload; a test covers each status.

tsconfig: the cloud-registry package now uses module/moduleResolution: node16, as drs-filer does, and the paths entries are gone. To make that work, cr-provider.ts now imports @elixir-cloud/service-registry/providers instead of .../dist/providers, which the package's exports doesn't allow.

The docs (cloud-registry/components/services), the changeset and the docs version (2.0.0-alpha.52) are updated.

Extra changes from the reviewer agents: the list and the rows now share statusOf, failureDetail and needsReload in service-verification/failure.ts, so the list's load failures carry the same fields as the rows'. A failure from a provider that lacks verifyService() or deleteServiceVerification() no longer reloads. A failed reload keeps the last verifications that loaded (documented).

CI is green on 523dfcc (Lint, Test on Node 22 and 24, CodeQL, Codecov, Read the Docs preview, Sourcery).

@anuragxxd anuragxxd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The tag placement looks great, and Verify updates it in place (checked in a browser). The actions column still clips, though: at 1280–1920 px, "Remove verification" and "View Details" are cut off. The SR actions cell is still w-1/12; could it size to its content (e.g. w-px whitespace-nowrap)? A test that clicks Verify in the actions and checks the badge would also be good.

uniqueg and others added 12 commits November 16, 2026 21:14
Replace the `display` property with two elements, as asked in review:

- `ecc-client-elixir-cloud-registry-service-verification-badge` is
  presentational: it shows "Verified" (with the date as tooltip) for
  the `verification` that the app passes, and "Not verified" with
  `show-unverified`. It has no provider and sends no requests.
- `ecc-client-elixir-cloud-registry-service-verification` now offers
  only the admin actions (Verify / Remove verification). For other
  users it shows nothing and no longer loads the verification.

Exact matching and the SR list's `rowBadges` hook are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add a page for the badge element, and update the verification page,
the services list's `rowBadges` section, the package introduction, the
providers page and the changeset for the split into badge and actions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Check that the actions hide when `admin` turns off, that a load
answering after that is dropped, and that the actions element renders
no badge of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Wrap the list example in a component, treat only 404 as not verified,
drop late answers for a previous service, add attribute names to the
properties table, and say that the badge does not match services.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t/579-verified-badge

# Conflicts:
#	apps/documentation/pages/docs/cloud-registry/components/_meta.json
#	apps/documentation/pages/docs/cloud-registry/introduction.mdx
#	apps/documentation/pages/docs/service-registry/components/services.mdx
#	packages/ecc-client-elixir-cloud-registry/src/components/index.ts
#	packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts
The services list renders the new badge element through `rowBadges`
and the verification element, now actions only, in the actions
column, as #578 splits them. Adds a test that clicks Verify in the
actions and checks that the badge updates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The actions cell was a twelfth of the list, which cut off "Remove
verification" and "View Details" at 1280 to 1920 px. The rows are flex
rows, so a content-sized cell per row (`w-px whitespace-nowrap`) would
misalign the columns. The list now measures the widest actions of the
rows shown (with a ResizeObserver, as they may render later) and sets
the column width of the header and all rows to it; actions stay on
one line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Describe the badge element in the name line and the actions element in
the actions column.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Watch the actions again after a reconnect, keep the last width while
the list is hidden, and keep the width property internal. Tests now
wait for the fit and check narrowing and alignment with a tolerance;
the docs and changeset are reworded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measure the loading skeleton too, so the header lines up while the
list loads; use layout widths (offsetWidth), not transformed ones;
watch the actions again only when the rows shown changed. Adds a test
for slotted actions that change after a reconnect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the rows shown have no actions, the actions column needs no width;
keep the last width only while the list is hidden.

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

uniqueg commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

Thanks! Both points are done, and the branch has #578's latest changes merged in.

Actions column (service-registry list)

  • The design table's rows are flex rows, not a real <table>. So w-px whitespace-nowrap would size each row's actions cell on its own. Rows with "Verify" and rows with "Remove verification" would then shift the other columns differently, and the header wouldn't line up either. I tried it, and the test for this failed.
  • Instead, the list measures the widest actions of the rows shown and gives that width to the actions cell of the header and of every row. It uses a ResizeObserver, because components like the verification actions render after the row. The actions stay on one line, and the other columns share the rest.
  • The column narrows again when the wide actions are gone. It is measured again after the list is moved in the DOM. It keeps its width while the list is hidden, and the loading skeleton is measured too, so the header lines up while loading.
  • Tests: at 1280 and 1920 px, "Remove verification" + "View Details" fit their cell (this failed with w-1/12); the columns stay aligned for actions of different widths; slotted actions that change after a reconnect are fitted. Changeset: service-registry patch.

Badge test (cloud-registry wrapper)

  • New test: an admin clicks Verify in the actions, and the badge in the name line changes from "Not verified" to "Verified". "Remove verification" then shows, and the verifications aren't loaded again.
  • The wrapper now renders feat(cloud-registry): verifications #578's badge element in rowBadges and the actions-only element in rowActions.

Locally in Chromium and Firefox, service-registry 88 and cloud-registry 138 tests pass. Both reviewer agents ran two rounds, and their findings are fixed (see the PR body). CI is green on 52ed9e1. Could you take another look?

@uniqueg
uniqueg requested a review from anuragxxd November 16, 2026 21:05

@anuragxxd anuragxxd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, checked in a browser at 1024–1920 px: no more clipping, and Verify updates the tag in place. LGTM. Nits for later: right-aligning the actions would line up "View Details" across rows, and a follow-up to make the design table a CSS grid would let fitActions() go.

@uniqueg

uniqueg commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

@dependabot rebase

Brings in #578 (squash-merged as 6114b9c). The branch already held
#578's commits up to f243573; its final head only added a merge of
dev. Conflicts were resolved by merging #578's final head (merge base
f243573, no conflicts), which gives the same tree as dev for all #578
files, with #581's changes on top.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit 187bf62 into dev Nov 17, 2026
19 checks passed
@uniqueg
uniqueg deleted the feat/579-verified-badge branch November 17, 2026 23:45
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: show the verified badge in the services list

2 participants