Skip to content

feat(cloud-registry): verifications - #578

Merged
uniqueg merged 18 commits into
devfrom
feat/459-verifications
Nov 17, 2026
Merged

uniqueg merged 18 commits into
devfrom
feat/459-verifications

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Apps can show and manage Cloud Registry verifications (cloud-registry 0.4.0 and later) without their own copy of the provider.

Provider (@elixir-cloud/cloud-registry/providers)

  • getVerifications(), getServiceVerification(id), verifyService(id, verification?) and deleteServiceVerification(id) for GET /verifications and GET/PUT/DELETE /services/{id}/verification, matching the registry's OpenAPI (additions.openapi.yaml). They are optional in CloudRegistryProvider, so custom providers without them still conform.
  • Types Verification, ServiceVerification and VerificationRegister.
  • Helpers matchesVerification() and verifiedServices(): a verification only counts while the service still has the verified URL (as written) and API type (group and artifact), compared exactly: the registry serves each verification with the service's current values and removes it when they change (review by anuragxxd).
  • CloudRegistryError.code: the problem code of a conflict, e.g. verification-mismatch or pending-service.

Components (split into two elements after review by anuragxxd)

  • ecc-client-elixir-cloud-registry-service-verification-badge: presentational. Shows "Verified" (the tooltip gives the date) for the verification that the app passes, and "Not verified" with show-unverified (e.g. for admins); nothing otherwise. No provider, no requests.
  • ecc-client-elixir-cloud-registry-service-verification: the admin actions. Admins see "Verify" or "Remove verification"; other users see nothing, and the component sends no requests for them. "Verify" sends the URL and API type of service as the checked values, so a service that changed in the meantime isn't verified (409).
  • The actions element has a verification property for lists: the app loads all verifications with one request and passes each row's verification (to the badge and the actions), so the rows make no requests of their own. Without it, the element loads the verification itself (admins only).
  • Reacts to provider or baseUrl set after the first update, the behaviour fix: react to provider set after the first update #565 asks for in other components. It ignores stale answers, tracks running verify and remove requests per service, and still reports a result that arrives after a reload, but shows it only for the same service of the same registry.
  • Fires ecc-service-verification-changed and ecc-service-verification-failed. The failure event carries the action, status, problem details and conflict code, the same way the service-create events carry them. Apps update the badge's verification from the changed event.

Docs: a page for each component, a Verifications section and types in the providers page, the code property in the Errors table, and a link in the package introduction.

Placement (review by anuragxxd):

  • Badge and actions are two elements (see above), so that apps can place the tag and the actions apart.
  • New rowBadges hook in the SR services list (ecc-client-ga4gh-service-registry-services), named as suggested: it renders badges in the name line, next to the version badge. feat(cloud-registry): verified badge in list #581 uses it. Badges are part of the clickable row (documented).
  • Changesets: cloud-registry minor, service-registry minor.

Closes #459

Verification

