Skip to content

feat(miner-ui): add a systemd unit for running miner-ui as a persistent service - #5607

Closed
joaovictor91123 wants to merge 1 commit into
JSONbored:mainfrom
joaovictor91123:feat/miner-ui-systemd-launcher-4852
Closed

feat(miner-ui): add a systemd unit for running miner-ui as a persistent service#5607
joaovictor91123 wants to merge 1 commit into
JSONbored:mainfrom
joaovictor91123:feat/miner-ui-systemd-launcher-4852

Conversation

@joaovictor91123

Copy link
Copy Markdown
Contributor

Summary

  • apps/gittensory-miner-ui had no CLI subcommand or process-manager config for running it durably — only a foreground dev server (npm run dev).
  • Its vite-ledgers-api.ts/vite-portfolio-queue-api.ts/vite-run-state-api.ts plugins already wire their local-SQLite-backed API routes into both configureServer (dev) and configurePreviewServer (preview), so npm run build && npm run preview already serves the built dashboard and its data routes with no new server code needed.
  • Adds systemd/gittensory-miner-ui.service.example, a companion unit to the existing gittensory-miner.service.example (the loop daemon) — mirrors its structure/comment style closely (Type=simple, Restart=on-failure, non-root User=, no --host since the dashboard has no auth of its own).
  • Documents it in apps/gittensory-miner-ui/README.md's new "Running as a persistent service" section, and cross-references it from the main miner's DEPLOYMENT.md bare-host walkthrough.
  • No source/runtime code changes — a new example config file plus documentation.

Test plan

  • New test/unit/miner-ui-systemd-launcher.test.ts: asserts the unit file has every required systemd directive ([Unit]/[Service]/[Install], Type=simple, ExecStart, WorkingDirectory, User, Restart=on-failure, WantedBy); asserts ExecStart targets the real @loopover/ui-miner workspace name read live from its package.json (not a hardcoded/stale name); asserts no --host flag; asserts the README and DEPLOYMENT.md cross-references exist.
  • npm run typecheck passes (after npm ci + rebuilding @loopover/engine, both required post-rebrand on this checkout).
  • npm run docs:drift-check passes.
  • test/unit/miner-deployment-docs-audit.test.ts (the DEPLOYMENT.md accuracy audit) passes.

Closes #4852

…nt service

apps/gittensory-miner-ui had no CLI subcommand or process-manager config for
running it durably -- only a foreground dev server. Its vite-*-api.ts plugins
already wire into configurePreviewServer as well as configureServer, so
`npm run build && npm run preview` already serves the dashboard and its
local-SQLite-backed data routes with no new server code needed.

Adds systemd/gittensory-miner-ui.service.example as a companion unit to the
existing gittensory-miner.service.example (the loop daemon), documents it in
the miner-ui README, and cross-references it from the main miner's
DEPLOYMENT.md bare-host walkthrough.

Closes JSONbored#4852
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.00%. Comparing base (7e55ebc) to head (54b1ff1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5607   +/-   ##
=======================================
  Coverage   95.00%   95.00%           
=======================================
  Files         573      573           
  Lines       45629    45629           
  Branches    14661    14661           
=======================================
  Hits        43350    43350           
  Misses       1528     1528           
  Partials      751      751           
Flag Coverage Δ
shard-1 43.99% <ø> (-0.05%) ⬇️
shard-2 35.81% <ø> (+0.11%) ⬆️
shard-3 32.02% <ø> (-0.17%) ⬇️
shard-4 30.98% <ø> (-1.71%) ⬇️
shard-5 32.69% <ø> (+0.90%) ⬆️
shard-6 44.50% <ø> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 13, 2026
@loopover-orb

loopover-orb Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-13 09:09:06 UTC

4 files · 2 AI reviewers · no blockers · readiness 100/100 · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
This is a docs/config-only PR that adds a systemd unit example for running the miner-ui dashboard via `vite preview`, mirroring the existing loop-daemon unit's structure and correctly relying on `configurePreviewServer` wiring already present in the vite plugins (per PR description) rather than adding new server code. The new test derives the expected `ExecStart` package name live from `apps/gittensory-miner-ui/package.json` rather than hardcoding it, which is the right way to guard against a stale workspace name. README and DEPLOYMENT.md cross-references are added and asserted by the test, closing the loop between doc claims and reality.

Nits — 5 non-blocking
  • systemd/gittensory-miner-ui.service.example:36 hardcodes `/usr/bin/npm` as ExecStart's binary — the comment above already flags this varies by nvm/asdf setups, so consider noting a `which npm` verification step more prominently in the README install steps rather than only in the unit comment.
  • No `Environment=NODE_ENV=production` (or equivalent) is set in the unit; `vite preview` doesn't strictly require it but some operators may expect production-mode defaults spelled out alongside the `GITTENSORY_MINER_CONFIG_DIR` example override.
  • test/unit/miner-ui-systemd-launcher.test.ts only checks substring containment for README/DEPLOYMENT.md content, so a typo'd anchor link (e.g. wrong case in `#running-as-a-persistent-service`) would still pass if hand-copied incorrectly elsewhere — low risk here since the test derives the exact string, but worth remembering for future doc cross-reference tests.
  • Consider adding a one-line `Environment=NODE_ENV=production` (or a comment explaining it's unnecessary for `vite preview`) so operators don't have to wonder.
  • In the README's new section, an explicit `which npm` pointer would save an operator a support round-trip when the shipped `/usr/bin/npm` path doesn't match their install.

CI checks failing

  • validate
  • validate-code
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #4852
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 141 registered-repo PR(s), 79 merged, 12 issue(s).
Contributor context ✅ Confirmed Gittensor contributor joaovictor91123; Gittensor profile; 141 PR(s), 12 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ⚠️ ℹ️ Insufficient signal risk: clean · value: insufficient-signal — Nothing measurable for the structural-improvement analyzers on this PR (e.g. no code files changed). LLM value judgment: moderate — The PR closes a real gap (no durable way to run miner-ui) with a narrowly-scoped, well-tested example config and doc updates rather than new source code, matching the linked issue #4852.
Linked issue satisfaction

Addressed
The PR adds a systemd unit example for running the miner-ui via vite preview as a persistent service, documents it in the miner-ui README with a new 'Running as a persistent service' section, cross-references it from the main DEPLOYMENT.md, and includes tests verifying the unit's correctness and doc cross-references.

Review context
  • Author: joaovictor91123
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, MDX, C++, CSS, Rust, TypeScript
  • Official Gittensor activity: 141 PR(s), 12 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before / after /
/ mobile before / (mobile) after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb

loopover-orb Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-code)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a daemon/launcher for the miner-ui

1 participant