Skip to content

ci: add GitHub Actions workflow for Rust and UI - #5

Merged
JustAGhosT merged 1 commit into
devfrom
ci/add-github-actions-workflow
Aug 10, 2026
Merged

ci: add GitHub Actions workflow for Rust and UI#5
JustAGhosT merged 1 commit into
devfrom
ci/add-github-actions-workflow

Conversation

@JustAGhosT

@JustAGhosT JustAGhosT commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds .github/workflows/ci.yml. The repo had no CI at all — .github/workflows/ did not exist, and nothing ran tests on push or PR.

Two jobs, both on ubuntu-latest, both with timeout-minutes:

Job Steps Timeout
Rust cargo fmt --all --check, cargo clippy --workspace --all-targets, cargo test --workspace 40 min
UI (app/) npm ci, npx tsc --noEmit, vitest, npm run build 20 min

Caching: Swatinem/rust-cache@v2 for the cargo registry/git/target dir, and actions/setup-node@v5 with cache: npm keyed on app/package-lock.json.

Why now

During #3 the UI suite was running zero tests and still reporting success. app/src/test/setup.ts built a second JSDOM on top of vitest's jsdom environment, so render wrote to one document while screen queried another; the forks pool hung and printed "no tests" with a zero exit code. Three failing camera tests were invisible through three review rounds. That was fixed in #3 — but nothing would have caught it, and nothing would catch the next one.

Guarding the silent-zero specifically

Two layers, both verified rather than assumed:

  1. npx vitest run --passWithNoTests=false instead of the npm test script. npm test is a bare vitest, i.e. watch mode — it only terminates under CI because vitest happens to detect $CI, which is too implicit to hang a merge gate on. I confirmed the flag produces a non-zero exit on an empty run before relying on it (a run matching no test files exits 1).
  2. An explicit "tests actually ran" assertion. --passWithNoTests only covers "no test files were found". It does not cover "files were collected but zero tests executed", which is closer to what actually happened in feat(camera): add private local viewer #3. So the test step also emits a JSON report and a follow-up step fails the job unless numTotalTests >= 1.

I proved the gate bites rather than trusting a green check: a deliberate empty run on this branch turned the UI job red at the Test step (No test files found, exiting with code 1), while the Rust job stayed green. That commit is not part of this PR.

Verification

Both jobs ran green on this branch before the PR was opened (run 31391034448) — not just "the YAML parses":

  • Rust: fmt clean, clippy clean, cargo test --workspace ran 16 tests (5 deck + 3 deck-camera + 8 deck-contracts). The Tauri crate compiles on Linux with the installed system deps.
  • UI: vitest executed 51 tests (51 passed) across 5 files, typecheck and build clean.

Judgement calls

Tauri system deps are installed rather than scoping the Rust job. app/src-tauri is a real Tauri 2 app, so the workspace needs the webkit2gtk/libsoup stack; deck-camera additionally pulls keyring → secret-service → libdbus-sys, hence libdbus-1-dev. Scoping to -p deck-camera -p deck-contracts would have skipped the largest crate (28 source files) and the exact files carrying the known clippy warnings. Installing the deps costs ~30s and keeps --workspace honest.

Clippy runs without -D warnings. app/src-tauri currently has 6 warnings — 4 in services/helpers.rs, 1 in services/ports.rs, 1 in services/status.rs. Denying warnings before fixing them would fail the job on arrival. There is a comment in the workflow saying to add -- -D warnings once they are fixed, so the count cannot quietly grow.

Noted, not fixed here

The reconnect/backoff and frame-inactivity-timeout logic in crates/deck-camera/src/lib.rs has no test coverage. deck-camera's 3 tests only cover credential/locator validation. That is the most intricate logic in the crate and it is currently unguarded — worth its own PR.

Also worth knowing: app/src-tauri/gen/ is generated by the Tauri build and is not covered by .gitignore, so it shows up as untracked after a local build. Left alone deliberately, as it is unrelated to CI.

Summary by CodeRabbit

  • Chores

    • Added automated checks for code formatting, linting, typechecking, tests, test-report validation, and production builds.
    • CI now runs for pull requests and updates to the main development branches.
    • Added safeguards to cancel outdated runs and restrict repository access.
  • Refactor

    • Excluded generated test reports from version control.

The repo had no CI: nothing ran fmt, clippy, tests, typecheck or build on
push or PR.

