Commit graph

24 commits

Author SHA1 Message Date
Francisco Solla
f955c6a7fe chore(OPS34): e2e CI em 2 shards e cadeia de projetos dev-only (Closes #599) 2026-08-10 14:39:39 -03:00
Francisco Solla
7839a88a5a
Merge pull request #270 from fsolla/cursor/pool-i250-d89b6314-599f
B123 — Campanha — orientação na shell + aba (sem títulos grandes de seção)
2026-08-02 16:16:58 -03:00
Cursor Agent
3e89e200eb
ci: align GitHub workflows with pnpm knip script invocation 2026-08-02 19:02:03 +00:00
Cursor Agent
cad3556bce
OPS16: reduce production deploy cooldown from 30 to 15 minutes
Change DEPLOY_COOLDOWN_MS constant, update ci.yml deferral log, and
adjust unit test pins. Closes #259.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 18:38:36 +00:00
Cursor Agent
fded303fe6
fix(ci): stop trusting GET /v13 alias for production domain ownership
CI short-circuited "already aliased" when v13 listed pt.jorgesolla.com.br
on a fresh --prod deploy while the domain still pointed at an older
Current. Verify only via GET /v2/.../aliases and /v4/aliases?domain=.
Also drop invalid --yes on vercel alias set (CLI 55).
2026-08-01 16:12:30 +00:00
Cursor Agent
fdd318692c
fix(ci): clear domain gitBranch so CLI prod deploys can alias
Git-branch-bound domains only move via Git Integration. With Git
auto-deploy OFF, clear the binding, then promote + alias + verify.
2026-08-01 15:59:41 +00:00
Cursor Agent
bcca5da92c
fix(ci): verify domain alias via aliases API + vercel alias set
Promote + POST aliases still left pt.jorgesolla.com.br off the staged
deployment's GET /v13 alias list. Verify with GET /v2/.../aliases and
GET /v4/aliases?domain=, log steps live, and also run `vercel alias set`
(recommended when Git Integration is off).
2026-08-01 15:48:59 +00:00
Cursor Agent
baa8f14f82
fix(ci): promote Vercel deploy to pt.jorgesolla.com.br
Disabling Git auto-deploy is correct for Actions-gated production. The
separate project toggle "Auto-assign Custom Production Domains" must stay
ON — when OFF, `vercel deploy --prod` only aliases *.vercel.app and leaves
the custom domain on an older Current (exactly what we saw after #122).

After each deploy, ensure-production-alias re-enables auto-assign if needed,
promotes the deployment, and verifies pt.jorgesolla.com.br is attached.
Also adds workflow_dispatch "Vercel promote production" for promote-without-rebuild.
2026-08-01 15:26:31 +00:00
Cursor Agent
07c9b9c571
fix(ci): disable pnpm cache on deploy cooldown setup-node
OPS11 added an early setup-node@v5 before pnpm/action-setup for the
cooldown script. setup-node v5 defaults package-manager-cache to true
and tries to invoke pnpm from package.json, which is not on PATH yet —
deploy failed with "Unable to locate executable file: pnpm".

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 14:04:12 +00:00
Cursor Agent
cbddd8c796
OPS11 — cooldown de 30 min entre deploys de produção (Vercel)
- Script vercel-deploy-cooldown consulta último deploy READY via API Vercel
- Job deploy em ci.yml adia upload quando idade < 30 min (sucesso, não falha)
- Job requeue espera o residual e re-dispara ci.yml
- vercel deploy passa --archive=tgz para reduzir pressão de upload
- Testes unitários para computeCooldownWait e fetch da API

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 10:54:55 +00:00
Cursor Agent
8d9e4136f1
OPS9 — CI fail-fast: cancel workflow when any parallel job fails
Add composite action wrapping styfle/cancel-workflow-action@0.12.1 and
invoke it with if: failure() on every parallel job in ci-pr.yml and ci.yml.
Workflow-level actions: write permission enables cancellation. Document
fail-fast behavior in docs/AGENT-OPS.md CI table.

Closes #52

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 06:25:05 +00:00
Francisco Ignácio Fontoura Solla
c6baea3375 ci: bump checkout@v5, setup-node@v5, pnpm/action-setup@v6
Silence GHA Node 20 deprecation on action runtimes; inputs unchanged.
2026-07-31 23:56:22 -03:00
Francisco Ignácio Fontoura Solla
27b6bb75ba ci(deploy): bump Vercel CLI to 55 (API requires ≥47.2.2)
Build succeeded; deploy --prebuilt aborted on outdated CLI 41.7.8.
2026-07-31 23:43:07 -03:00
Francisco Ignácio Fontoura Solla
183203f1d7 ci(deploy): unset CI test DATABASE_URL before vercel build
Workflow env pointed vercel build at localhost teqo_test; Payload migrate
then ECONNREFUSED. Drop test DB/secret/site URL so pull's production
.env is what the build uses.
2026-07-31 23:32:19 -03:00
Francisco Ignácio Fontoura Solla
2e873523c8 ci(deploy): install pnpm before vercel build
vercel build shells out to pnpm (packageManager); the deploy job only
had npm, which failed with spawn pnpm ENOENT after auth worked.
2026-07-31 23:24:12 -03:00
Francisco Ignácio Fontoura Solla
68a4f702fb ci(deploy): harden Vercel gated deploy link
Match the Vercel Actions KB (job-level org/project env, global CLI),
validate team_/prj_ secret shapes, and document the misleading
Project Settings 403. Org/project secrets were resynced from local link.
2026-07-31 23:04:33 -03:00
Francisco Ignácio Fontoura Solla
f021992de0 ci: main-only cutover with gated Vercel deploy
Remove stage/promote/Neon smoke. PR CI targets main; ci.yml full-suite
verifier deploys via vercel CLI and requeues when HEAD moves. Pool uses
POOL_GITHUB_TOKEN and POOL_BASE_REF=main. Docs/skills/rules retargeted.
2026-07-31 20:57:18 -03:00
Francisco Ignácio Fontoura Solla
cf9438e5b9 fix(ci): restore rollup checks job for branch protection
Parallel ci-pr jobs no longer published the legacy `checks` context
required by stage/main branch protection, blocking auto-merge with no
link in the UI. Add a needs-based rollup that gates on all jobs green.
2026-07-30 17:41:45 -03:00
Francisco Ignácio Fontoura Solla
322794b1ee fix(e2e-ci): serve the production build in CI instead of next dev
The first full e2e run on the parallel pipeline hit the 30-min timeout:
dev-mode cold webpack compiles per route, a __webpack_modules__ TypeError,
and dev-server memory-threshold restarts. CI now builds (NEXT_DIST_DIR
matches the webServer env) and playwright webServer runs `pnpm start`;
local spec development keeps `pnpm dev`.
2026-07-30 17:37:20 -03:00
Francisco Ignácio Fontoura Solla
2e0cc2c03e chore(ci): parallel PR jobs, affected tests, push gate, owner-of-red-CI policy
- ci-pr.yml: split the serial checks job into parallel lint/format/
  typecheck/knip/cycles + unit/int (vitest --changed vs PR base via
  scripts/test-affected.mjs, full fallback on high-risk paths) + e2e
  (manifest path->spec via scripts/e2e-affected.mjs, blocking) + build;
  migration-lock gains checkout + pull-requests:read (fixes the failures
  that blocked PR #50)
- ci.yml (main): full safety net — seed:minimal + int full + build + e2e
- package.json: gate:fast / gate:push; .husky/pre-push runs gate:push
- docs: "Dono do PR, dono do CI" policy in AGENT-OPS + work-issue +
  engineering-standards; changelog entry; plans for OPS3-OPS7
2026-07-30 17:37:20 -03:00
Francisco Ignácio Fontoura Solla
777fde2eed ci: PR gate with minimal DB + build + migration-lock; stage gate without build 2026-07-30 04:44:37 -03:00
Francisco Ignácio Fontoura Solla
571872f1a7 chore: remove Codeberg; GitHub is the only home 2026-07-30 04:34:07 -03:00
Francisco Ignácio Fontoura Solla
c00f83d870 Tooling: pnpm db:doctor + preflight no guard-dev-db (remedios nomeados, deteccao de volume compartilhado pos-corrupcao WAL), madge check:cycles e prettier no CI/pre-push, guard rails de data migration no skill, notas de processo (knip --fix, pipes) e gate atualizado nos docs/rules 2026-07-25 18:02:02 -03:00
Francisco Ignácio Fontoura Solla
0e4e6855dc Add the tooling gate: knip, CI, zero-warning lint, as-never ban
- knip (files/deps at error level; unused exports ledgered as warn) with
  config for Payload/Next entries; deleted the dead modules it confirmed:
  RecentlyVisited + UpcomingActionPlansCard + actionPlanUpcomingPreview,
  lazy-dialog helpers, tseZone, federalCandidateTotalsAggregate (test-only),
  unused ui kit files, one-shot rename script; pruned unused radix deps and
  typescript-eslint; added pg/@types/pg (pinned to drizzle's 8.10.2)
- GitHub Actions CI on the mirror: lint, typecheck, knip, unit, migrate, int
  against a Postgres 17 service
- eslint: unused-vars with ^_ ignore patterns (migrations args exempt),
  repo-wide ban on `as never` (no-restricted-syntax), lint gate at
  --max-warnings=0; fixed all 54 pre-existing warnings (dead imports,
  hooks deps, tracking-pixel img disable with impeccable config exception)
- tsconfig: include consolidated from 219 lines to 5 (wildcard covers all
  .next dist variants), noUnusedLocals on
- typed replacements for every as-never: hookFilledCreateData (actions
  create data completed by collection hooks), drizzle scopeColumn narrowing,
  tests' stub<T> helper (property-level checking kept, completeness waived)
- test infra: leased-consent generalization used by onda0 spec (shared
  leases over the stable consent keys; window race ledgered), purge fix
- docs: IMPROVE-CODE-QUALITY-PLAN.md tracker, TECH-DEBT.md ledger,
  TESTING.md safety-net map (package.json also gains the Phase 2
  build:election-aggregates script entry; the script lands next commit)
2026-07-23 23:06:12 -03:00