Skip to content

ci: split quality gate into parallel jobs#19

Merged
JohnRDOrazio merged 4 commits intomainfrom
ci/parallel-quality-jobs
Mar 11, 2026
Merged

ci: split quality gate into parallel jobs#19
JohnRDOrazio merged 4 commits intomainfrom
ci/parallel-quality-jobs

Conversation

@JohnRDOrazio
Copy link
Member

@JohnRDOrazio JohnRDOrazio commented Mar 11, 2026

Summary

  • Split the single sequential quality job into 4 independent parallel jobs: lint, type-check, test, build
  • All 4 jobs are now registered as required status checks on main
  • Faster CI feedback — failures surface immediately without waiting for unrelated steps

Test plan

  • Verify all 4 jobs run in parallel on this PR
  • Confirm branch protection shows the required checks

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Restructured CI to split lint, type-check, test, and build into separate jobs and renamed the lint job.
    • Added a reusable Node setup action to streamline dependency installation.
    • Updated release sequencing so publishing waits for lint, type-check, test, and build to complete.
    • Build now exposes NEXT_PUBLIC_WS_URL while preserving NEXT_PUBLIC_API_URL.

Split the single sequential `quality` job into 4 independent parallel
jobs (lint, type-check, test, build) for faster CI feedback. Each job
is registered as a required status check on the main branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Warning

Rate limit exceeded

@JohnRDOrazio has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 25 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e6905043-07c7-4b64-be66-2531702c0432

📥 Commits

Reviewing files that changed from the base of the PR and between 4ca269c and 84a62d3.

📒 Files selected for processing (3)
  • .github/workflows/release.yml
  • README.md
  • lib/env.ts
📝 Walkthrough

Walkthrough

The GitHub Actions release workflow was restructured: the previous quality job (with a Node matrix) was replaced by four standalone jobs (lint, type-check, test, build) that run checkout, setup-node, and their npm scripts. publish_github and publish_docker now depend on all four jobs. A new composite action .github/actions/setup-node/action.yml was added to centralize setting up Node and running npm ci. The build job also exposes NEXT_PUBLIC_WS_URL alongside NEXT_PUBLIC_API_URL.

Changes

Cohort / File(s) Summary
Release workflow
.github/workflows/release.yml
Replaces the single quality job and node-version matrix with four separate jobs: lint, type-check, test, build. Each job checks out code, uses setup-node, runs npm ci, and executes its npm script. publish_github and publish_docker now depend on all four jobs. build adds NEXT_PUBLIC_WS_URL env (keeps NEXT_PUBLIC_API_URL).
Local composite action
.github/actions/setup-node/action.yml
Adds a composite action that runs actions/setup-node@v4 with a node-version input (default 22), enables npm cache, and runs npm ci. Intended for reuse by the workflow jobs.

Sequence Diagram(s)

sequenceDiagram
    participant Developer as Developer
    participant Workflow as "Release Workflow"
    participant Setup as "setup-node Action"
    participant Lint as "Lint Job"
    participant TypeCheck as "Type-check Job"
    participant Test as "Test Job"
    participant Build as "Build Job"
    participant Publish as "Publish Jobs"

    rect rgba(200,230,201,0.5)
    Developer->>Workflow: push / create release
    end

    rect rgba(187,222,251,0.5)
    Workflow->>Setup: invoke composite setup (node, npm ci)
    Setup-->>Lint: configured
    Setup-->>TypeCheck: configured
    Setup-->>Test: configured
    Setup-->>Build: configured
    end

    rect rgba(255,224,178,0.5)
    Lint->>Workflow: complete lint
    TypeCheck->>Workflow: complete type-check
    Test->>Workflow: complete tests
    Build->>Workflow: complete build (env vars set)
    end

    rect rgba(255,205,210,0.5)
    Workflow->>Publish: trigger publish_github & publish_docker (all dependencies met)
    Publish-->>Developer: release artifacts published
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through YAML, split one job to four,
npm ci drums a steady score,
Node 22 warms each little den,
builds and tests all hop again,
publish waits till all are done—hooray, encore! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: split quality gate into parallel jobs' accurately and concisely describes the main change: converting a single sequential quality job into four parallel jobs (lint, type-check, test, build).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/parallel-quality-jobs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
.github/workflows/release.yml (2)

13-55: Nice parallelization. Optional: extract shared setup into a reusable workflow.

The four parallel jobs achieve the PR goal of faster feedback. The repeated setup steps (checkout, setup-node, npm ci) are the expected trade-off for parallelization.

For future maintainability, if setup complexity grows (e.g., adding more environment variables, caching strategies, or Node version updates), consider extracting the shared steps into a composite action or reusable workflow.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 13 - 55, The repeated setup steps
in the parallel jobs (lint, type-check, test, build) should be extracted into a
reusable workflow or composite action to avoid duplication; create a new
reusable workflow or composite action that runs the common steps
(actions/checkout@v4, actions/setup-node@v4 with node-version input and cache,
and npm ci) and accept parameters for job-specific commands, then update each
job (lint, type-check, test, build) to call that reusable workflow/action and
only run the job-specific step (npm run lint, npm run type-check, npm run test
-- --run, npm run build).

56-58: Consider adding NEXT_PUBLIC_WS_URL for consistency with the Dockerfile.

The Dockerfile sets both NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL as build args. For validation parity, consider adding the missing env var here.

♻️ Suggested change
       - run: npm run build
         env:
           NEXT_PUBLIC_API_URL: http://localhost:8000
+          NEXT_PUBLIC_WS_URL: ws://localhost:8000
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 56 - 58, Add the missing
NEXT_PUBLIC_WS_URL environment variable to the env block in the release workflow
to match the Dockerfile's build args; specifically, alongside
NEXT_PUBLIC_API_URL: http://localhost:8000 add NEXT_PUBLIC_WS_URL (e.g.,
ws://localhost:8000 or the equivalent value used in the Dockerfile) so CI
validation and builds have parity with the Dockerfile's NEXT_PUBLIC_WS_URL
setting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 13-55: The repeated setup steps in the parallel jobs (lint,
type-check, test, build) should be extracted into a reusable workflow or
composite action to avoid duplication; create a new reusable workflow or
composite action that runs the common steps (actions/checkout@v4,
actions/setup-node@v4 with node-version input and cache, and npm ci) and accept
parameters for job-specific commands, then update each job (lint, type-check,
test, build) to call that reusable workflow/action and only run the job-specific
step (npm run lint, npm run type-check, npm run test -- --run, npm run build).
- Around line 56-58: Add the missing NEXT_PUBLIC_WS_URL environment variable to
the env block in the release workflow to match the Dockerfile's build args;
specifically, alongside NEXT_PUBLIC_API_URL: http://localhost:8000 add
NEXT_PUBLIC_WS_URL (e.g., ws://localhost:8000 or the equivalent value used in
the Dockerfile) so CI validation and builds have parity with the Dockerfile's
NEXT_PUBLIC_WS_URL setting.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 39f83e5d-ed0e-451c-a0dc-e8c06d75c91f

📥 Commits

Reviewing files that changed from the base of the PR and between a87291a and 231fa36.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

- Create .github/actions/setup-node composite action to DRY up the
  repeated Node.js setup + npm ci steps across parallel CI jobs
- Add NEXT_PUBLIC_WS_URL to the build job for parity with Dockerfile

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/release.yml (1)

84-86: ⚠️ Potential issue | 🔴 Critical

Remove empty build-args or provide actual URLs—empty values will fail Zod URL validation at runtime.

The workflow passes NEXT_PUBLIC_API_URL= and NEXT_PUBLIC_WS_URL= as empty strings to the Docker build. However, lib/env.ts validates these with Zod's .url() schema (line 12-14), which rejects empty strings. The validateClientEnv() function uses the nullish coalesce operator (??), so the default value only applies when the variable is undefined or null—not when it's an empty string. This will cause the application to crash at startup with: Invalid client environment variables: {NEXT_PUBLIC_API_URL: ["Invalid url"]}.

Either pass actual URLs (as documented in RELEASING.md and README.md) or omit these build-args entirely to rely on the default fallback.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 84 - 86, The workflow is passing
empty build-args NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL which fail Zod
.url() validation in validateClientEnv() (lib/env.ts) because empty strings are
not nullish; remove these empty build-args or supply real URLs as documented so
the values are either undefined (allowing your defaults) or valid URLs; update
the release.yml step to omit NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL entirely
or replace them with proper URLs to prevent Invalid client environment variables
errors at startup.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.github/workflows/release.yml:
- Around line 84-86: The workflow is passing empty build-args
NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL which fail Zod .url() validation in
validateClientEnv() (lib/env.ts) because empty strings are not nullish; remove
these empty build-args or supply real URLs as documented so the values are
either undefined (allowing your defaults) or valid URLs; update the release.yml
step to omit NEXT_PUBLIC_API_URL and NEXT_PUBLIC_WS_URL entirely or replace them
with proper URLs to prevent Invalid client environment variables errors at
startup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f7b1f9a7-9d29-44be-bd6d-d9ef7968066d

📥 Commits

Reviewing files that changed from the base of the PR and between 231fa36 and 4ca269c.

📒 Files selected for processing (2)
  • .github/actions/setup-node/action.yml
  • .github/workflows/release.yml

JohnRDOrazio and others added 2 commits March 11, 2026 01:46
- Remove empty build-args from Docker publish step (they caused Zod
  .url() validation to fail since empty strings aren't nullish)
- Use || instead of ?? in validateClientEnv() so empty strings fall
  back to undefined, letting Zod .default() provide the fallback URL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JohnRDOrazio JohnRDOrazio added this to the v0.3.0 milestone Mar 11, 2026
@JohnRDOrazio JohnRDOrazio merged commit de9d701 into main Mar 11, 2026
16 checks passed
@JohnRDOrazio JohnRDOrazio deleted the ci/parallel-quality-jobs branch March 11, 2026 12:49
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.

1 participant