All commands were run in packages/ecc-client-elixir-cloud-registry unless noted.

  • npm run test -- --coverage: 95 tests passed in Chromium and Firefox. WebKit can't run on this machine: Playwright doesn't support its OS (Ubuntu 26.04), so CI covers WebKit. Line coverage of the new code: verifications.ts 100%, service-verification.ts 450/454.
  • npm run build: passes, and generates the component, its React wrapper and the custom elements manifest.
  • npm run lint at the repo root (husky pre-commit, all packages): 0 errors.
  • npx tsc -p tsconfig.prod.json: no errors.
  • npm run build in apps/documentation: passes, and the new page renders as /docs/cloud-registry/components/service-verification.
  • npx cspell on the cloud-registry docs pages: 0 issues.
  • 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, in two rounds. Fixed in round 1:
    • a reload during verify or remove dropped the result;
    • a stale preloaded verification came back after a reload;
    • case folding of U+1E9E and U+0131 differed from Python's;
    • code was missing on CloudRegistryError;
    • the intro link was missing;
    • tests were missing for the busy, race and missing-method branches. Round 2 (both reviewers): running requests now block only their own service, and results from another registry are no longer shown (also when kept over the app's verification). It also adds tests for removing a verification of a previous service, and docs notes on reloading and on passing stable values.
  • Sourcery (8 threads): 3 fixed. The component now loads again when the URL or API type of the service changes and after unclear verify or remove failures, and running requests are keyed by registry and service. 5 were answered with reasons in their threads (registry identity in the event, app-supplied values across registries, ordering between tabs, keeping results without verification, the badge in the services list). CI was green again after the fixes.

Review round for anuragxxd's changes

  • Merged dev (2.0.0-alpha.51) into the branch; the docs version is now 2.0.0-alpha.52.
  • Tests first: exact matching (verifications.test.ts), display modes incl. default, reflection, two instances in one row (service-verification.test.ts), rowBadges templates, strings, nodes, re-rendering and row clicks (SR services.test.ts).
  • Locally in Chromium and Firefox: cloud-registry 198 tests, service-registry 100 tests pass (WebKit can't run on Ubuntu 26.04). tsc -p tsconfig.prod.json clean in both packages, root npm run lint (incl. the docs build) passes, package builds pass.
  • adversarial-reviewer and quality-reviewer, two rounds. Fixed: docs for split instances (they need the app's verification) with a Lit example for rowBadges and rowActions incl. a View Details button; that rowBadges content selects the row; precise wording of when the registry removes a verification (checked against cloud-registry's service.py); more display and rowBadges tests.
  • CI: all checks pass (Lint, Test on Node 22 and 24, CodeQL, Codecov patch and project, Read the Docs preview, Sourcery).

Review round 2 by anuragxxd (two elements instead of display)

  • display is gone; the badge is a new presentational element, and the existing element offers only the actions (admins). Exact matching and rowBadges are unchanged.
  • Tests first: badge tests (date tooltip, fallback, no requests, show-unverified, updates); the actions tests now assert the buttons, and new tests cover non-admins (nothing shown, no request), admin turned on and off, a load answering after admin turned off, and a badge plus actions pair updated by the app from the changed event.
  • Locally in Chromium and Firefox: cloud-registry 102 tests pass (WebKit can't run on Ubuntu 26.04). tsc -p tsconfig.prod.json clean; root npm run lint (incl. the docs build, which renders the new page) passes; the build generates the React wrapper react/service-verification-badge.
  • adversarial-reviewer and quality-reviewer: no high findings. Fixed: the React list example is now a valid component; the examples treat only 404 as not verified and drop late answers; the properties table has an attribute column; the badge page says that the badge doesn't match services; tests for admin toggles and that the actions render no badge.

Declined review findings

  • Trailing newline added to tailwind.css (quality, low, round 2). Prettier's formatting; harmless.

  • Duplicated failureDetail (quality, medium). It is similar to the one in service-create. Sharing it means refactoring service-create, which is outside this issue, and other open work touches the package's components. A shared helper in providers/errors.ts would fit a follow-up.

  • Use trim().toLowerCase() instead of emulating casefold() (quality, low). The client should agree with the registry, which compares with strip().casefold(), and the Cloud Registry UI already uses this approach. The reviewer's brute-force check found only the two exceptions that this PR now handles.

  • Docs version 2.0.0-alpha.51 (quality, low). This is the next release, the first one that contains the component. Other pages give the version that introduced their component.

  • Test for a load that is still running when a verify or remove finishes (quality, round 2). The UI can't reach this: while a load runs, the component renders no buttons. The loadRequest bump in applied() stays as a safeguard, with a comment.

  • Docs version 2.0.0-alpha.52 (quality, low). The next release after the published alpha.51.

  • A case-only rename of the API type keeps the verification on the registry (adversarial, low). The registry then serves it with the new spelling, so a services list and a verifications list loaded together still match exactly; only lists loaded at different times can disagree, which the docs say.

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Enable Cloud Registry service verification management and status display across provider APIs and service registry components.

New Features:

  • Add Cloud Registry verification provider APIs, types, matching helpers, and administrative verification workflows.
  • Add separate verification badge and admin action web components with change and failure events.
  • Add service-list row badge rendering support for displaying verification status.

Enhancements:

  • Expose conflict codes through CloudRegistryError for verification and other registry conflicts.
  • Support shared verification data in service lists to avoid per-row requests and keep badges synchronized after changes.

Documentation:

  • Document the verification provider APIs, types, error codes, components, events, and service-list row badges.

Tests:

  • Add coverage for verification provider requests, exact matching, component behavior, event handling, races, and row badge rendering.

uniqueg and others added 5 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]>
@sourcery-ai

sourcery-ai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Data structures

Define the verification payload types and expose the conflict code on the public registry error.

  • packages/ecc-client-elixir-cloud-registry/src/providers/cr-provider.ts L83-114
  • packages/ecc-client-elixir-cloud-registry/src/providers/errors.ts L100-105, L117

API

Extend the provider contract and package exports with verification operations, types, and matching helpers.

  • packages/ecc-client-elixir-cloud-registry/src/providers/cr-provider.ts L139-148
  • packages/ecc-client-elixir-cloud-registry/src/providers/index.ts L21-26

Expose the verification component events and add the services-list row-badge renderer property.

  • packages/ecc-client-elixir-cloud-registry/src/events/ecc-service-verification-changed.ts L1-14
  • packages/ecc-client-elixir-cloud-registry/src/events/ecc-service-verification-failed.ts L1-27
  • packages/ecc-client-elixir-cloud-registry/src/events/index.ts L5-6
  • packages/ecc-client-ga4gh-service-registry/src/components/services/services.ts L28-36, L95, L133

Implementation

Implement the REST verification endpoints and exact-match helpers used to determine which services remain verified.

  • packages/ecc-client-elixir-cloud-registry/src/providers/rest-cr-provider.ts L8-10, L207-305
  • packages/ecc-client-elixir-cloud-registry/src/providers/verifications.ts L1-62

UI

Add the presentational verification badge and admin actions component, including their element registrations and styles.

  • packages/ecc-client-elixir-cloud-registry/src/components/index.ts L2-3
  • packages/ecc-client-elixir-cloud-registry/src/components/service-verification-badge/index.ts L1-15
  • packages/ecc-client-elixir-cloud-registry/src/components/service-verification-badge/service-verification-badge.ts L1-88
  • packages/ecc-client-elixir-cloud-registry/src/components/service-verification/index.ts L1-15
  • packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts L1-451
  • packages/ecc-client-elixir-cloud-registry/src/tailwind.css L47 (removed lines)

Render row badges in the services list beside the version badge.

  • packages/ecc-client-ga4gh-service-registry/src/components/services/services.ts L686-690

Configuration

Record the minor releases for the Cloud Registry verification feature and service-list row-badge hook.

  • .changeset/cloud-registry-verifications.md L1-5
  • .changeset/service-registry-row-badges.md L1-5

Documentation

Document the verification badge and admin actions, provider methods and types, and their integration with the services list.

  • apps/documentation/pages/docs/cloud-registry/components/service-verification-badge.mdx L1-80
  • apps/documentation/pages/docs/cloud-registry/components/service-verification.mdx L1-289
  • apps/documentation/pages/docs/cloud-registry/providers.mdx L36-41, L164-205, L309-330 (+1 small edits)
  • apps/documentation/pages/docs/service-registry/components/services.mdx L122, L241-269

Link the new verification components from the Cloud Registry introduction and update the component navigation metadata.

  • apps/documentation/pages/docs/cloud-registry/components/_meta.json L2-4
  • apps/documentation/pages/docs/cloud-registry/introduction.mdx L23-24

Tests

Test the verification badge, admin actions, provider endpoints and matching helpers, plus services-list row-badge rendering.

  • packages/ecc-client-elixir-cloud-registry/src/components/service-verification-badge/tests/service-verification-badge.test.ts L1-95
  • packages/ecc-client-elixir-cloud-registry/src/components/service-verification/tests/service-verification.test.ts L1-955
  • packages/ecc-client-elixir-cloud-registry/src/providers/tests/rest-cr-provider.test.ts L35-41
  • packages/ecc-client-elixir-cloud-registry/src/providers/tests/verifications.test.ts L1-231
  • packages/ecc-client-ga4gh-service-registry/src/components/services/tests/services.test.ts L656-715

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 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.68594% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.53%. Comparing base (47fd42d) to head (e6b0ed6).

Files with missing lines Patch % Lines
...nents/service-verification/service-verification.ts 97.78% 9 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #578      +/-   ##
==========================================
+ Coverage   74.40%   75.53%   +1.12%     
==========================================
  Files          63       68       +5     
  Lines       16815    17576     +761     
  Branches      925     1016      +91     
==========================================
+ Hits        12512    13276     +764     
+ Misses       4287     4283       -4     
- Partials       16       17       +1     

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

sourcery-ai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Linked issues

Checked at commit e6b0ed6

#459 feat(cloud-registry): verifications · 3 of 3 met

# Requirement Status Notes
1 Provider methods for the verification endpoints ✅ Met The optional provider interface and RestCloudRegistryProvider implement listing, reading, setting, and deleting verifications.
2 A component that shows a service's verification and lets admins verify it or remove it ✅ Met The presentational badge and admin-actions components provide these separately; the actions component also supports app-loaded verifications.
3 Apps can show and manage verifications without their own copy of the provider ✅ Met The provider APIs and components expose the verification functionality for apps to use directly.

@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 8 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/service-verification/service-verification.ts" line_range="301" />
<code_context>
+        this.own = { id, verification, provider };
+      }
+    }
+    this.changed(id, verification);
+  }
+
</code_context>
<issue_to_address>
**Old registry results corrupt new registry state**

