Add a CI Runs sidebar panel — latest GitHub Actions status per repo#50
Merged
Conversation
New src/gh_runs.rs polls the GitHub Actions API for the newest workflow run per configured repo and surfaces it in an optional sidebar panel, mirroring the Remote Hosts panel end-to-end (cache + last-good fallback + rate-limit display). - Config: DASHBOARD_GH_REPOS (owner/repo;... cap 8, deduped) and DASHBOARD_GH_TOKEN. The token is env-only: never serialized into the /api/gh-runs response, never written to a *.json store, never logged. - Route: GET /api/gh-runs behind the same allowed+signed_in guard as the other panels. 55s in-memory cache to stay within GitHub rate limits. - Panel: off by default; enable via Configure (panels.ciRuns). Renders status badge (queued/in_progress amber-pulse, success green, failure red), branch tag, run #, relative time, link to the run. - Also drops in docs/shelldeck-saas-plan.md (the ultracode-designed 4-phase plan; this panel is Phase 0). Verified: cargo build --release + bun build green, cargo test 34 passed, screenshot-checked the rendered panel against two live repos with zero console errors, confirmed the token never appears in the API response. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds a new optional “CI Runs” sidebar widget that polls a new backend endpoint to show the latest GitHub Actions workflow run per configured repo, including caching/fallback behavior and UI configuration support.
Changes:
- Backend: add
/api/gh-runsplussrc/gh_runs.rsto fetch latest workflow-run status per repo with in-memory caching and last-good fallback. - Configuration: introduce
DASHBOARD_GH_REPOS+DASHBOARD_GH_TOKENand a new UI panel togglepanels.ciRuns(default off). - Frontend: render the new panel, poll it on an interval, and style CI status badges/cards.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/settings.rs | Adds ciRuns to persisted dashboard panel settings + parsing/tests. |
| src/routes.rs | Registers /api/gh-runs route and handler behind existing guard. |
| src/pages.rs | Injects the new “CI Runs” panel HTML into the sidebar template. |
| src/main.rs | Adds gh_runs_cache to app state and wires the new module. |
| src/gh_runs.rs | New module: fetch latest GitHub Actions runs per repo with cache + last-good fallback. |
| src/config.rs | Adds env parsing for DASHBOARD_GH_REPOS + optional DASHBOARD_GH_TOKEN (+ tests). |
| public/metrics.js | Implements CI runs polling/rendering in served JS output. |
| public/events.js | Adds initial + interval calls to loadGhRuns() in served JS output. |
| public/core.js | Extends default dashboardSettings.panels with ciRuns in served JS output. |
| public/app.css | Adds styling for CI run cards and status badges. |
| public/actions.js | Adds Configure UI checkbox + applies ciRuns visibility in served JS output. |
| frontend/metrics.ts | Implements CI runs polling/rendering (TS source). |
| frontend/events.ts | Adds initial + interval calls to loadGhRuns() (TS source). |
| frontend/core.ts | Extends panel settings types/defaults with ciRuns (TS source). |
| frontend/actions.ts | Adds Configure UI checkbox + applies ciRuns visibility (TS source). |
| docs/shelldeck-saas-plan.md | Adds Phase 0 SaaS plan doc including CI-runs monitor scope. |
| .env.example | Documents new GH env vars for the CI Runs panel. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+69
to
+70
| # Configure after setting repos. Unauthenticated GitHub API calls are limited to 60 req/hr, | ||
| # so set DASHBOARD_GH_TOKEN for more than ~1-2 repos or frequent dashboard use. |
Comment on lines
+86
to
+90
| pub async fn fetch_all( | ||
| config: Arc<Config>, | ||
| client: reqwest::Client, | ||
| cache: Arc<Mutex<Option<GhRunsCache>>>, | ||
| ) -> GhRunsResult { |
Comment on lines
+85
to
+88
| .replace( | ||
| r#"</div></section><section class="panel unlock-panel""#, | ||
| &format!(r#"</div></section>{}<section class="panel unlock-panel""#, ci_runs_panel), | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an optional CI Runs sidebar panel that shows the latest GitHub Actions workflow-run status for each configured repo — branch, run #, conclusion badge, relative time, and a link to the run. Mirrors the existing Remote Hosts panel end-to-end.
This is Phase 0 of the ShellDeck → self-serve SaaS plan (
docs/shelldeck-saas-plan.md), the safest, fully self-contained piece — it touches only ShellDeck's own dashboard.How it works
src/gh_runs.rs— GETs…/actions/runs?per_page=1&exclude_pull_requests=trueper repo via the shared reqwest client, with a 55s in-memory cache + last-good fallback so a transient GitHub error never blanks the panel. SurfacesX-RateLimit-Remaining/Reset.DASHBOARD_GH_REPOS(owner/repo;owner2/repo2, deduped, cap 8) andDASHBOARD_GH_TOKEN.GET /api/gh-runsbehind the sameallowed + signed_inguard as the other panels.panels.ciRuns). Status badge: queued/in_progress = amber-pulse, success = green, failure = red, else muted.Security
The GitHub token is env-only: it is never included in any
Serializestruct, never written todashboard-config.json(or any store), and never logged (a redaction regex already stripsBearerfrom logs). Verified by grep across all touched files and by inspecting the live/api/gh-runsJSON.Verification
cargo build --release✅ ·bun run build:frontend✅ ·cargo test34 passed ✅falkoro/shelldeck,spot-techno/spot-suite) — panel renders correctly, both runs show real status, zero console errors, token absent from the API response.🤖 Generated with Claude Code