Skip to content

ci: split required PR path into fast-gate - #77

Merged
cavewebs merged 2 commits into
mainfrom
cursor/ci-fast-gate-8a5a
Nov 5, 2026
Merged

cavewebs merged 2 commits into
mainfrom
cursor/ci-fast-gate-8a5a

Conversation

@cavewebs

@cavewebs cavewebs commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Follow-up after #76 (1c28899). Soft-launch HOLD. GudBot stays default OFF.

Splits .github/workflows/ci.yml so the required PR path no longer waits on the Next build.

Head: ca7d73e. All three jobs green.

Jobs

Job id Check name When Required?
fast-gate fast-gate PR + main Yes (replaces Test)
migrations Migrations (empty Postgres) PR + main Yes (unchanged)
full-build full-build PR + main No (informative; still fails the GitHub Actions run if red)

Kim / repo admin: Eng cannot change GitHub branch protection. Please require fast-gate and Migrations (empty Postgres). Remove Test. Do not require full-build.

Times on this head (ca7d73e)

Run: https://github.com/gudlab/guddesk-core/actions/runs/42002055405

Check Wall clock
fast-gate 1m 5s (09:24:05–09:25:10Z)
Migrations (empty Postgres) 50s (09:24:05–09:24:55Z)
full-build 1m 42s (09:24:05–09:25:47Z)

Required path in parallel is fast-gate + migrations: 1m 5s (under the 10 min target). On #76 the old combined Test job (install through Next build) was about 2m 15s.

What each job runs

fast-gate (timeout 10 min): install → node qa/ai-eval/score.mjs validate (offline only) → scripts/ci-fast-checks.mjs → prisma generate → pnpm test with the zero-test count guard → pnpm build:content (contentlayer types for tsc; not the Next build) → pnpm exec tsc --noEmit.

migrations: unchanged. Empty Postgres + scripts/ci-migrate-check.sh. Reserved 0002/0003 and migration history were not touched.

full-build: install → prisma generate → build:content → lint → pnpm build. Runs on PRs so lint/Next failures still show, off the required critical path.

No live AI eval in CI (live-runner.mjs is not invoked).

fast-gate unit coverage (Kim ask)

pnpm test on this head (639 tests). Inventory:

(a) Widget config/auth (gd_pub_, missing appId → 400) - added on this PR. parseWidgetAppId in lib/widget-app-id.ts: missing/empty appId returns 400 "App ID is required"; a leading gd_pub_ is stripped before DB lookup. Wired into GET /api/widget/config and POST /api/widget/auth. Tests: lib/widget-app-id.test.ts. Existing lib/widget-visitor.test.ts still covers visitor-token reuse and a token from another workspace.

(b) Identify HMAC valid / invalid / missing - already covered. lib/widget-identity.test.ts asserts HMAC-SHA256 accept, wrong userId, wrong secret, malformed hash, missing userHash, and the 403 messages from resolveIdentifyExternalId. This PR adds a wiring check that POST /api/widget/visitors calls that helper and returns 403 before creating a visitor.

(c) Inbox authz (cross-workspace denied) - added on this PR. inboxListAuthz in lib/inbox-conversations.ts: signed-in but not a member of the requested workspace → 403 "Not a member of this workspace". Wired into GET /api/inbox/conversations (membership is checked before findMany). Tests: lib/inbox-conversations.test.ts. The list where clause still always includes workspaceId.

GudBot / HOLD

scripts/ci-fast-checks.mjs fails if:

  • GudBotSettings.enabled defaults true in Prisma or SQL
  • DISABLED_GUDBOT_SETTINGS.enabled is not false
  • qa/ai-eval/README.md drops Soft launch HOLD / OFF by default
  • prisma/migrations/ or ci.yml is missing
  • sync-oss.sh would overwrite or delete core's ci.yml
  • CI would run live-runner.mjs

sync-oss.sh still excludes and keeps .github/workflows/ci.yml. It also keeps the new fast-checks files so a hosted tree sync cannot delete them.

/api/health is out of scope (later Kim ask).

Eng handoff: Growth → QA.

Open in Web Open in Cursor 

cursoragent and others added 2 commits November 5, 2026 09:20
Move lint and Next build off the required check. fast-gate keeps
offline eval validate, GudBot-off fast-checks, tests, contentlayer
types, and tsc, with a 10 minute timeout. full-build still runs on
PRs and main. migrations is unchanged. Soft-launch HOLD; GudBot
stays default OFF.

Co-authored-by: Timchosen Uzua <timchosen@gmail.com>
fast-gate now asserts missing appId is 400 and gd_pub_ is stripped
on widget config/auth. Identify HMAC valid/invalid/missing was
already tested; the visitors route is wired to that helper.
Inbox list denies a signed-in user who is not a member of the
requested workspace (403). Soft-launch HOLD; GudBot stays default OFF.

Co-authored-by: Timchosen Uzua <timchosen@gmail.com>
@cavewebs
cavewebs merged commit 474d934 into main Nov 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants