Skip to content

fix(resources): add 'vector' to ResourceType — fixes missing connection_url + broken icon#154

Merged
mastermanas805 merged 1 commit into
mainfrom
bug-burner-r8/vector-resource-type
May 30, 2026
Merged

fix(resources): add 'vector' to ResourceType — fixes missing connection_url + broken icon#154
mastermanas805 merged 1 commit into
mainfrom
bug-burner-r8/vector-resource-type

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

When POST /vector/new shipped on 2026-05-20, the dashboard's typed surface was not updated alongside it (CLAUDE.md rule 22 — contract changes touch all surfaces). Result for any team that provisioned a vector resource:

  1. Detail page never fetched the connection URL. getResource() gates the /api/v1/resources/:id/credentials call on CREDENTIALED_RESOURCE_TYPES, which only listed postgres / redis / mongodb. vector was silently dropped, so the "Connection string" panel rendered empty — users could provision a pgvector database but never see the URL through the dashboard.
  2. ResourceIcon rendered undefined res-name-ico. The Record<ResourceType, string> map didn't include vector; the lookup returned undefined, producing a broken CSS class.

Fix

  • Add 'vector' to ResourceType (now exported as runtime-iterable RESOURCE_TYPES const so tests can sweep the registry).
  • Add 'vector' to CREDENTIALED_RESOURCE_TYPES and export it.
  • Add vector: 'ico-pg' to the ResourceIcon map — pgvector is a Postgres extension, so the visual family is the same. Wire distinction stays for audit + storage scans.
  • Registry-iterating regression tests (per rule 18): every RESOURCE_TYPES member (a) must yield a real ico-* class on ResourceIcon and (b) must appear in exactly one of CREDENTIALED_RESOURCE_TYPES or a NON_CREDENTIALED list. A future POST /something/new addition auto-fails the test until both decisions are wired.

Test plan

  • npm run build — green (tsc strict + vite build + prerender)
  • npm test — 1101 passed | 3 skipped (added 10 new tests, baseline was 1091)
  • After deploy: provision a vector resource via POST /vector/new, open it in the dashboard detail page, confirm the connection URL panel renders + icon shows the Postgres glyph.

Diff: 96 lines across 4 files.

…on_url + broken icon

When POST /vector/new shipped 2026-05-20, the dashboard's typed surface
was not updated alongside it (rule 22 — contract changes touch all
surfaces). Wire effect: a vector resource (pgvector-enabled postgres)
came back with resource_type="vector" and the dashboard:

1. Skipped the GET /resources/:id/credentials fetch on the detail page
   (vector was missing from CREDENTIALED_RESOURCE_TYPES), so users
   provisioning a vector resource could never see their postgres://
   connection URL through the dashboard.
2. Rendered the ResourceIcon as `undefined res-name-ico` — the icon
   class lookup returned undefined for the missing union member.

Fix:
- Add 'vector' to ResourceType (now exported as RESOURCE_TYPES const so
  tests can iterate the registry).
- Add 'vector' to CREDENTIALED_RESOURCE_TYPES (and export it for the
  coverage test).
- Add 'vector' to ResourceIcon map (reuses ico-pg — pgvector is a
  Postgres extension; wire distinction stays for audit/scan splits).
- Registry-iterating regression tests: every RESOURCE_TYPES member
  must (a) yield a real ico-* class on ResourceIcon and (b) appear in
  exactly one of CREDENTIALED_RESOURCE_TYPES or the test's
  NON_CREDENTIALED list. A future POST /something/new addition will
  auto-fail until both decisions are wired.

Local gate: `npm run build` (tsc + vite build + prerender) + `npm test`
both green. 1101 passing tests (added 10).
@github-actions
Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/assets/index-7FGKNfzq.js 0 B (-100% 🔽)
dist/assets/index-BsJUZYRr.css 6.13 KB (0%)
dist/assets/index-CdvC7st8.js 163.78 KB (+100% 🔺)

@mastermanas805 mastermanas805 merged commit 900e780 into main May 30, 2026
17 checks passed
@mastermanas805 mastermanas805 deleted the bug-burner-r8/vector-resource-type branch May 30, 2026 17:40
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