Skip to content

feat: expand Delivery and managed PR dev - #341

Merged
mira-2026 merged 4 commits into
mainfrom
mira/rename-delivery-page
Jul 27, 2026
Merged

feat: expand Delivery and managed PR dev#341
mira-2026 merged 4 commits into
mainfrom
mira/rename-delivery-page

Conversation

@mira-2026

@mira-2026 mira-2026 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • rename the Dashboard PR page and navigation item to Delivery
  • move the page, feature components, hooks, and focused test files to delivery-oriented names
  • expose only the new /delivery UI route; the old /pull-requests page route is intentionally removed
  • keep the existing /api/pull-requests/* backend contract unchanged
  • show Rebuild dev when a running PR-dev slot is behind the PR head
  • make Delivery action success/error banners dismissible
  • reuse one managed checkout at /home/ubuntu/projects/mira-dashboard-preview
  • disable source watchers and frontend HMR only for the fixed, read-only managed PR checkout; ordinary local/worktree development keeps hot reload
  • remove a closed PR's isolated state and, when it owns the slot, the shared checkout and active record
  • reconcile PRs closed directly on GitHub through an exclusive, revalidated cleanup job without making Delivery availability depend on cleanup status
  • document the shared Bun cache, isolated installer home, state layout, and production/control paths

Managed state

  • per-PR application state remains isolated under mira-dashboard-preview-state/managed/states/pr-<number>
  • managed/bun-cache and managed/installer-home are intentionally retained between PRs
  • legacy preview-pr-* worktrees are not migrated or deleted by application code; the existing PR feat: expand Delivery and managed PR dev #341 worktree can be removed manually after rollout

Verification

  • bun run build
  • bun run lint
  • uncached ESLint on every changed TypeScript file in the frontend and backend
  • bun run format:check
  • bun run test:coverage — 481 frontend tests at 94.51% and 587 backend tests at 89.98%
  • git diff --check

@mira-2026
mira-2026 requested a review from rajohan as a code owner July 27, 2026 14:44
@mira-2026 mira-2026 added status: needs-review Ready for human or agent review type: refactor Internal restructuring without intended behavior change area: frontend Frontend UI, client state, routing, and browser behavior labels Jul 27, 2026
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull-request dashboard is renamed and routed as Delivery. Delivery-scoped hooks, release and preview controls, managed preview cleanup, hot-reload configuration, tests, and documentation are updated.

Changes

Delivery page migration

Layer / File(s) Summary
Delivery data contracts and page behavior
src/hooks/*, src/pages/Delivery.tsx, src/components/features/delivery/*
Delivery query keys, deployment hooks, release status UI, preview rebuild controls, and action-result handling are updated.
Delivery routing, navigation, and coverage
src/router.tsx, src/components/layout/Layout.tsx, src/test/*
The authenticated route, navigation badge, integration tests, page tests, and component tests now use /delivery and Delivery components.
Managed preview lifecycle
backend/src/services/pullRequestPreviewHost.ts, backend/src/services/pullRequestPreviews.ts, backend/src/services/pullRequests.ts, backend/src/routes/pullRequestRoutes.ts
Preview hosting uses one managed worktree, adds closed-PR cleanup and reconciliation, and returns preview cleanup results from pull-request actions.
Hot-reload configuration and documentation
backend/src/development/developmentStack.ts, scripts/developmentFrontend.ts, docs/*
Hot reload is controlled through an environment flag, preview paths are documented, and Delivery terminology replaces the former pull-request route in documentation.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested labels: type: documentation

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is concise and matches the main change set: Delivery renaming plus managed PR dev updates.
Description check ✅ Passed The description is structured and detailed with summary, managed state, and verification, though it omits several template sections.

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.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.06593% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/src/services/pullRequestPreviewHost.ts 93.75% 13 Missing ⚠️
src/pages/Delivery.tsx 84.21% 12 Missing ⚠️
backend/src/services/pullRequests.ts 90.47% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/pages/Delivery.tsx (1)

34-48: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

useDashboardDeployments import is out of alphabetical order.

It's inserted after useProductionCheckout (line 40) instead of its correct alphabetical slot right after useApprovePullRequestReview, ahead of useDashboardReleaseStatus. This is the same simple-import-sort violation pattern already confirmed failing CI for src/hooks/index.ts.

🔧 Proposed reorder
 import {
     useApprovePullRequest,
     useApprovePullRequestReview,
+    useDashboardDeployments,
     useDashboardReleaseStatus,
     useDeployDashboard,
     useProductionCheckout,
-    useDashboardDeployments,
     usePullRequestPreview,
     usePullRequests,
     useRejectPullRequest,
     useRollbackDashboard,
     useStartPullRequestPreview,
     useStopPullRequestPreview,
     useUpdatePullRequestBranch,
 } from "../hooks";
🤖 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 `@src/pages/Delivery.tsx` around lines 34 - 48, Reorder the imports in the
Delivery module so useDashboardDeployments appears immediately after
useApprovePullRequestReview and before useDashboardReleaseStatus, preserving
alphabetical order without changing any import names or behavior.
src/hooks/index.ts (1)

111-138: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Misplaced ./useDelivery export block breaks the lint sort order.

Renaming ./usePullRequests./useDelivery left the export block in its old alphabetical slot (between ./useOpsActions and ./useQuotas). Alphabetically, ./useDelivery belongs between ./useCron and ./useFiles. This matches the reported pipeline failure.

🔧 Proposed reorder
 export { OPS_ACTIONS, useExecJob, useStartOpsAction } from "./useOpsActions";
-export type {
-    DashboardReleaseStatus,
-    DashboardReleaseSummary,
-    DeploymentJob,
-    ProductionCheckoutStatus,
-    PullRequestPreviewLifecycle,
-    PullRequestPreviewStatus,
-    PullRequestSummary,
-    WorktreeCleanupResult,
-} from "./useDelivery";
-export {
-    DELIVERY_NAV_REFRESH_MS,
-    DELIVERY_PAGE_REFRESH_MS,
-    deliveryKeys,
-    useApprovePullRequest,
-    useApprovePullRequestReview,
-    useDashboardDeployments,
-    useDashboardReleaseStatus,
-    useDeployDashboard,
-    useProductionCheckout,
-    usePullRequestPreview,
-    usePullRequests,
-    useRejectPullRequest,
-    useRollbackDashboard,
-    useStartPullRequestPreview,
-    useStopPullRequestPreview,
-    useUpdatePullRequestBranch,
-} from "./useDelivery";
 export { hasQuotaStatus, useQuotas } from "./useQuotas";
 export {
     cronKeys,
     useCronJobs,
     useDeleteCronJob,
     useRunCronJobNow,
     useToggleCronJob,
     useUpdateCronJob,
 } from "./useCron";
+export type {
+    DashboardReleaseStatus,
+    DashboardReleaseSummary,
+    DeploymentJob,
+    ProductionCheckoutStatus,
+    PullRequestPreviewLifecycle,
+    PullRequestPreviewStatus,
+    PullRequestSummary,
+    WorktreeCleanupResult,
+} from "./useDelivery";
+export {
+    DELIVERY_NAV_REFRESH_MS,
+    DELIVERY_PAGE_REFRESH_MS,
+    deliveryKeys,
+    useApprovePullRequest,
+    useApprovePullRequestReview,
+    useDashboardDeployments,
+    useDashboardReleaseStatus,
+    useDeployDashboard,
+    useProductionCheckout,
+    usePullRequestPreview,
+    usePullRequests,
+    useRejectPullRequest,
+    useRollbackDashboard,
+    useStartPullRequestPreview,
+    useStopPullRequestPreview,
+    useUpdatePullRequestBranch,
+} from "./useDelivery";
 export {
     fileKeys,
     useFileContent,
     useFiles,
     useRevealFile,
     useSaveFile,
 } from "./useFiles";
🤖 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 `@src/hooks/index.ts` around lines 111 - 138, The ./useDelivery type and value
export blocks in the hooks index are positioned out of alphabetical order. Move
both blocks from their current location between ./useOpsActions and ./useQuotas
to the alphabetical position between ./useCron and ./useFiles, without changing
their exported symbols.

Source: Pipeline failures

🤖 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.

Outside diff comments:
In `@src/hooks/index.ts`:
- Around line 111-138: The ./useDelivery type and value export blocks in the
hooks index are positioned out of alphabetical order. Move both blocks from
their current location between ./useOpsActions and ./useQuotas to the
alphabetical position between ./useCron and ./useFiles, without changing their
exported symbols.

In `@src/pages/Delivery.tsx`:
- Around line 34-48: Reorder the imports in the Delivery module so
useDashboardDeployments appears immediately after useApprovePullRequestReview
and before useDashboardReleaseStatus, preserving alphabetical order without
changing any import names or behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b1edbec4-2af5-4119-9e21-728868e2dad8

📥 Commits

Reviewing files that changed from the base of the PR and between f8b8df4 and 8d012f5.

📒 Files selected for processing (15)
  • docs/architecture/frontend-feature-map.md
  • docs/architecture/overview.md
  • docs/development/local-dev.md
  • docs/setup/production-deploy.md
  • src/components/features/delivery/ProductionReleasesCard.tsx
  • src/components/features/delivery/PullRequestDevelopmentCard.tsx
  • src/components/layout/Layout.tsx
  • src/hooks/index.ts
  • src/hooks/useDelivery.ts
  • src/pages/Delivery.tsx
  • src/router.tsx
  • src/test/frontendBehavior.test.tsx
  • src/test/pageBehavior.test.tsx
  • src/test/productionReleasesCard.test.tsx
  • src/test/pullRequestDevelopmentCard.test.tsx
📜 Review details
⚠️ CI failures not shown inline (5)

GitHub Actions: Dashboard checks / frontend-checks: refactor: rename PR page to Delivery

Conclusion: failure

View job details

##[group]Run actions/upload-artifact@v7
 with:
   name: frontend-coverage-lcov
   path: coverage/lcov.info
   if-no-files-found: error
   retention-days: 14
   compression-level: 6
   overwrite: false
   include-hidden-files: false
   archive: true
 env:
   CODECOV_TOKEN_PRESENT: true
 ##[endgroup]
 ##[error]No files were found with the provided path: coverage/lcov.info. No artifacts will be uploaded.

GitHub Actions: Dashboard checks / 0_frontend-checks.txt: refactor: rename PR page to Delivery

Conclusion: failure

View job details

##[group]Run bun run lint:frontend
 �[36;1mbun run lint:frontend�[0m
 shell: /usr/bin/bash -e {0}
 env:
   CODECOV_TOKEN_PRESENT: true
 ##[endgroup]
 $ eslint . --cache --cache-strategy content --max-warnings=0
 /home/runner/work/Mira-Dashboard/Mira-Dashboard/src/hooks/index.ts
   8:1  error  Run autofix to sort these exports!  simple-import-sort/exports
 /home/runner/work/Mira-Dashboard/Mira-Dashboard/src/pages/Delivery.tsx
   1:1  error  Run autofix to sort these imports!  simple-import-sort/imports
 /home/runner/work/Mira-Dashboard/Mira-Dashboard/src/router.tsx
   1:1  error  Run autofix to sort these imports!  simple-import-sort/imports
 /home/runner/work/Mira-Dashboard/Mira-Dashboard/src/test/frontendBehavior.test.tsx
   1:1  error  Run autofix to sort these imports!  simple-import-sort/imports
 /home/runner/work/Mira-Dashboard/Mira-Dashboard/src/test/pageBehavior.test.tsx
   1:1  error  Run autofix to sort these imports!  simple-import-sort/imports
 ✖ 5 problems (5 errors, 0 warnings)
   5 errors and 0 warnings potentially fixable with the `--fix` option.
 error: script "lint:frontend" exited with code 1
 ##[error]Process completed with exit code 1.

GitHub Actions: Dashboard checks / frontend-checks: refactor: rename PR page to Delivery

Conclusion: failure

View job details

##[group]Run bun run lint:frontend
 �[36;1mbun run lint:frontend�[0m
 shell: /usr/bin/bash -e {0}
 env:
   CODECOV_TOKEN_PRESENT: true
 ##[endgroup]
 $ eslint . --cache --cache-strategy content --max-warnings=0
 /home/runner/work/Mira-Dashboard/Mira-Dashboard/src/hooks/index.ts
   8:1  error  Run autofix to sort these exports!  simple-import-sort/exports
 /home/runner/work/Mira-Dashboard/Mira-Dashboard/src/pages/Delivery.tsx
   1:1  error  Run autofix to sort these imports!  simple-import-sort/imports
 /home/runner/work/Mira-Dashboard/Mira-Dashboard/src/router.tsx
   1:1  error  Run autofix to sort these imports!  simple-import-sort/imports
 /home/runner/work/Mira-Dashboard/Mira-Dashboard/src/test/frontendBehavior.test.tsx
   1:1  error  Run autofix to sort these imports!  simple-import-sort/imports
 /home/runner/work/Mira-Dashboard/Mira-Dashboard/src/test/pageBehavior.test.tsx
   1:1  error  Run autofix to sort these imports!  simple-import-sort/imports
 ✖ 5 problems (5 errors, 0 warnings)
   5 errors and 0 warnings potentially fixable with the `--fix` option.
 error: script "lint:frontend" exited with code 1
 ##[error]Process completed with exit code 1.

GitHub Actions: Dashboard checks / 1_backend-checks.txt: refactor: rename PR page to Delivery

Conclusion: failure

View job details

quest addresses in tests [0.10ms]
 (pass) backend service utilities > fails readiness when worker telemetry cannot be read [2.72ms]
 (pass) backend service utilities > logs database readiness failures without exposing them in the response [0.72ms]
 (pass) backend service utilities > fails closed cleanly when the attempted mutation audit cannot be stored [0.63ms]
 (pass) backend service utilities > applies request policy auth, rate limit, and handler error behavior [19.44ms]
 ##[endgroup]
 ##[group]test/releaseDeployment.test.ts:
 (pass) immutable release deployment > keeps shipped managed units aligned with the production contract [1.20ms]
 (pass) immutable release deployment > keeps host-local password reset on the stable production database [0.14ms]
 (pass) immutable release deployment > builds in an isolated worktree and atomically publishes only artifacts [44.04ms]
 (pass) immutable release deployment > reruns database preflight when reusing a verified immutable release [55.55ms]
 (pass) immutable release deployment > accepts a concurrently published copy of the same verified release [73.19ms]
 (pass) immutable release deployment > removes the temporary worktree when commit verification fails [1.50ms]
 (pass) immutable release deployment > cleans a partially-created worktree when git worktree add fails [1.41ms]
 (pass) immutable release deployment > falls back to filesystem cleanup and prunes stale worktree metadata [37.28ms]
 (pass) immutable release deployment > rejects mismatched build identity and cleans the worktree [12.10ms]
 (pass) immutable release deployment > validates paths, commits, and CLI commands [4.83ms]
 ##[endgroup]
 ##[group]test/developmentStack.test.ts:
 (pass) development stack > resolves one prod-like development mode defensively [1.00ms]
 (pass) development stack > creates a scrubbed snapshot, copied release slots, and secret-minimized env [45.19ms]
 (pass) development stack > re-scrubs copied MFA when a reused database moves to anothe...

GitHub Actions: Dashboard checks / backend-checks: refactor: rename PR page to Delivery

Conclusion: failure

View job details

ith the verified release identity [0.37ms]
 (pass) server start scheduler policy > warns but keeps startup alive when no gateway token is configured [22.36ms]
 (pass) server start scheduler policy > rolls back listening-time startup when Gateway initialization fails [0.60ms]
 (pass) server start scheduler policy > shares concurrent startup failures and clears the completed attempt [0.70ms]
 (pass) server start scheduler policy > starts, stops, and handles web shutdown signals with isolated runtime state [19.32ms]
 (pass) server start scheduler policy > exits the direct web process after graceful shutdown when another handle remains [221.83ms]
 (pass) server start scheduler policy > wires Bun server websocket hooks and static fallbacks [5.76ms]
 ##[endgroup]
 ##[group]test/releaseManager.test.ts:
 (pass) Dashboard immutable release manager > classifies transition-lock command failures explicitly [0.30ms]
 (pass) Dashboard immutable release manager > accepts only absolute non-root layouts and full lowercase commit SHAs [0.11ms]
 (pass) Dashboard immutable release manager > does not expose active staging paths before publication owns the transition lock [92.09ms]
 (pass) Dashboard immutable release manager > activates and rolls back verified releases through relative atomic links [120.96ms]
 (pass) Dashboard immutable release manager > restores the exact release slots that preceded a failed activation [201.35ms]
 (pass) Dashboard immutable release manager > removes the previous slot when the failed activation had no older release [114.28ms]
 (pass) Dashboard immutable release manager > removes an orphaned previous link during first activation [41.15ms]
 (pass) Dashboard immutable release manager > exposes bounded lifecycle command summaries without artifact contents [186.61ms]
 (pass) Dashboard immutable release manager > rejects directories whose manifest identity or artifacts do not match [24.35ms]
 (pass) Dashboard immutable release manager > revalidates componen...
🧰 Additional context used
🪛 GitHub Actions: Dashboard checks / 0_frontend-checks.txt
src/router.tsx

[error] 1-1: ESLint simple-import-sort/imports: Run autofix to sort these imports!

src/test/frontendBehavior.test.tsx

[error] 1-1: ESLint simple-import-sort/imports: Run autofix to sort these imports!

src/hooks/index.ts

[error] 8-8: ESLint simple-import-sort/exports: Run autofix to sort these exports!

src/pages/Delivery.tsx

[error] 1-1: ESLint simple-import-sort/imports: Run autofix to sort these imports!

src/test/pageBehavior.test.tsx

[error] 1-1: ESLint simple-import-sort/imports: Run autofix to sort these imports!

🪛 GitHub Actions: Dashboard checks / frontend-checks
src/router.tsx

[error] 1-1: ESLint simple-import-sort/imports: Run autofix to sort these imports!

src/test/frontendBehavior.test.tsx

[error] 1-1: ESLint simple-import-sort/imports: Run autofix to sort these imports!

src/hooks/index.ts

[error] 8-8: ESLint simple-import-sort/exports: Run autofix to sort these exports!

src/pages/Delivery.tsx

[error] 1-1: ESLint simple-import-sort/imports: Run autofix to sort these imports!

src/test/pageBehavior.test.tsx

[error] 1-1: ESLint simple-import-sort/imports: Run autofix to sort these imports!

🔇 Additional comments (14)
src/hooks/useDelivery.ts (1)

151-162: LGTM!

Also applies to: 283-300, 303-330, 333-484

src/components/features/delivery/ProductionReleasesCard.tsx (1)

1-21: LGTM!

Also applies to: 22-61, 63-70, 72-210

src/components/features/delivery/PullRequestDevelopmentCard.tsx (1)

48-48: LGTM!

src/pages/Delivery.tsx (1)

1-10: LGTM!

Also applies to: 17-18, 633-641, 990-996, 1036-1036

src/test/pageBehavior.test.tsx (1)

46-46: LGTM!

Also applies to: 2150-2150, 2807-2813, 2920-2926, 3006-3010, 3078-3082, 3134-3138, 3175-3179, 3250-3253

src/test/productionReleasesCard.test.tsx (1)

4-4: LGTM!

src/test/pullRequestDevelopmentCard.test.tsx (1)

4-4: LGTM!

Also applies to: 21-31, 44-44, 63-75, 90-92

src/components/layout/Layout.tsx (1)

12-12: LGTM!

Also applies to: 27-27, 40-40, 68-68, 123-123

src/router.tsx (1)

20-20: LGTM!

Also applies to: 123-126, 186-186

docs/architecture/frontend-feature-map.md (1)

23-23: LGTM!

docs/architecture/overview.md (1)

41-57: LGTM!

docs/development/local-dev.md (1)

136-136: LGTM!

docs/setup/production-deploy.md (1)

110-110: LGTM!

src/test/frontendBehavior.test.tsx (1)

148-162: LGTM!

Also applies to: 667-668, 905-908, 3319-3319, 4747-4747, 4761-4761

@mira-2026 mira-2026 added type: feature Adds user-visible functionality area: backend Backend API, server routes, services, and integrations area: ops Operational actions, deploys, services, backups, and health and removed type: refactor Internal restructuring without intended behavior change labels Jul 27, 2026
@mira-2026 mira-2026 changed the title refactor: rename PR page to Delivery feat: expand Delivery and managed PR dev Jul 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 391df4a46f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread backend/src/services/pullRequestPreviewHost.ts Outdated
Comment thread backend/src/services/pullRequestPreviewHost.ts
Comment thread backend/src/services/pullRequestPreviews.ts Outdated
Comment thread src/pages/Delivery.tsx Outdated
Comment thread backend/src/services/pullRequestPreviewHost.ts Outdated
Comment thread backend/src/services/pullRequestPreviewHost.ts Outdated

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
backend/test/developmentStack.test.ts (1)

626-690: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the enabled lifecycle path too.

This test only exercises hotReload: false; the hotReload: true assertions are resolver-only. Add a paired runDevelopmentStack assertion for --watch on both children and frontend environment value "1".

🤖 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 `@backend/test/developmentStack.test.ts` around lines 626 - 690, Extend the
lifecycle test around runDevelopmentStack to also execute the hotReload-enabled
configuration. Verify both spawned children receive the --watch argument and the
frontend environment sets MIRA_DASHBOARD_DEV_HOT_RELOAD to "1", while preserving
the existing disabled-path assertions.
🤖 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.

Inline comments:
In `@backend/src/development/developmentStack.ts`:
- Around line 1092-1093: Update the backend status label in the development
stack logging to replace the `HMR` suffix with `restart-on-change` or `watch`,
while preserving the existing conditional display behavior based on
config.hotReload. Keep HMR terminology reserved for frontend behavior.

In `@backend/src/services/pullRequestPreviewHost.ts`:
- Around line 1842-1882: Move resolvePullRequestPreviewConfig() and
readPreviewRecord(config) inside the try block in
cleanupClosedPullRequestPreview, while preserving the existing cleanup and
warning-result behavior. Ensure exceptions from configuration resolution or
preview-record reads are converted into the returned status: "warning" result
rather than escaping to callers.

In `@backend/src/services/pullRequests.ts`:
- Line 2834: Update approvePullRequest and rejectPullRequest to enqueue preview
cleanup through the existing "dashboard.preview.*" exclusive job action path
instead of directly awaiting cleanupClosedPullRequestPreview(number). Reuse the
established queued cleanup mechanism used by start, stop, and reconciliation
flows so cleanup is serialized per managed worktree and PREVIEW_REFERENCE.

In `@docs/setup/secrets-and-env.md`:
- Line 163: Update the MIRA_DASHBOARD_DEV_HOT_RELOAD entry in the
environment-variable table to document that accepted values are only 0 or 1,
with unset or empty defaulting to 1; retain the existing description of its
behavior.

In `@scripts/developmentFrontend.ts`:
- Line 97: Update the development configuration object in developmentFrontend so
Bun remains in development mode regardless of isHotReloadEnabled. Keep console
forwarding enabled and set only the hmr property from isHotReloadEnabled instead
of switching development to false.

---

Nitpick comments:
In `@backend/test/developmentStack.test.ts`:
- Around line 626-690: Extend the lifecycle test around runDevelopmentStack to
also execute the hotReload-enabled configuration. Verify both spawned children
receive the --watch argument and the frontend environment sets
MIRA_DASHBOARD_DEV_HOT_RELOAD to "1", while preserving the existing
disabled-path assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e4405761-c553-4623-9d18-c101a3a51996

📥 Commits

Reviewing files that changed from the base of the PR and between 8d012f5 and 391df4a.

📒 Files selected for processing (21)
  • backend/src/development/developmentStack.ts
  • backend/src/routes/pullRequestRoutes.ts
  • backend/src/services/pullRequestPreviewHost.ts
  • backend/src/services/pullRequestPreviews.ts
  • backend/src/services/pullRequests.ts
  • backend/test/developmentStack.test.ts
  • backend/test/pullRequestPreview.test.ts
  • backend/test/serviceBehavior.test.ts
  • backend/test/setup.ts
  • docs/development/local-dev.md
  • docs/setup/production-deploy.md
  • docs/setup/secrets-and-env.md
  • scripts/developmentFrontend.ts
  • src/components/features/delivery/PullRequestDevelopmentCard.tsx
  • src/hooks/index.ts
  • src/hooks/useDelivery.ts
  • src/pages/Delivery.tsx
  • src/router.tsx
  • src/test/frontendBehavior.test.tsx
  • src/test/pageBehavior.test.tsx
  • src/test/pullRequestDevelopmentCard.test.tsx
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/router.tsx
  • src/components/features/delivery/PullRequestDevelopmentCard.tsx
  • src/test/pullRequestDevelopmentCard.test.tsx
  • docs/setup/production-deploy.md
  • src/hooks/index.ts
  • src/test/frontendBehavior.test.tsx
  • src/hooks/useDelivery.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: frontend-checks
  • GitHub Check: backend-checks
🔇 Additional comments (22)
src/pages/Delivery.tsx (6)

6-7: LGTM!

Also applies to: 18-20, 34-41


58-58: LGTM!

Also applies to: 70-70, 430-432, 461-469


482-493: 🎯 Functional Correctness | 💤 Low value

actionResultMessage relies on TS 5.5+ inferred type predicates.

.filter((cleanup) => cleanup !== undefined) has no explicit type predicate, so the subsequent .map((cleanup) => cleanup.message) only type-checks because TypeScript 5.5+ infers cleanup is { message: string } from the equality check. On TypeScript < 5.5 this would fail with "Object is possibly 'undefined'".

🛡️ Safer, version-independent alternative
 function actionResultMessage(
     message: string,
     ...cleanupResults: Array<{ message: string } | undefined>
 ) {
     return [
         message,
         ...cleanupResults
-            .filter((cleanup) => cleanup !== undefined)
+            .filter((cleanup): cleanup is { message: string } => cleanup !== undefined)
             .map((cleanup) => cleanup.message),
     ].join("\n");
 }

Please confirm the project's TypeScript version is 5.5+ (per package.json/CI toolchain).

[dependency_check]


649-657: LGTM!

Also applies to: 714-720, 732-738, 751-763, 777-783


829-830: LGTM!

Also applies to: 870-887


1038-1043: LGTM!

Also applies to: 1068-1089

src/test/pageBehavior.test.tsx (3)

41-46: LGTM!

Also applies to: 2150-2150, 2810-2813, 2926-2926, 3009-3009, 3018-3036


3049-3130: LGTM! New rebuild-flow test correctly exercises the commit-mismatch → rebuild → converged-commit UI transition against Delivery's state derivations.


3175-3175: LGTM!

Also applies to: 3231-3231, 3272-3272, 3346-3346

backend/src/development/developmentStack.ts (1)

73-73: LGTM!

Also applies to: 273-284, 441-445, 1014-1014, 1035-1059

scripts/developmentFrontend.ts (1)

19-19: 🎯 Functional Correctness

Keep the child flag contract strict and canonical.

resolveDevelopmentStackConfig accepts only trimmed 0/1, but this child treats every value except exact "0" as enabled. Confirm this script is only launched with the parent’s canonical 1/0 value; otherwise reuse the same normalization or reject invalid values.

backend/test/developmentStack.test.ts (1)

171-171: LGTM!

Also applies to: 191-191, 202-202, 225-227

docs/development/local-dev.md (1)

50-51: LGTM!

Also applies to: 136-146, 155-169, 193-193, 202-203

docs/setup/secrets-and-env.md (1)

159-162: LGTM!

Also applies to: 164-180

backend/src/services/pullRequestPreviewHost.ts (2)

43-44: LGTM!

Also applies to: 86-117, 288-309, 388-418


719-791: LGTM!

Also applies to: 1019-1040, 1202-1204, 1595-1598, 1698-1701

backend/src/services/pullRequestPreviews.ts (1)

1-8: LGTM!

Also applies to: 35-39, 145-145, 169-207, 274-300

backend/src/routes/pullRequestRoutes.ts (1)

7-7: LGTM!

Also applies to: 47-49

backend/src/services/pullRequests.ts (1)

38-41: LGTM!

Also applies to: 2807-2807, 2868-2868

backend/test/pullRequestPreview.test.ts (1)

25-25: LGTM!

Also applies to: 36-36, 88-91, 157-158, 168-172, 189-190, 204-204, 213-217, 228-270, 285-285, 311-312, 440-470, 608-614, 791-791, 900-918, 930-946, 990-996, 1102-1133, 1187-1193, 1229-1251, 1271-1271

backend/test/serviceBehavior.test.ts (1)

3032-3040: LGTM!

Also applies to: 3201-3209, 3297-3306

backend/test/setup.ts (1)

12-22: LGTM!

Also applies to: 37-46

Comment thread backend/src/development/developmentStack.ts Outdated
Comment thread backend/src/services/pullRequestPreviewHost.ts
Comment thread backend/src/services/pullRequests.ts
Comment thread docs/setup/secrets-and-env.md Outdated
Comment thread scripts/developmentFrontend.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backend Backend API, server routes, services, and integrations area: frontend Frontend UI, client state, routing, and browser behavior area: ops Operational actions, deploys, services, backups, and health status: needs-review Ready for human or agent review type: feature Adds user-visible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants