feat(miner-ui): add queue release/requeue actions, completing the miner-ui action controls - #5638
feat(miner-ui): add queue release/requeue actions, completing the miner-ui action controls#5638galuis116 wants to merge 1 commit into
Conversation
…er-ui action controls The governor pause/resume half of the miner-ui action controls landed in JSONbored#5611, deliberately deferring the queue release/requeue half: acting on a specific queue item needs its repoFullName/identifier, which the read-only portfolio-queue API never republishes (by design, to avoid leaking the queue's rank-derived priority ordering). Adds vite-queue-actions-api.ts, a narrow /api/queue/actionable read route that exposes only in-flight (releasable) and completed (requeueable) items with just the fields needed to identify and act on them, plus /api/queue/release and /api/queue/requeue write routes bridging directly to portfolio-queue.js's existing reclaimStuckItem/requeueItem methods -- the same functions the CLI's queue release/requeue commands already use. Adds matching UI controls to the portfolio page, mirroring the governor control section's pending-state and error-handling pattern.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 LoopOver review result - reject/close recommendedReview updated: 2026-07-13 18:06:40 UTC
🛑 Suggested Action - Reject/Close
Review summary Nits — 6 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agent
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk 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.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands Visual preview
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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
Gittensory is closing this pull request on the maintainer's behalf (Linked issue overlaps another open PR; duplicate of another open PR). 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. |


Summary
pause/resume controls (API + UI). That PR's own header comment deliberately deferred the OTHER half — queue
release/requeue — noting that acting on a specific queue item needs its
repoFullName/identifier, whichthe read-only portfolio-queue API (
vite-portfolio-queue-api.ts) intentionally never republishes over thewire (by design, to avoid leaking the queue's rank-derived
priorityordering). This PR resolves thatfollow-up and completes the issue.
apps/gittensory-miner-ui/vite-queue-actions-api.ts, a narrow, purpose-built route:GET /api/queue/actionable— exposes ONLY the two slices an operator actually needs to act on: in-flightitems (
releasable) and completed items (requeueable), and only the fields needed to identify + act onthem (
apiBaseUrl/repoFullName/identifier, plus aleasedAt/enqueuedAttimestamp for context).priorityis stripped from every response on this route, matching the read-only sibling's own rule.POST /api/queue/release/POST /api/queue/requeue— bridge directly topackages/gittensory-miner/lib/portfolio-queue.js's existingreclaimStuckItem/requeueItemstoremethods, the SAME functions
gittensory-miner queue release/queue requeuealready use. No new queuesemantics are invented here.
effect of a doomed-to-fail action: acting on an item in a store that doesn't exist yet can never succeed.
apps/gittensory-miner-ui/src/lib/queue-actions.ts(client, mirrorsgovernor.ts's shape) and wired anew "Queue actions" section into the portfolio page, mirroring the governor control section's
pending-state/error-handling pattern — each row tracks its own pending state (a
Setof item keys) ratherthan one global flag, since multiple different rows can plausibly be acted on independently.
vite dev, confirmed/api/queue/actionablecorrectly rejects an unauthenticated request (401, via the existingvite-auth.tscookie gate) and returns an empty snapshot on a fresh install; then enqueued/claimed/completed real items via
portfolio-queue.jsdirectly, confirmed they appeared correctly in/api/queue/actionable, released one andrequeued the other via the real POST routes, and confirmed both disappeared from the actionable snapshot
afterward exactly as designed.
Fixes #4857
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coverage— this PR's surface isapps/gittensory-miner-ui/**, covered by that app's own real coverage gate (Bring the miner-ui and extension under a coverage gate #4865/test(miner-ui): bring the miner-ui under a real coverage gate #5613), not the root Codecov config.npm --workspace @loopover/ui-miner run test(vitest run --coverage): 149/149 tests pass, well above the app's threshold (85/85/75/85). The three new/changed files are essentially fully covered:vite-queue-actions-api.ts97.33/98.03/95/98.46 (the one gap is the real default dependency's dynamic import, the same class of gapvite-governor-api.tsitself has),queue-actions.ts100/100/100/100,portfolio.tsx100/100/100/100.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run build:minernpm run test:miner-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateRan the full local gate:
npm run test:ci(0 failures) andnpm audit --audit-level=moderate(0 vulnerabilities), both clean on the final commit.New/extended
apps/gittensory-miner-ui/src/queue-actions.test.tsx(32 tests), mirroringgovernor.test.tsx's exact structure:QueueActionsSectionrendering (loading/error/empty states, per-row release/requeue button wiring, per-row-not-global pending disable, action-error alert, null-leasedAtem-dash fallback);fetchQueueActionable/releaseQueueItem/requeueQueueItemclient-lib tests including malformed-payload and non-Error-throw branches;matchQueueActionsRouteroute matching;handleQueueActionsRequestcovering the fresh-install fast path for BOTH read and write routes, priority-stripping, business-outcome failures (not-actionable) vs. real errors (500), body validation (empty/malformed/missing-field → 400), an explicit-apiBaseUrl-threading test, and a non-Error-throw test; the rawqueueActionsApiPluginVite middleware wiring (fall-through, real POST body handling,configurePreviewServer); andPortfolioPage-level wiring tests confirming a successful action re-fetches the actionable snapshot while a business-outcome failure does not, and that the Requeue button is wired torequeueActiondistinctly from Release.Safety
vite-auth.ts's existing cookie gate covers these new routes automatically with no per-endpoint wiring, exactly as it did for the governor routes.UI Evidencesection below. — see below.UI Evidence
Verified live against the real
vite devserver rather than a screenshot tool (no browser available in thisenvironment):
GET /api/queue/actionablecorrectly returns401without the auth cookie, and with it returns{"releasable":[...],"requeueable":[...]}reflecting real enqueued/claimed/completed items created directlyvia
portfolio-queue.js;POST /api/queue/releaseandPOST /api/queue/requeueagainst those real items bothreturned
{"ok":true,"entry":{...}}, and a follow-upGET /api/queue/actionableconfirmed both items nolonger appeared in the actionable snapshot. The UI component tests (
queue-actions.test.tsx) render andinteract with the actual
QueueActionsSection/PortfolioPagecomponents via@testing-library/react,covering the loading/error/empty/populated render states, button wiring, and the pending/error UI feedback the
underlying API calls above drive.
Notes
vite-governor-api.ts,vite-portfolio-queue-api.ts, or the ledgers page — thisPR is scoped strictly to the queue release/requeue half feat(miner-ui): add governor pause/resume controls #5611 left open.
portfolio-queue-api.ts's aggregation to add identifiers to itsexisting route — instead added a SEPARATE, narrowly-scoped
/api/queue/actionableroute so the existingread-only endpoint's privacy contract (status counts only, never raw identifiers/priority) stays completely
unchanged for any other caller.