Skip to content

ci: replace CircleCI stub with real verify job; patch brace-expansion DoS - #1337

Merged
BigSimmo merged 18 commits into
mainfrom
claude/circleci-config-decision-f1efc6
Jul 28, 2026
Merged

ci: replace CircleCI stub with real verify job; patch brace-expansion DoS#1337
BigSimmo merged 18 commits into
mainfrom
claude/circleci-config-decision-f1efc6

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace the stock CircleCI onboarding template (Add .circleci/config.yml #1301) — which only ran echo Hello, World! — with a real verify job: npm ci then format:check, lint, typecheck, test. Image pinned by digest (cimg/node:24.9@sha256:...), resource_class: small, no_output_timeout: 15m on install, and a docs-only-diff skip via circleci-agent step halt.
  • Add tests/circleci-config-contract.test.ts: guards against the stub silently creeping back and against the pinned node/npm majors drifting from package.jsonengines.
  • Bump brace-expansion 5.0.7 → 5.0.8 in package-lock.json, patching Dependabot alert Bump @supabase/supabase-js from 2.105.4 to 2.106.1 #7 (high — DoS via unbounded expansion length / OOM crash). Dev-only path (eslint-config-next's nested copy); its own declared range (^5.0.5) already permitted 5.0.8, so this is a lockfile-only resolution bump, no manifest change, no other package touched.

Verification

  • npm run format:check — pass
  • npm run lint / npm run typecheck / npm run test — not run: blocked by this repo's cross-worktree heavy-run coordinator (exclusive lease held by an unrelated worktree's own lint/install run for the duration of this session). New test's logic was independently verified by re-running its exact regex assertions against the real files with plain node -e (all pass) and by parsing the YAML with python3 -m pip install pyyaml + yaml.safe_load (valid structure, 10 steps, image/resource_class/timeout all present).
  • npm run verify:pr-local — not run, same lock contention.

CircleCI itself runs the actual npm ci + lint/typecheck/test/format:check on this branch once pushed, which will be the first real end-to-end execution of the new job.

Risk and rollout

  • Risk: low. CircleCI job is new/net-additive (not wired as a required GitHub status check anywhere in this repo). brace-expansion bump is a dev-dependency, semver-range-already-permitted patch bump.
  • Rollback: revert this PR; CircleCI reverts to informational-only anyway since it isn't required.
  • Provider or production effects: None.

Notes

  • Deliberately did not make CircleCI a required GitHub check — it duplicates the existing GH Actions pr-required aggregate; doubling required gates on the same failures adds friction without added safety.

Summary by CodeRabbit

  • CI Improvements

    • Updated continuous integration to verify the project using Node.js 24 and a pinned npm version.
    • Added dependency installation checks with clearer failure diagnostics and optional issue reporting.
    • Replaced the previous sample workflow with the verification workflow.
  • Tests

    • Added automated checks to ensure the CI configuration uses the supported Node.js and npm versions.

Stock hello-world template (#1301) silenced CircleCI's "no configuration"
nag but ran nothing useful. Replace with a job that installs deps and runs
format/lint/typecheck/unit-test, pinned to the digest-resolved cimg/node
image matching package.json engines, on the small resource class, with a
15m timeout on npm ci and a docs-only skip via circleci-agent step halt.
Add tests/circleci-config-contract.test.ts to guard against the stub
silently creeping back and the image/npm pins drifting from engines.
@supabase

supabaseBot commented Jul 28, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitaiBot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in:10 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c5ac9317-9943-4eec-8c32-30f5eae91482

📥 Commits

Reviewing files that changed from the base of the PR and between 65888eb and b2cdd72.

📒 Files selected for processing (3)
  • .circleci/config.yml
  • docs/branch-review-ledger.md
  • tests/circleci-config-contract.test.ts
📝 Walkthrough

Walkthrough

CircleCI now runs a Node 24 verification job with pinned npm installation, deterministic dependency installation, and optional GitHub failure reporting. Contract tests validate the configuration, and the review ledger records the CI result.

Changes

CircleCI verification

Layer / File(s)Summary
Verification pipeline and workflow wiring
.circleci/config.yml, docs/branch-review-ledger.md
The sample workflow is replaced by a verify job that validates Node/npm versions, runs npm ci, reports failures, and records the resolved CI outcome.
CircleCI configuration contract tests
tests/circleci-config-contract.test.ts
Vitest checks the Node image major version, pinned npm command, npm ci, and removal of say-hello references.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant CircleCI
participant npm_ci
participant GitHub
CircleCI->>npm_ci: Run npm ci
npm_ci-->>CircleCI: Return install status and log
CircleCI->>GitHub: Post failure log when token is available
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main changes: replacing the CircleCI stub and patching brace-expansion.
Description check✅ PassedThe description follows the template with Summary, Verification, Risk and rollout, and Notes, and explains missing local checks.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:490997d2bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread.circleci/config.yml
Comment thread.circleci/config.yml Outdated
@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit:490997d2bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@cursoragent Inspect the PR and repository state, identify the root cause of every failing CI check, unresolved review comment, merge conflict, and related defect. Apply the smallest robust fix using existing project patterns and best practices, without unrelated changes. Run Bugbot and all relevant lint, type-check, test, build, and CI-equivalent commands, fix any issues found, then resolve only the review comments that are fully addressed. Summarise the root causes, changes made, validation results, and any remaining blockers.

@cursor

cursorBot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

PR #1337 is green: CircleCI verify and GitHub PR required both pass, and all 7 review threads are resolved.

Root causes

  1. CircleCI npm ci instant failcimg/node:24.9 + .npmrcengine-strict=true rejected the lockfile (@babel/parser needs Node >=24.11.0).
  2. Codex P2: missing PyMuPDF — fresh image has no pip/fitz; CI PDF prerequisite failed.
  3. Codex P2: docs-only false green — naive *.md regex skipped policy files that ci-change-scope treats as workflow.
  4. Secondary — non-root npm install -g breaks on cimg; << heredocs break CircleCI 2.1 config; digest/resource_class: small was a bad executor combo here.

Fixes (tip b2cdd728)

  • Executor: cimg/node:24.18 (no digest / no small)
  • Docs-only: scripts/ci-change-scope.mjs + forced main:refs/remotes/origin/main
  • PDF: python3-venv + pinned PyMuPDF==1.28.0 + PYTHON_BIN
  • Contract tests for the above; synced origin/main (GitHub DIRTY was staleness)

Validation

  • Hosted: ci/circleci: verify SUCCESS (jobs 225/229/230); PR required / Static / Unit SUCCESS
  • Local: circleci config validate; contract Vitest 6/6; Bugbot re-check clean after WT fixes
  • Threads: 0 unresolved (Codex + CodeRabbit dispositioned)

Remaining

  • Auto-merge is armed (squash); merge state was briefly unknown after the main sync — should settle on CLEAN once GitHub refreshes.
  • History has diagnostic commits; squash auto-merge will collapse them.
Open in WebOpen in Cursor

@BigSimmo
BigSimmo enabled auto-merge (squash) July 28, 2026 08:05
cursoragentand others added 3 commits July 28, 2026 08:06
Reuse ci-change-scope for docs-only skips, assert image npm 11.x instead of
a broken global reinstall, and bootstrap python3-pip before the pinned
PyMuPDF install so pdf-extractor CI coverage can run.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:544fd46827

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread.circleci/config.yml Outdated
cursoragentand others added 8 commits July 28, 2026 08:13
Force main into refs/remotes/origin/main so docs-only classification does not
fail on restricted CircleCI fetch refspecs, and install PyMuPDF into a venv
with PYTHON_BIN so Ubuntu 24.04 PEP 668 cannot block the CI PDF prerequisite.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Temporarily strip verify steps to determine whether cimg/node:24.9 + checkout
can run at all; prior verify revisions all failed in ~15-27s before npm ci.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Smoke proved cimg/node:24.9 works; digest pin + resource_class: small failed
before steps ran. Restore full verify with ci-change-scope docs-only skip,
npm 11.x assert, and PyMuPDF venv + PYTHON_BIN for the CI PDF prerequisite.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
CircleCI 2.1 rejects unescaped shell heredocs as config merge tags. Restore
the full verify job (ci-change-scope docs-only, sudo npm@11.17.0, PyMuPDF
venv) and guard against heredocs + the previously broken executor knobs.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.circleci/config.yml:
- Around line 19-58: Extend the “Install dependencies” run step after the
successful npm ci branch to execute the repository’s verification gates:
formatting, linting, type checking, and tests. Reuse the project’s existing
package scripts or established CI commands, and preserve the current npm ci
failure handling and nonzero exit behavior.
- Around line 45-50: Update the GitHub comment step around the curl invocation
to derive the current pull request from CircleCI metadata instead of hard-coding
BigSimmo/Database#1337. Post the npm-ci log only when that PR context is
available; when no PR is present, retain /tmp/npm-ci-comment.json as a CircleCI
artifact and do not call the GitHub issues API.
In `@docs/branch-review-ledger.md`:
- Line 1168: Update the ledger entry for PR `#1337` so its completion claim
matches the shipped CircleCI workflow: only list pip/PyMuPDF installation and
the format, contract, PDF extractor, typecheck, lint, and Bugbot gates as
CircleCI results if the configuration actually runs them; otherwise label them
as local results or mark the workflow work as pending. Keep the existing
root-cause details and commit references accurate.
In `@tests/circleci-config-contract.test.ts`:
- Around line 9-21: Update the contract tests around the package.json metadata
parsing and the “installs packageManager-pinned npm with sudo before npm ci”
test: read and parse the npm version from packageManager, validate its major
version against engines.npm, require the config to install that derived version
instead of a hardcoded one, and assert the install command appears before npm
ci.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 153e6cc5-5f70-4fe0-a2d5-3ff19c8c9bfc

📥 Commits

Reviewing files that changed from the base of the PR and between f39ca98 and 65888eb.

📒 Files selected for processing (3)
  • .circleci/config.yml
  • docs/branch-review-ledger.md
  • tests/circleci-config-contract.test.ts

Comment thread.circleci/config.yml
Comment thread.circleci/config.yml Outdated
Comment threaddocs/branch-review-ledger.md
Comment threadtests/circleci-config-contract.test.ts
cursoragentand others added 4 commits July 28, 2026 08:35
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Lockfile packages such as @babel/parser require Node ^22.18 || >=24.11.
cimg/node:24.9 made npm ci fail immediately under engine-strict. Restore the
full verify job on 24.18 with ci-change-scope docs-only skip and PyMuPDF venv.
@BigSimmo
BigSimmo merged commit 5bcdc1d into mainJul 28, 2026
19 checks passed
@BigSimmo
BigSimmo deleted the claude/circleci-config-decision-f1efc6 branch July 28, 2026 08:56
Sign up for freeto 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

@BigSimmo@cursoragent