Rust job runs cargo fmt --check, clippy --workspace --all-targets and
test --workspace on ubuntu-latest, installing the webkit2gtk/libsoup stack
that app/src-tauri needs plus libdbus-1-dev for deck-camera's keyring
dependency, so --workspace covers every crate rather than skipping the
Tauri app.

UI job runs npm ci, tsc --noEmit, the vitest suite and the vite build.
The test step uses an explicit `vitest run --passWithNoTests=false` rather
than the `npm test` script, which is a bare `vitest` (watch mode), and a
follow-up step asserts from the JSON report that tests were actually
executed -- guarding the failure seen in PR #3, where the suite reported
"no tests" and still exited 0.

Clippy deliberately runs without -D warnings: app/src-tauri has 6 existing
warnings that would fail the job on arrival.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Added a GitHub Actions workflow for Rust and UI checks on pull requests and pushes to dev or main. The workflow validates formatting, linting, tests, typechecking, Vitest reports, and production builds. CI-generated reports are ignored.

Changes

Continuous integration validation

Layer / File(s) Summary
Workflow controls and Rust validation
.github/workflows/ci.yml
The workflow defines pull request and branch triggers, cancels superseded runs, uses read-only contents access, installs Linux dependencies, configures stable Rust tooling, caches Cargo data, and runs formatting, Clippy, and workspace tests.
UI checks and production build
.github/workflows/ci.yml, app/.gitignore
The UI job installs Node dependencies, runs TypeScript checks, executes Vitest with a JSON report, validates that the report contains tests, builds the application, and ignores the generated report.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding GitHub Actions CI for both Rust and UI components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/add-github-actions-workflow

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

22-22: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Disable persisted checkout credentials.

Both checkouts run dependency-managed code afterward and no later step uses authenticated Git access. Set persist-credentials: false on line 22 and line 73.

Proposed fix
-      - uses: actions/checkout@v5
+      - uses: actions/checkout@v5
+        with:
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml at line 22, Disable persisted checkout credentials
for both actions/checkout@v5 steps: update .github/workflows/ci.yml lines 22-22
and 73-73 to set persist-credentials to false.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/ci.yml:
- Line 22: Disable persisted checkout credentials for both actions/checkout@v5
steps: update .github/workflows/ci.yml lines 22-22 and 73-73 to set
persist-credentials to false.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 859c0c1c-593f-4a3e-8f96-45ca180b3868

📥 Commits

Reviewing files that changed from the base of the PR and between eb7e9c7 and f2ce3aa.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • app/.gitignore

@JustAGhosT
JustAGhosT merged commit bc0d1c5 into dev Aug 10, 2026
3 checks passed
@JustAGhosT
JustAGhosT deleted the ci/add-github-actions-workflow branch August 10, 2026 13:42
JustAGhosT added a commit that referenced this pull request Aug 10, 2026
Lands the detailed spec and ADR that baton task 0e6c0c19 was gated on
("NEXT: detailed spec + ADR required before build"). Both were authored
2026-07-11 and had existed only as untracked files in a local working
tree — no branch, no remote, no copy anywhere.

- docs/adr/0001-deck-as-panel-host-for-mystira-ops-tooling.md (Proposed)
  deck stays a generic panel-host; Mystira ops tooling is hosted as
  bounded, individually-omissible panel modules on top of it. Establishes
  docs/adr/NNNN-*.md as deck's ADR home.

- docs/specs/deck-ops-cockpit.md (Draft)
  Design for the three R13 facets: a Dashboard cost/ops section (sluice
  health + docket spend), the Cosmos Explorer + Migration Manager re-port,
  and a Service-Manager story-gen batch-run monitor. Establishes
  docs/specs/ as the home for deck design specs.

Re-grounded against dev @ bc0d1c5 before landing. The design is unchanged;
current-state evidence was corrected where deck had moved since July:

- §1.2 claimed the frontend could not typecheck due to dangling imports of
  the removed panels. PR #3 removed that wiring; PR #5's CI proves the
  build is green. Kept in corrected form — the extraction is still
  unfinished, but the evidence is now behavioural: dead Dashboard
  quick-actions falling through to the Service Manager, orphaned
  StatisticsPanel/ExportPanel callers, live backends with no UI.
- §1.3 claimed outbound HTTP would be gated by a Tauri capability
  addition. It would not: deck uses native reqwest, which
  capabilities/default.json does not constrain. Now states the real
  requirement — https + host allowlisting enforced in Rust.
- §1.1 records crates/deck-camera and the CI gates; §5.4 points at the
  existing crates/deck-contracts/src/story_generator.rs.

Docs-only: no code, no CI surface touched.
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