When a mutation is pending while the app switches registries with an overlapping service ID, and the old response arrives afterward, `changed()` emits only the service ID and verification, so a list handler cannot distinguish the old registry’s result from the new registry’s. It can store or delete verification state in the new registry’s map, leaving the list with incorrect verification state.

Include registry identity in the event detail and have list handlers apply results only to the matching registry.

Also at `packages/ecc-client-elixir-cloud-registry/src/events/ecc-service-verification-changed.ts:5-7`, `packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts:386`.
</issue_to_address>

### Comment 2
<location path="packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts" line_range="224-229" />
<code_context>
+    this.loadRequest += 1;
+    const request = this.loadRequest;
+    const id = this.targetId;
+    if (this.verification !== undefined) {
+      const { own } = this;
+      this.current =
+        own && this.showsSame(own.id, own.provider)
+          ? own.verification
+          : this.verification;
+      return;
+    }
</code_context>
<issue_to_address>
**Old registry badge appears on new registry**

When the provider changes to a different registry while `verification` still contains a value loaded from the previous registry, `load()` treats any defined `verification` as authoritative without associating it with a registry. If the provider switches from registry A to registry B before the app replaces that property, the component skips B's GET and shows A's matching verification as B's, so users see a false Verified badge.

Scope supplied verifications to their registry and discard or reload them when the component switches to a different registry.
</issue_to_address>

