ci(dev): auto-deploy Trigger.dev tasks + fail dev db:push on TTY prompt#5343
Conversation
Add a deploy-trigger-dev job that runs `trigger.dev deploy --env preview --branch dev-sim` on pushes to the dev branch, replacing the manual step. Gated after migrate-dev for the same reason as build-dev: the new task code runs against the dev DB, so the schema must be pushed first. Uses Trigger.dev's remote build (no --local-build), so the runner needs no Docker/buildx. Requires a TRIGGER_ACCESS_TOKEN repo secret. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015orsjbLX34FPFGujSK3AQK
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@greptile review |
PR SummaryMedium Risk Overview A new In
Reviewed by Cursor Bugbot for commit c2652f6. Bugbot is set up for automated code reviews on this repo. Configure here. |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015orsjbLX34FPFGujSK3AQK
Greptile SummaryThis PR automates two previously manual dev-CI steps: deploying Trigger.dev background tasks on every push to
Confidence Score: 5/5Both changes are confined to CI workflow files and introduce no risk to application code or data. The Trigger.dev deploy job is additive; the migrations fix correctly gates on the existing error string without touching staging or production paths. The new Trigger.dev job is straightforward and well-guarded. The db:push false-green fix uses tee + grep rather than a flag, which is appropriate given drizzle-kit's exit-0 behavior; GitHub Actions' default pipefail ensures genuine failures still propagate. The one discrepancy — the PR description's setup command names a secret that the workflow never reads — is a documentation gap that would cause a confusing first-run failure but is easily corrected. No files require special attention beyond verifying that the DEV_TRIGGER_ACCESS_TOKEN secret (not TRIGGER_ACCESS_TOKEN as stated in the PR description) is set in the repo before the first push to dev. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
push["Push to `dev`"]
push --> detect-version
push --> migrate-dev
migrate-dev --> build-dev
detect-version --> build-dev
migrate-dev --> deploy-trigger-dev
build-dev --> ecr["ECR images pushed\n(dev tag)"]
deploy-trigger-dev --> trig["Trigger.dev tasks deployed\n(preview / dev-sim branch)"]
style deploy-trigger-dev fill:#d4edda,stroke:#28a745
style trig fill:#d4edda,stroke:#28a745
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
push["Push to `dev`"]
push --> detect-version
push --> migrate-dev
migrate-dev --> build-dev
detect-version --> build-dev
migrate-dev --> deploy-trigger-dev
build-dev --> ecr["ECR images pushed\n(dev tag)"]
deploy-trigger-dev --> trig["Trigger.dev tasks deployed\n(preview / dev-sim branch)"]
style deploy-trigger-dev fill:#d4edda,stroke:#28a745
style trig fill:#d4edda,stroke:#28a745
Reviews (3): Last reviewed commit: "ci: align build-dev checkout to v6 to ma..." | Re-trigger Greptile |
Greptile SummaryThis PR automates the manual Trigger.dev deploy command into the CI pipeline with a new
Confidence Score: 4/5Safe to merge; the CI job is correctly structured and the React refactors are clean with no functional regressions. The new deploy-trigger-dev job follows existing patterns exactly — correct secret handling, pinned action hashes, and proper dependency ordering on migrate-dev. The React changes are additive cleanups (URL state migration, prop removal, memoization) with no logic regressions found. The only noteworthy detail is that handleMothershipEnvironmentChange in admin.tsx lost its useCallback wrapper and will produce a new function reference on every render, which can cause unnecessary child re-renders, but the admin page is low-traffic and the impact is negligible. apps/sim/app/workspace/.../admin/admin.tsx — removed useCallback from a prop callback; worth a second look if the receiving ChipSelect is memoized. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
push["push to dev"] --> migrate-dev["migrate-dev\n(migrations.yml / dev)"]
push --> detect-version["detect-version"]
migrate-dev --> build-dev["build-dev\n(Docker → ECR :dev)"]
detect-version --> build-dev
migrate-dev --> deploy-trigger-dev["deploy-trigger-dev ✨\n(bunx trigger.dev deploy\n--env preview --branch dev-sim)"]
style deploy-trigger-dev fill:#d4f1d4,stroke:#2a9d2a
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
push["push to dev"] --> migrate-dev["migrate-dev\n(migrations.yml / dev)"]
push --> detect-version["detect-version"]
migrate-dev --> build-dev["build-dev\n(Docker → ECR :dev)"]
detect-version --> build-dev
migrate-dev --> deploy-trigger-dev["deploy-trigger-dev ✨\n(bunx trigger.dev deploy\n--env preview --branch dev-sim)"]
style deploy-trigger-dev fill:#d4f1d4,stroke:#2a9d2a
Reviews (2): Last reviewed commit: "ci(trigger): source TRIGGER_PROJECT_ID f..." | Re-trigger Greptile |
| } | ||
| } | ||
|
|
||
| const handleMothershipEnvironmentChange = useCallback( | ||
| async (nextEnvironment: MothershipEnvironment) => { | ||
| if (nextEnvironment !== settings?.mothershipEnvironment && !updateSetting.isPending) { | ||
| await updateSetting.mutateAsync({ | ||
| key: 'mothershipEnvironment', | ||
| value: nextEnvironment, | ||
| }) | ||
| } | ||
| }, | ||
| [settings?.mothershipEnvironment, updateSetting] | ||
| ) | ||
| const handleMothershipEnvironmentChange = async (nextEnvironment: MothershipEnvironment) => { | ||
| if (nextEnvironment !== settings?.mothershipEnvironment && !updateSetting.isPending) { | ||
| await updateSetting.mutateAsync({ | ||
| key: 'mothershipEnvironment', | ||
| value: nextEnvironment, | ||
| }) | ||
| } |
There was a problem hiding this comment.
Unstable function reference on every render
handleMothershipEnvironmentChange is recreated on every render now that useCallback was removed. If the child component it's passed to is wrapped in React.memo (e.g. the ChipSelect onChange), that memoization is defeated and the child re-renders on every parent render. Since this is an admin settings page the performance impact is minimal, but the previous useCallback with [settings?.mothershipEnvironment, updateSetting] deps was the correct pattern for a stable prop callback.
Guard the deploy step so a missing TRIGGER_ACCESS_TOKEN or TRIGGER_PROJECT_ID exits with a clear message instead of a cryptic trigger.dev CLI error, matching the DATABASE_URL guard in migrations.yml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015orsjbLX34FPFGujSK3AQK
|
Addressed the review comments scoped to this PR's actual change (the CI job):
The remaining comments (inbox debounce P1, |
drizzle-kit push prompts interactively for ambiguous renames (--force only covers data-loss). In CI there's no TTY, so the prompt reads EOF and drizzle can exit 0 without applying — the job goes green while the schema change was silently skipped. Close stdin, reject prompt markers, and require a success marker so an unresolved rename or failed statement fails the job. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015orsjbLX34FPFGujSK3AQK
|
Added a second dev-CI fix ( Fix: close stdin, then reject prompt markers ( |
drizzle-kit push needs a TTY to resolve ambiguous renames; in CI it throws "Interactive prompts require a TTY terminal" but still exits 0, so the job went green without applying the schema (e.g. run 28415609570). Fail on that explicit error. Keys on drizzle's own stable message rather than fuzzy prompt text, and a real non-zero exit still fails via set -e. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015orsjbLX34FPFGujSK3AQK
|
Revised the db:push guard ( Evidence: run 28415609570 (migrate-dev job …and the job still went green. So the schema change (an enum rename decision) was silently skipped. On the flakiness concern: I dropped the fuzzy |
The PAT is only used by the dev deploy job, so prefix it DEV_ to match the repo's dev-scoped secret convention. TRIGGER_PROJECT_ID stays unprefixed — it's the shared project (same one prod uses); dev-sim is a preview branch within it, not a separate project. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015orsjbLX34FPFGujSK3AQK
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bc3b5ad. Configure here.
build-dev was the only job still pinning actions/checkout to the v4 hash; every other job uses v6. Non-functional consistency fix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015orsjbLX34FPFGujSK3AQK
|
Addressed the outstanding CI-file comments:
The remaining inbox-debounce (P1) and admin |
|
@greptile review |

What
Two dev-CI fixes:
db:pushstep from false-greening when drizzle-kit needs an interactive prompt.1. Trigger.dev deploy job
Replaces the manual command:
New
deploy-trigger-devjob:devonly.needs: [migrate-dev]— the deployed task code runs against the dev DB, so the schema push lands first (same rationale asbuild-dev).--local-build, so the runner needs no Docker/buildx — Trigger.dev builds server-side.TRIGGER_ACCESS_TOKENandTRIGGER_PROJECT_IDfrom repo secrets, with a fail-fast guard so a missing secret exits with a clear message instead of a cryptic CLI error.2. Dev
db:pushfalse-green fix (migrations.yml)drizzle-kit pushneeds a TTY to resolve ambiguous renames (--forceonly covers data-loss). In CI it throwsInteractive prompts require a TTY terminalbut still exits 0, so the job went green while silently skipping the schema change — e.g. run 28415609570, which threw that error and still passed.Fix:
teethe output (kept live in the log) and fail on drizzle-kit's own dedicated TTY error. A genuine non-zero exit is still caught byset -e. Staging/prod are untouched — they use versionedmigrate.ts.Required before the trigger job runs
Set both repo secrets:
Notes
GRAFANA_OTLP_*vars are set in the trigger job, so telemetry stays inert and dev tasks deploy without exporting traces. (Separate, unresolved issue: prod Trigger.dev telemetry has been dark since ~06-30 — tracked outside this PR.)useCallback/ teammates review comments are on already-merged commits (improvement(settings): react health pass across settings surface #5324, fix(custom-tool): restore modal body scroll so Save stays reachable #5321) that only appear here because this PR bringsdevup to date — out of scope.🤖 Generated with Claude Code