chore: extract web dashboard to separate repo, rename dashboard→admin#111
Conversation
Reviewer's GuideExtracts the Next.js web dashboard into a separate repository, removes all web build/infrastructure integration, and renames the backend dashboard package and configuration to a generic admin API while keeping the REST/WebSocket backend intact. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Extract the Next.js web frontend to its own repository (skyoo2003/devcloud-dashboard; history preserved via subtree split). The Go binary no longer builds, bundles, or serves a web UI — it exposes only the opt-in admin API at /devcloud/api/*. Rename internal/dashboard → internal/admin and the dashboard.enabled config key to admin.enabled, reflecting a general-purpose admin/introspection API rather than a UI-bound dashboard. Purge web from build tooling and infra: Makefile (build-web/build-all), Docker (Next.js build stage + web/out copy, frontend compose service), CI (Node/Next steps), dependabot (npm), labeler, pre-commit (eslint), .gitignore. Update docs and add changelog fragments.
6abfad7 to
f2887e1
Compare
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
Fixed security issues:
-
brace-expansion (link)
-
fast-uri (link)
-
next (link)
-
sharp (link)
-
The config rename from
dashboard.enabledtoadmin.enabledis currently a hard break; consider supporting the old key with a deprecation warning for at least one release to avoid silently disabling the admin API for existing deployments. -
Now that the Go binary no longer serves a UI and
webDiris always passed as an empty string, consider simplifyinggateway.Newand related routing comments by removing thewebDirparameter to make the interface reflect the current behavior.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The config rename from `dashboard.enabled` to `admin.enabled` is currently a hard break; consider supporting the old key with a deprecation warning for at least one release to avoid silently disabling the admin API for existing deployments.
- Now that the Go binary no longer serves a UI and `webDir` is always passed as an empty string, consider simplifying `gateway.New` and related routing comments by removing the `webDir` parameter to make the interface reflect the current behavior.
## Individual Comments
### Comment 1
<location path="cmd/devcloud/main.go" line_range="103-112" />
<code_context>
+ // Admin API: build the REST + WebSocket handler only when the operator
</code_context>
<issue_to_address>
**suggestion:** Align gateway API and comments with the fact that this binary no longer serves a web UI
The main package now always passes an empty `webDir` and notes that the binary serves no web UI, but `gateway.New` still takes a `webDir` and documents SPA-serving behavior. This discrepancy can mislead users of the API. If static UI serving is truly out of scope, consider removing `webDir` and the SPA behavior from `gateway.New`, or at least updating its doc comment to clarify that `webDir` is only for external callers and not used by this binary.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…key as deprecated alias gateway.New no longer takes a webDir parameter. Since the binary serves no web UI (always passed ""), the static/SPA-serving branch and the now-dead isAWSRequest helper are removed, so the interface reflects actual behavior. config: honour the deprecated `dashboard.enabled` key for one release — it maps to admin.enabled with a deprecation warning — so existing deployments don't silently lose the admin API after the rename. An explicit `admin` block wins.
…lloc Address code-review findings on the review-response commit: - config: make Config.Admin a pointer so parse can distinguish an explicit `admin` block from an absent one. The deprecated `dashboard` key now applies only when no `admin` block is present, so an explicit `admin.enabled: false` is no longer re-enabled by a leftover `dashboard.enabled: true`. Admin is defaulted to a zero value after, keeping downstream access nil-safe. - config test: assert the reverse precedence (explicit admin:false wins over deprecated dashboard:true), which was the uncovered regression path. - main: allocate the eventbus only inside the admin-enabled block instead of unconditionally discarding it when admin is off (the default).
|
Code-review findings 4 and 5 were pre-existing (not introduced here) and are tracked as follow-ups:
|
The web frontend was extracted to a separate repo in #111, leaving no JS/TS source. CodeQL's javascript-typescript analysis then fails with "No source code was seen during the build". Analyze Go only.
Summary
Extract the Next.js web dashboard into its own repository and rename the
internal/dashboardpackage to the more generalinternal/admin. The Go binary now ships only the opt-in admin API (/devcloud/api/*); the dashboard UI lives in a separate project that consumes it.Related Issue
Changes
git subtree split). The Go binary no longer builds, bundles, or serves a web UI.internal/dashboard→internal/adminand config keydashboard.enabled→admin.enabled(a general-purpose admin/introspection API, not a UI-bound dashboard). Tracked as git renames so blame is preserved.cmd/devcloud/main.go; the server is API-only.build-web/build-all), Docker (Next.js build stage +web/outcopy, frontend compose service), CI (Node/Next steps), dependabot (npm), labeler, pre-commit (eslint),.gitignore.Kept: the
internal/adminREST + WebSocket API (the external dashboard's backend). Untouched: CloudWatch/CloudTrail "Dashboard" AWS service APIs (unrelated feature).Test Plan
go build ./...,go vet ./...,go test ./internal/... ./cmd/...— all green.golangci-lint runon changed packages — 0 issues.Checklist
golangci-lint run)changie new, see docs/release.md) — or N/A (docs/tests/chore only)