Conversation
…cted value more clear [dev] [Marfuen] mariano/sale-46-add-basic-risk-score
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
* chore(worktrees): auto-link .env files on git worktree add Add a shared .githooks/ directory with a post-checkout hook that symlinks every .env* from the main worktree into each freshly created worktree. Scoped via two layered checks — prev-HEAD is the null SHA AND the current worktree isn't the main one — so it fires exclusively inside `git worktree add`, never on regular branch/file checkouts or fresh clones. Enable with a one-time `git config core.hooksPath .githooks` per clone. Since all worktrees share a single .git/, the config persists for all current and future worktrees automatically. The hook delegates to scripts/link-worktree-envs.sh so the same logic backfills worktrees that existed before the hook was installed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(worktrees): run bun install + db:generate + build on new worktree After the post-checkout hook symlinks .env files into a freshly created worktree, it now also invokes scripts/setup-worktree.sh which runs `bun install`, `bun run db:generate`, and `bun run build` so the worktree is usable immediately. Runs synchronously on purpose — callers (especially Claude Code) tend to start executing in the worktree right after creation, and we don't want them racing ahead of the install. Skippable via `SKIP_WORKTREE_SETUP=1 git worktree add …` for a fast "just give me the files" worktree. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(worktrees): make bun run build opt-in during auto-setup `bun run build` adds several minutes per worktree and is unnecessary for the common path (dev server, tests, typecheck). Default the setup script to install + db:generate only, and gate the build step behind SETUP_WORKTREE_WITH_BUILD=1 for the rare case it's needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(worktrees): run prisma migrate before db:generate in setup After `bun install` and before `bun run db:generate`, run `cd packages/db && bun run db:migrate` so any new migrations on the branch are applied to the local DB before the clients are regenerated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(worktrees): isolate DB per worktree to prevent cross-branch drift Add scripts/setup-worktree-db.sh that creates compdev_<slug> for each new worktree using the same Postgres host/credentials as main, and have scripts/link-worktree-envs.sh copy-and-rewrite .env files containing DATABASE_URL so each worktree's migrations hit its own DB. Env files without DATABASE_URL stay as symlinks so API keys and such still auto-propagate. Uses the `pg` node module from the main worktree's node_modules (via a small scripts/create-database.mjs helper) so psql/libpq isn't required on the host. Skip via SKIP_WORKTREE_DB=1 git worktree add … to opt back into the shared DB (the previous behavior). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(skills): add stale-worktree-cleanup skill Defines a safe process for reaping old worktrees together with their isolated compdev_* databases. Since git has no pre-worktree-remove hook, dead databases accumulate silently — this skill gives Claude (or a human) a classify-then-confirm-then-remove workflow so nothing in-flight gets lost. Includes inventory via `gh pr list`, per-worktree dirty/unpushed checks, and safety rules against --force without consent, dropping non-compdev_* databases, or touching the main worktree. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(worktrees): add dev:no-trigger scripts + single-active-worktree rule Trigger.dev's `trigger dev` CLI has no per-branch or per-session isolation — env is hardcoded to the project's shared "dev" (verified in node_modules/trigger.dev/dist/esm/commands/dev.js). Running `bun run dev` in multiple worktrees causes last-writer-wins task registration and zombie workers. Add dev:no-trigger scripts to apps/app and apps/api (UI-only, no trigger dev) so only one active worktree runs the full stack at a time. Document the rule in .githooks/README.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(skills): add new-feature-setup skill documenting the worktree-based workflow When starting any new feature/ticket/branch, this skill points to the existing hook-driven auto-setup (compdev_<slug> DB, env linking, install+migrate+generate) and the single-active-trigger-dev rule so new Claude sessions don't reinvent env copying, database bootstrapping, or fight `bun install` by hand in every worktree. Companion to stale-worktree-cleanup for the other end of the lifecycle. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Mariano <marfuen98@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
🎉 This PR is included in version 3.33.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
Summary by cubic
Add inherent risk scoring to the Vendors overview and centralize risk logic for consistent display. Also automates new worktree setup with isolated databases and safer dev scripts.
New Features
RiskScoreBadgeand sharedlib/risk-score(getRiskScore,getRiskLevel, constants) with unit tests.Refactors
RiskMatrixChartnow uses the shared scoring thresholds and shows a larger, ringed selection marker for better visibility..githooks/post-checkoutto auto-link.env*, create per-worktreecompdev_<slug>Postgres DBs, and run install + migrate + generate (build is opt-in); documents the flow and addsdev:no-triggerto@trycompai/appand@trycompai/apiwith a one-active-worktree rule.Written for commit c75c39d. Summary will update on new commits.