### Comment 3
<location path="packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts" line_range="186" />
<code_context>
+      changedProperties.has("baseUrl") ||
+      changedProperties.has("serviceId") ||
+      changedProperties.has("verification") ||
+      (changedProperties.has("service") && previous?.id !== this.service?.id)
+    ) {
+      this.load();
</code_context>
<issue_to_address>
**Stale verification reappears as verified**

When the service’s URL or API type changes and later returns to its previously verified values without changing its ID, `updated()` skips `load()` when the service changes but keeps the same ID, leaving `current` unchanged. When the service returns to its old values, `matchesVerification()` matches that stale result and the component shows “Verified” even though the registry removed the verification.

Reload or clear `current` whenever the service changes, including changes to its URL or API type.

Also at `packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts:227-229`.
</issue_to_address>

### Comment 4
<location path="packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts" line_range="340" />
<code_context>
+      this.applied(id, verification, provider);
+    } catch (err) {
+      this.setPending(id, false);
+      this.fail(failureDetail(id, "verify", err, "Failed to verify service"));
+      if (
+        statusOf(err) === 409 &&
</code_context>
<issue_to_address>
**Mutation failures leave stale state**

When a verify or remove is applied by the registry but the client receives a timeout, connection failure, or error response, `verifyService()` and `removeVerification()` treat every non-conflict/non-404 rejection as a failed mutation without reconciling state. If the registry applied the change but the response was lost or errored, the component and any event-driven app map keep showing the old verification state.

Reconcile the verification after ambiguous mutation failures, while still reporting the failed request.

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

### Comment 5
<location path="packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts" line_range="301" />
<code_context>
+        this.own = { id, verification, provider };
+      }
+    }
+    this.changed(id, verification);
+  }
+
</code_context>
<issue_to_address>
**Older mutation overwrites newer state**

