Skip to content

fix(portal): mark disabled Jobs board as setup required - #172

Merged
gossion merged 1 commit into
mainfrom
fix/portal-jobs-setup-state
Aug 26, 2026
Merged

gossion merged 1 commit into
mainfrom
fix/portal-jobs-setup-state

Conversation

@gossion

@gossion gossion commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

  • return a distinct setup_required state when the computed Jobs board has no configured scope
  • render a setup guide instead of an outage-style error for that expected state
  • preserve existing error handling for Kubernetes access and query failures

Validation

  • cd portal; go test ./internal/portalapi -run 'TestConfiguredJobsModesAllowMissingKubernetesReader|TestPortalShellContainsWorkspaceScopeContract' -count=1 -v
  • python3 scripts/check-license-headers.py

@gossion
gossion marked this pull request as ready for review August 26, 2026 02:21
@gossion
gossion requested a lite review from Copilot August 26, 2026 02:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Portal “Jobs” computed board to distinguish an expected “not configured yet” condition from genuine outages by returning a dedicated setup_required state when no Jobs scope mode is configured, and rendering a setup guide in the UI for that state. This keeps the existing behavior for real Kubernetes access / query failures.

Changes:

  • Return state: "setup_required" (with a setup-oriented reason) when Jobs scope mode is disabled/unset.
  • Extend the frontend fetchJSON error handling to preserve status and state from scoped JSON error envelopes.
  • Render a “Jobs board setup required” guide (instead of an outage-style warning) when receiving the setup_required state; update tests accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
portal/internal/portalapi/server.go Emits a setup_required state for the disabled Jobs board gate via writeScopedJSON.
portal/internal/portalapi/server_test.go Updates expectations to assert the new reason text and that the disabled response includes "state":"setup_required", and verifies the portal shell contains the new UI contract strings.
portal/internal/portalapi/assets/index.html Propagates status/state on thrown fetch errors and renders a setup guide for 503 + setup_required.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@feiskyer Pengfei Ni (feiskyer) 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.

LGTM

@gossion
gossion merged commit 2214dc2 into main Aug 26, 2026
32 checks passed
@gossion
gossion deleted the fix/portal-jobs-setup-state branch August 26, 2026 04:18
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.

3 participants