Skip to content

refactor(ui)!: take the dashboard's API paths from the generated client - #625

Draft
PiquelChips wants to merge 2 commits into
mainfrom
refactor/client-boundary-api-paths
Draft

PiquelChips wants to merge 2 commits into
mainfrom
refactor/client-boundary-api-paths

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

What and why

The dashboard wrote some API paths by hand (the manifest download link, and the operation timeline and event streams it opens with EventSource), as did the client for the requests Progenitor can't generate (TOML apply and plan, the local preview upload, the exec WebSocket). Nothing tied those strings to the API, so a route could change under them unnoticed.

generate_openapi now also writes piqueld_client::paths from the OpenAPI document: one function per operation, named after its operation ID as the generated client's methods are (with heck, as Progenitor names them), that builds the path with string parameters percent-encoded as the client encodes them. The dashboard and the client's hand-written requests take their paths from it, and just openapi-check keeps it current. API_PREFIX, which nothing uses any more, goes (a public Rust item of piqueld-core and piqueld-client; the HTTP API is unchanged, and generated.rs and openapi-v1.json don't change).

The links and streams stay as they are: the browser downloads the manifest from the link and reconnects the EventSource streams itself, so they need a URL rather than a client call. What's left in the dashboard is a doc comment naming GET /api/v1/system/checks; the client keeps its /api/v1/auth/ prefix checks in its transport, which test a namespace, not a route.

Fixes PQD-162

Proved with just openapi-check, just ui-check, just check-wasm, wasm32 and native Clippy for the changed crates and the generator, and just docs. cargo test -p piqueld-client passes. just test-playwright tests/editor.spec.ts tests/deployments.spec.ts could not run locally: the overloaded host Docker engine took over 120 seconds to create the browser container, three times. The Playwright job runs both specs once this is marked ready.

Checklist

  • The feature reaches each surface in AGENTS.md it applies to,
    documentation included, with its reverse states. (A refactor: no surface changes; the module-boundaries page and the client-generation README describe paths.)

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips PiquelChips changed the title refactor(ui): take the dashboard's API paths from the generated client refactor(ui)!: take the dashboard's API paths from the generated client Nov 22, 2026
The dashboard wrote its manifest download link and its two event
streams' paths by hand, and the client its TOML, local preview and exec
requests' paths, so a route could change under them unnoticed.
generate_openapi now also writes piqueld_client::paths, one function per
operation named like its client method, from the OpenAPI document, and
they take their paths from it. API_PREFIX, which nothing uses any more,
goes.

Fixes PQD-162
The path functions are named after the API's operation IDs, as the
generated client's methods are, not like the public Client methods; the
docs now say so. The generator names them with heck's snake case, as
Progenitor does, so the two can't disagree, and takes the document's
paths from run() instead of reading them again.

Part of PQD-162
@PiquelChips
PiquelChips force-pushed the refactor/client-boundary-api-paths branch from 2455bd9 to 8a3df82 Compare November 22, 2026 22:12
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