When separate component instances or tabs mutate the same service and responses arrive in a different order from the registry’s applied changes, `applied()` emits each mutation result as it arrives, with no ordering or version check. If two instances mutate the same service and the registry applies PUT then DELETE but the responses arrive in reverse order, an event-driven consumer can apply the old PUT result last and show the service as verified when it is not.

Reconcile state after mutation events or include and compare a server ordering/version value before applying results.
</issue_to_address>

### Comment 6
<location path="packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts" line_range="298-299" />
<code_context>
+      this.loadRequest += 1;
+      this.current = verification;
+      if (this.verification !== undefined) {
+        this.own = { id, verification, provider };
+      }
+    }
+    this.changed(id, verification);
</code_context>
<issue_to_address>
**Successful mutation result disappears**

When a verify or remove succeeds with `verification` undefined, then the provider is replaced for the same registry, `applied()` does not save the result in `own`, and `load()` clears `current` before refetching. A 404, failed, or stale refetch then hides the result of the successful mutation.

Save successful mutation results in `own` even when `verification` is undefined, so `load()` can reuse them after a provider change.
</issue_to_address>

### Comment 7
<location path="packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts" line_range="163" />
<code_context>
+
+  /** Whether a verify or remove of the service shown is running. */
+  private get busy(): boolean {
+    return this.pending.has(this.targetId);
+  }
+
</code_context>
<issue_to_address>
**Old registry request disables new actions**

When a request is pending while the provider switches to another registry with the same service ID, `pending` and `busy` use only the service ID, so the old registry’s request keeps Verify or Remove disabled for the new registry until it settles. A hung request leaves the new registry’s actions disabled indefinitely.

Key pending work by both registry and service ID, and have `busy` check the current registry’s key.

Also at `packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts:164`, `packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts:277-280`.
</issue_to_address>

### Comment 8
<location path="apps/documentation/pages/docs/cloud-registry/components/service-verification.mdx" line_range="120" />
<code_context>
+After a verify or remove, the component shows the result for that service until the app sets `verification` again, also if the provider is replaced meanwhile by one for the same registry (the same base URL, e.g. with a new token); update your verifications from `ecc-service-verification-changed`, as above. Pass a stable value (e.g. the object from the map, not one built on each render): every new value counts as set again.
+
+<Callout type='info'>
+  The services list of the GA4GH Service Registry package (`ecc-client-ga4gh-service-registry-services`) doesn't show verifications itself; place the component in a row's `actions-<id>` slot or in your own list.
+</Callout>
+
</code_context>
<issue_to_address>
**Badge missing from list**

The issue asks for a verified badge in the services list, but this change adds only a standalone component and says the list does not show verifications itself. Apps must wire the component into a row manually, so the list requirement remains partly met.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 8 findings to address first, and an admin can create a persistent verification record that the component displays as a badge, so a wrong verification could mislead users even after this code is reverted. The record is bounded and can be removed through the registry, but reverting the component alone does not remove it.

Blocking findings: packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts:301, packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts:229, packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts:186, packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts:340, packages/ecc-client-elixir-cloud-registry/src/components/service-verification/service-verification.ts:301, and 3 more


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

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]>

@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! Two changes, please:

  • Placement: the Verified / Not verified tag should sit with the version tag in the name line, so a row's tags stay in one place; in the actions column it reads as an action and splits the row's tags. Could the component expose the tag and the admin actions (Verify / Remove) separately, so apps can place them apart? The SR list would then need a hook next to the version tag (e.g. rowBadges, like rowActions); #581 can use it.
  • Matching: the registry returns each verification with the URL and type read from the service itself (verification.py), and removes it when either changes. So verifiedServices() can compare exactly, and the strip()/casefold() copy can go. Please also drop "(or form values)" in providers.mdx.

uniqueg and others added 6 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]>
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]>
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]>
@uniqueg

uniqueg commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review! Both points are done:

Placement

  • The SR services list (ecc-client-ga4gh-service-registry-services) has a new rowBadges hook, named as you suggested. It works like rowActions and renders its badges in the name line, after the version badge. The changeset bumps service-registry by a minor version.
  • ecc-client-elixir-cloud-registry-service-verification has a new display property that shows the tag and the admin actions apart:
    • all: the default, as before;
    • badge: only the tag ("Verified", and "Not verified" for admins);
    • actions: only Verify / Remove verification, for admins; other users see nothing.
  • A row uses two instances with the same verification: display="badge" from rowBadges and display="actions" from rowActions. The docs show this with an example. They also say that the app owns verification and updates it from ecc-service-verification-changed, and that rowActions replaces "View Details".

Matching

  • matchesVerification() and verifiedServices() now compare the URL, type.group and type.artifact exactly. The strip()/casefold() copy is gone.
  • "(or form values)" is removed from providers.mdx.
  • The docs now describe how the registry handles verifications: it serves them with the service's current values and removes them when the URL or the normalised type changes. So a services list and a verifications list loaded at the same time match exactly.

Also

  • Branch updated with dev by merging.
  • The docs version is now 2.0.0-alpha.52, because alpha.51 is out.
  • A changeset was added for the cloud-registry package.
  • New tests cover exact matching, the display modes (default, reflected, two instances in one row) and rowBadges (templates, strings, nodes, row clicks).

CI is green on 9c594e3 (Lint, Test on Node 22 and 24, CodeQL, Codecov, Read the Docs preview, Sourcery). Both reviewer agents ran two rounds; their fixes are in the docs and tests.

One open point for you: I chose the name display and its values all/badge/actions, while rowBadges follows your suggestion as written. If you prefer another name, or two separate elements, tell me and I will change it.

#581 builds on this branch and has been updated too.

@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, exact matching and rowBadges look good. On display: I'd prefer two elements: a presentational …-service-verification-badge (takes verification, no provider or loading) plus the existing one for the actions. With display, split use without a list loads twice per row, and the badge doesn't update after Verify unless the parent passes verification.

uniqueg and others added 5 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]>
@uniqueg

uniqueg commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

Thanks! Done: display is gone, and there are now two elements.

ecc-client-elixir-cloud-registry-service-verification-badge (new, presentational)

  • Takes verification only: no provider, no loading, no requests.
  • Shows "Verified", with the date as tooltip. With show-unverified (e.g. for admins) it shows "Not verified" for null/undefined; otherwise it shows nothing.
  • It shows what the app passes and doesn't compare it with the service. The docs say to pass verifications from verifiedServices() (or checked with matchesVerification()).

ecc-client-elixir-cloud-registry-service-verification (the existing element, now actions only)

  • Shows "Verify" or "Remove verification" to admins. Other users see nothing, and it no longer loads anything for them. It loads again when admin changes.
  • It takes verification from the app as before. Without it, the element loads the verification itself (admins only).
  • Exact matching, the events and the rowBadges hook are unchanged.

So a row loads nothing of its own: the app passes the same verification to both elements and updates it from ecc-service-verification-changed, and the badge follows. The docs show this for one service (React), a list (React) and the SR list with rowBadges/rowActions (Lit). The badge has its own docs page, and the changeset is updated.

Tests: new badge tests (tooltip, no requests, show-unverified, updates). The actions tests now check the buttons. New tests cover non-admins, admin turned on and off, a load that answers after admin turned off, and a badge plus actions pair that the app updates after Verify. 102 tests pass locally in Chromium and Firefox.

Both reviewer agents found no high findings; their medium findings were in the docs examples and are fixed. CI is green on f243573.

#581 is updated to use the two elements.

@uniqueg
uniqueg requested a review from anuragxxd November 16, 2026 20:44
uniqueg added a commit that referenced this pull request Nov 16, 2026
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]>

@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 two elements look good. LGTM.

@uniqueg
uniqueg merged commit 6114b9c into dev Nov 17, 2026
19 checks passed
@uniqueg
uniqueg deleted the feat/459-verifications branch November 17, 2026 20:26
uniqueg added a commit that referenced this pull request Nov 17, 2026
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]>
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(cloud-registry): verifications

2 participants