Skip to content

feat(web): consume v2 API for the config-resource bundle - #228

Merged
Makisuo merged 7 commits into
mainfrom
feat/web-config-resources-v2-migration
Jul 18, 2026
Merged

Makisuo merged 7 commits into
mainfrom
feat/web-config-resources-v2-migration

Conversation

@Makisuo

@Makisuo Makisuo commented Jul 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

Migrates the dashboard off the v1 client (MapleApiAtomClient) onto the already-shipped v2 endpoints (MapleApiV2AtomClient) for the four config-resource groups whose v2 surface landed in #224 but was never consumed by the UI:

v1 group → v2 group UI surfaces
ingestKeys (get, reroll*) ingestKeys (retrieve, roll*) ingestion settings, install modal, connect-credentials, ingest connection
ingestAttributeMappings attributeMappings attribute-mappings settings, recommended-mappings, recommendation route
scrapeTargets scrapeTargets scrape-targets settings, integration catalog
recommendationIssues recommendations recommended-mappings, recommendation route

Why

The #224 config-resource bundle was built, tested, and documented, but the dashboard still called the v1 client for all of it — so the v2 write path was effectively dark. This wires the UI to it, matching the documented convention that each v1 group is deleted once nothing consumes it.

Notable deltas (beyond mechanical snake_case / param renames)

  • Payloads: v2 param schemas are Schema.Struct, so mutations pass plain snake_case objects (not new V2…Params({...})).
  • IDs round-trip to raw internal IDs at the client boundary (the PublicId codec decodes responses back to raw UUIDs and re-encodes on request). So row.id and the /recommendations/$recommendationKey route param are unchanged from v1.
  • List pagination: v2 lists are cursor-paginated (default 20). attributeMappings + recommendations page through all pages via a runtime.atom cursor loop (module singletons, so useAtomRefresh still shares one fetch). scrapeTargets keeps .query(...) with limit: 100 to preserve its reactivityKeys invalidation (a runtime.atom would drop it).
  • Reconciliation stays refetch-based (no txid): manual useAtomRefresh for mappings/recommendations/ingest keys; reactivityKeys for scrape targets. Both clients share appRegistry, so the PlanetScale card's v1 integrations mutations still invalidate the migrated v2 scrape-target list.

Out of scope (intentionally left)

  • alert_incidents and scrapeTargets.listChecks stay on ElectricSQL shapes.
  • The integrations OAuth group in the catalog (Cloudflare/PlanetScale/Hazel/GitHub status) stays v1.
  • Deleting the now-unused v1 groups is a follow-up (gated on confirming no non-web consumers).

Verification

Note: config-resources.http.test.ts currently fails on main due to unrelated in-progress InvestigationService wiring (the v2 investigations/anomalies work), not this change — this PR is web-only.

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Migrate the dashboard off the v1 client (`MapleApiAtomClient`) onto the
already-shipped v2 endpoints (`MapleApiV2AtomClient`) for the four
config-resource groups whose v2 surface (#224) was built but still dark:

- ingest_keys      (get -> retrieve, reroll* -> roll*)
- attribute_mappings (v1 ingestAttributeMappings)
- scrape_targets
- recommendations  (v1 recommendationIssues)

Reads stay refetch-based (no txid): manual useAtomRefresh for
mappings/recommendations/ingest keys, reactivityKeys for scrape targets.
Both clients share appRegistry, so the PlanetScale card's v1 integrations
mutations still invalidate the migrated v2 scrape-target list.

Notable deltas handled beyond mechanical snake_case/param renames:
- v2 payload schemas are Schema.Struct -> pass plain snake_case objects
  (no `new V2…Params`).
- Prefixed public IDs round-trip to raw internal IDs at the client
  boundary, so row ids and the /recommendations/$recommendationKey route
  param are unchanged.
- v2 lists are cursor-paginated (default 20): attribute_mappings and
  recommendations page through all pages via a runtime.atom cursor loop;
  scrape_targets keeps .query(...) with limit:100 to preserve its
  reactivityKeys invalidation.

Left as-is: alert_incidents and scrape_targets listChecks (Electric), and
the integrations OAuth group in the catalog (v1). Deleting the now-unused
v1 groups is a follow-up.

Verified: apps/web typecheck clean; browser e2e for all four groups —
reads + create/update/delete/probe/dismiss/reopen hit /v2/... with correct
snake_case shapes and refetch reconciliation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pullfrog

pullfrog Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Your Pullfrog Router balance is exhausted.

You have a card on file but auto-reload is disabled, so runs paused once your balance went past the overdraft buffer.

Top up balance → · Enable auto-reload →

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Opus | 𝕏

@Makisuo
Makisuo merged commit 6772605 into main Jul 18, 2026
8 checks passed
@Makisuo
Makisuo deleted the feat/web-config-resources-v2-migration branch July 18, 2026 14:06

This branch was previously deployed

1 inactive deployment
pr-preview — 210c3f65 Deployed Jul 18, 2026 by Makisuo via deploy-pr-preview #915
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.

1 participant