Skip to content

Standard CI: psd-ci + claude-review + license-check - #3

Open
krishagel wants to merge 2 commits into
mainfrom
psd/standard-ci
Open

krishagel wants to merge 2 commits into
mainfrom
psd/standard-ci

Conversation

@krishagel

Copy link
Copy Markdown
Member

What this adds

  • .github/workflows/psd-ci.yml — org reusable CI caller (reusable-psd-ci.yml@main), two jobs via working-directory: CloudRunBackend/ and CloudflareWorker/ (both bun + Hono). The Swift app (LessonLens/) is not covered: the reusable gate runs on ubuntu and the app needs a macOS/Xcode runner — left as a TODO comment in the workflow.
  • .github/workflows/claude-review.yml — reusable caller with the Dependabot actor guard (exact template shape).
  • .github/workflows/license-check.yml — reusable caller (exact template shape).
  • .github/dependabot.yml — github-actions weekly + npm weekly for both backend directories (npm ecosystem reads bun.lock), minor/patch grouped.
  • CLAUDE.md (new, repo had none) — short map: components, verified commands, stack, anti-patterns incl. "never weaken CI". AGENTS.md — one-line pointer.
  • Starter test suites (repo had zero tests) wired as test scripts (bun test, built-in runner, no new devDependencies):
    • CloudRunBackend/tests/index.test.ts — real Hono app via its fetch handler: exact health payload values, security headers, JSON 404 with echoed path, 401 on unauthenticated /analyze; plus the exported rate limiter (allows exactly limit calls then blocks; status arithmetic).
    • CloudflareWorker/tests/index.test.ts — same surface via app.request() with a stub Bindings env.

Starter-test rationale

No tests existed. These assert exact response values and rate-limit counts against the real app object (nothing mocked away), so they fail if the health contract, middleware headers, 404 shape, auth gate, or limiter arithmetic breaks. Paths needing Google OAuth/Gemini/KV credentials are covered only for their unauthenticated rejection branch — honest scope, no tautologies.

Verification evidence

Run locally on this branch:

CloudRunBackend:  bun install --frozen-lockfile  → 7 packages installed
                  bun run build                  → dist/index.js 137.17 KB
                  bun test                       → 7 pass, 0 fail, 24 expect() calls
CloudflareWorker: bun install --frozen-lockfile  → 41 packages installed
                  bun test                       → 4 pass, 0 fail, 7 expect() calls

AI disclosure

Prepared with Claude Code (Fable 5) as part of the Phase 3 wave-2a CI standardization; all workflow shapes copied from PSD401/template-nextjs-app and tests verified locally as above.

Human review + merge required.

Workflows (org reusable callers, shapes copied from template-nextjs-app):
- .github/workflows/psd-ci.yml: two jobs calling reusable-psd-ci.yml, one
  per bun/Hono backend (CloudRunBackend, CloudflareWorker) via the
  working-directory input. The Swift app (LessonLens/) is not covered —
  it needs a macOS runner; left as a TODO comment in the workflow.
- .github/workflows/claude-review.yml: reusable-claude-review.yml caller
  with the Dependabot actor guard (dependabot runs cannot grant
  id-token: write to the called workflow).
- .github/workflows/license-check.yml: reusable-license-check.yml caller.

Dependabot (.github/dependabot.yml): github-actions weekly at root, npm
ecosystem weekly for /CloudRunBackend and /CloudflareWorker (npm ecosystem
reads bun.lock), minor/patch updates grouped.

Starter tests (repo previously had zero tests; both wired as the standard
'test' script running 'bun test' — no new devDependencies, bun:test is
built in):
- CloudRunBackend/tests/index.test.ts: exercises the real Hono app fetch
  handler (health payload values, security headers, JSON 404 with echoed
  path, 401 on unauthenticated /analyze) plus the exported in-memory rate
  limiter (allows to limit then blocks, status reflects consumed quota).
- CloudflareWorker/tests/index.test.ts: same surface via app.request()
  with a stub Bindings env (health, security headers, 404, 401).

Agent context: new CLAUDE.md (repo map, verified build/test commands,
stack, anti-patterns including never weakening CI) and AGENTS.md pointer.

Local verification: bun install --frozen-lockfile, bun run build
(CloudRunBackend), and bun test pass in both component directories
(7 pass / 4 pass, 0 fail).
@krishagel krishagel added the phase-3-migration Phase 3 org-standard CI migration label Aug 15, 2026
Copilot AI lite review requested due to automatic review settings August 15, 2026 00:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Org default workflow token is read-only and called reusable workflows cannot elevate beyond the caller's grant, so claude-review (id-token) and OpenWiki (contents/PR write) were silently broken. Defect found by independent Codex review on psd401-prr#115; patched org-wide.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase-3-migration Phase 3 org-standard CI migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants