Conversation
|
WalkthroughThe organization route now detects pending project runtime updates by organization ID and returns a gated boolean. A shared hook exposes this value to the banner and settings navigation. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to After promoting or rolling back a deployment, the runtime-update warning may not update until the user reloads or navigates. Add revalidation for these actions before merging. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 8 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/webapp/app/components/billing/selectOrgBanner.ts (1)
4-4: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReplace
OrgBannerKindwith a const object and string-union type.This change extends a TypeScript enum. Use a const object with a derived type instead.
Proposed refactor
-export enum OrgBannerKind { - RuntimeUpdate = "runtime-update", - LimitRejected = "limit-rejected", - LimitGrace = "limit-grace", - NoLimitConfigured = "no-limit", - Upgrade = "upgrade", - EnvironmentWarning = "env-warning", - None = "none", -} +export const OrgBannerKind = { + RuntimeUpdate: "runtime-update", + LimitRejected: "limit-rejected", + LimitGrace: "limit-grace", + NoLimitConfigured: "no-limit", + Upgrade: "upgrade", + EnvironmentWarning: "env-warning", + None: "none", +} as const; + +export type OrgBannerKind = (typeof OrgBannerKind)[keyof typeof OrgBannerKind];
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: c1e925b0-7f67-4d80-8a99-baeabbd16db4
📒 Files selected for processing (9)
.server-changes/node-runtime-update-banner.mdapps/webapp/app/components/billing/OrgBanner.tsxapps/webapp/app/components/billing/selectOrgBanner.tsapps/webapp/app/components/navigation/OrganizationSettingsSideMenu.tsxapps/webapp/app/hooks/useOrganizations.tsapps/webapp/app/routes/_app.orgs.$organizationSlug.settings/route.tsxapps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsxapps/webapp/app/services/projectRuntimeUpdates.server.tsapps/webapp/test/orgBanner.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📜 Review details
⏰ Context from checks skipped due to timeout. (34)
- GitHub Check: report
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (13, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (19, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (20, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (16, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (11, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (24, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (23, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (15, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (22, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (14, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (21, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (18, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (17, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (12, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 24)
- GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 24)
- GitHub Check: runops-guard / runops-guard
- GitHub Check: typecheck / typecheck
- GitHub Check: obsmap / 🧪 Unit Tests: Observability Map
- GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp (2, 2)
- GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp (1, 2)
- GitHub Check: fk-cascade-guard / fk-cascade-guard
- GitHub Check: code-quality / code-quality
- GitHub Check: audit
- GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (10)
Never use `request.signal` to detect client disconnects.
📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)
Files:
apps/webapp/app/hooks/useOrganizations.tsapps/webapp/app/services/projectRuntimeUpdates.server.tsapps/webapp/app/components/billing/selectOrgBanner.ts
Test files must not import `app/env.server.ts`; pass configuration as options instead.
📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)
Files:
apps/webapp/test/orgBanner.test.ts
For dashboard changes, visually verify the running Remix app with Chrome DevTools MCP, using snapshots, screenshots, interaction, and console-message checks as appropriate.
📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)
Files:
apps/webapp/app/components/billing/OrgBanner.tsxapps/webapp/app/hooks/useOrganizations.tsapps/webapp/app/services/projectRuntimeUpdates.server.tsapps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsxapps/webapp/app/components/billing/selectOrgBanner.tsapps/webapp/app/components/navigation/OrganizationSettingsSideMenu.tsxapps/webapp/app/routes/_app.orgs.$organizationSlug.settings/route.tsx
Use zod for validation in packages/core and apps/webapp
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
apps/webapp/app/components/billing/OrgBanner.tsxapps/webapp/test/orgBanner.test.tsapps/webapp/app/hooks/useOrganizations.tsapps/webapp/app/services/projectRuntimeUpdates.server.tsapps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsxapps/webapp/app/components/billing/selectOrgBanner.tsapps/webapp/app/components/navigation/OrganizationSettingsSideMenu.tsxapps/webapp/app/routes/_app.orgs.$organizationSlug.settings/route.tsx
Do not import `env.server.ts` directly or indirectly into test files; instead pass environment-dependent values through options/parameters to make code testable
📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)
Files:
apps/webapp/test/orgBanner.test.ts
Access environment variables through the `env` export of `env.server.ts` instead of directly accessing `process.env` Use subpath exports from `@trigger.dev/core` package instead of importing from the root `@trigger.dev/core` path
📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)
Files:
apps/webapp/app/components/billing/OrgBanner.tsxapps/webapp/test/orgBanner.test.tsapps/webapp/app/hooks/useOrganizations.tsapps/webapp/app/services/projectRuntimeUpdates.server.tsapps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsxapps/webapp/app/components/billing/selectOrgBanner.tsapps/webapp/app/components/navigation/OrganizationSettingsSideMenu.tsxapps/webapp/app/routes/_app.orgs.$organizationSlug.settings/route.tsx
Use vitest for all tests in the Trigger.dev repository
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
apps/webapp/test/orgBanner.test.ts
Use function declarations instead of default exports
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
apps/webapp/app/components/billing/OrgBanner.tsxapps/webapp/test/orgBanner.test.tsapps/webapp/app/hooks/useOrganizations.tsapps/webapp/app/services/projectRuntimeUpdates.server.tsapps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsxapps/webapp/app/components/billing/selectOrgBanner.tsapps/webapp/app/components/navigation/OrganizationSettingsSideMenu.tsxapps/webapp/app/routes/_app.orgs.$organizationSlug.settings/route.tsx
Use types over interfaces for TypeScript Avoid using enums; prefer string unions or const objects instead
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
apps/webapp/app/components/billing/OrgBanner.tsxapps/webapp/test/orgBanner.test.tsapps/webapp/app/hooks/useOrganizations.tsapps/webapp/app/services/projectRuntimeUpdates.server.tsapps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsxapps/webapp/app/components/billing/selectOrgBanner.tsapps/webapp/app/components/navigation/OrganizationSettingsSideMenu.tsxapps/webapp/app/routes/_app.orgs.$organizationSlug.settings/route.tsx
When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs Do not use high-cardinality attributes in OTEL metr...
📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)
Files:
apps/webapp/test/orgBanner.test.tsapps/webapp/app/hooks/useOrganizations.tsapps/webapp/app/services/projectRuntimeUpdates.server.tsapps/webapp/app/components/billing/selectOrgBanner.ts
🧠 Learnings (2)
📚 Learning: 2026-06-16T09:19:47.637Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3960
File: apps/webapp/test/prismaInfrastructureErrorCapture.test.ts:0-0
Timestamp: 2026-06-16T09:19:47.637Z
Learning: In this repo’s Vitest setup, `vitest.config.ts` uses `globals: true`, so identifiers like `vi`, `describe`, `it`, and `expect` are available as globals in Vitest test files. During code review, do not flag missing `vi`/`describe`/`it`/`expect` imports as a runtime error or correctness issue when they’re used in `*.test.ts/tsx` or `*.spec.ts/tsx` files. Explicit imports are still preferred for consistency, but they’re not required for runtime behavior.
Applied to files:
apps/webapp/test/orgBanner.test.ts
📚 Learning: 2026-07-26T13:14:02.968Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 4378
File: .server-changes/realtime-run-reads-from-primary.md:0-0
Timestamp: 2026-07-26T13:14:02.968Z
Learning: For files in the .server-changes directory, the body text is published verbatim as dashboard-facing user release notes. Write entries in terms of user-visible behavior (what users can do/see), and avoid implementation-oriented details such as environment-variable names, internal mechanisms, or configuration knobs. If you need to include operational/configuration specifics, put those details in the PR description instead of the .server-changes entry.
Applied to files:
.server-changes/node-runtime-update-banner.md
| // items. Both calls are cheap and cached. | ||
| rbac.isUsingPlugin().catch(() => false), | ||
| ssoController.isUsingPlugin().catch(() => false), | ||
| organizationHasProjectRuntimeUpdate({ organizationId: organization.id }), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Revalidate after promotion or rollback changes the current deployment.
The deployment forms submit location.pathname + location.search as redirectUrl. Both actions call ChangeCurrentDeploymentService and redirect to that same path. For this same-path submission, neither existing form helper matches, so shouldRevalidate returns false. The loader therefore does not rerun organizationHasProjectRuntimeUpdate, and hasProjectRuntimeUpdate can remain stale.
Add a shouldRevalidate condition for the promotion and rollback resource actions, based on params.formAction.
Summary
Shows an organization-wide warning when current Production deployments still use Node.js 21. The warning takes precedence over other organization banners and links directly to the Projects settings page with update instructions.
Design
Reuses the existing current-production runtime classification, including legacy deployments without complete runtime metadata. The result is permission-gated and shared through the organization loader so the global banner and Projects settings indicator use one lookup.