Skip to content

[comp] Production Deploy#2668

Merged
Marfuen merged 2 commits intoreleasefrom
main
Apr 24, 2026
Merged

[comp] Production Deploy#2668
Marfuen merged 2 commits intoreleasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 24, 2026

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

    • Vendors overview: adds an INHERENT RISK column with a 1–10 score for assessed vendors, shows — when not assessed, and supports sorting by risk.
    • Adds RiskScoreBadge and shared lib/risk-score (getRiskScore, getRiskLevel, constants) with unit tests.
  • Refactors

    • RiskMatrixChart now uses the shared scoring thresholds and shows a larger, ringed selection marker for better visibility.
    • Dev workflow: adds .githooks/post-checkout to auto-link .env*, create per-worktree compdev_<slug> Postgres DBs, and run install + migrate + generate (build is opt-in); documents the flow and adds dev:no-trigger to @trycompai/app and @trycompai/api with a one-active-worktree rule.

Written for commit c75c39d. Summary will update on new commits.

…cted value more clear

[dev] [Marfuen] mariano/sale-46-add-basic-risk-score
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app (staging) Ready Ready Preview, Comment Apr 24, 2026 3:38pm
comp-framework-editor (staging) Ready Ready Preview, Comment Apr 24, 2026 3:38pm
portal (staging) Ready Ready Preview, Comment Apr 24, 2026 3:38pm

Request Review

cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Apr 24, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Auto-approved: Safe additive UI change: introduces inherent risk scoring and badge, centralizes risk calculation logic with tests, and adds sorting to the vendors table.

* 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>
@Marfuen Marfuen merged commit 47b119f into release Apr 24, 2026
11 of 13 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.33.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants