Skip to content

ci: run CodeSpeed benchmarks on Nx agents#7763

Draft
beaussan wants to merge 10 commits into
mainfrom
codex/codespeed-nx-agents
Draft

ci: run CodeSpeed benchmarks on Nx agents#7763
beaussan wants to merge 10 commits into
mainfrom
codex/codespeed-nx-agents

Conversation

@beaussan

@beaussan beaussan commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Moves automatic CodeSpeed benchmark CI into the main PR workflow so it runs through Nx Agents.
  • Leaves the existing Benchmarks workflow as manual-only, preserving the old action-based path for ad hoc runs.
  • Adds explicit test:codspeed:* targets for client-nav, SSR, memory client, and memory server benchmarks, backed by a scripts/nx/run-codspeed-benchmark.mjs CLI wrapper.

Impact

  • Architecture: CodeSpeed now wraps the local Vitest benchmark process inside the Nx task that lands on an agent, avoiding a nested codspeed run -- pnpm nx ... scheduler call.
  • Performance / benchmark isolation: Assignment rules route test:codspeed:* targets to linux-medium-js agents with parallelism: 1 to limit same-agent CPU and memory pollution.
  • Auth / CI metadata: The PR test job uses job-scoped id-token: write and forwards the GitHub OIDC request env vars plus CodeSpeed-required GitHub CI metadata to Nx Agents. The wrapper synthesizes a minimal GITHUB_EVENT_PATH payload on agents because GitHub’s event JSON file is not present there.
  • V1 scope: Automatic PR CI schedules client-nav and SSR CodeSpeed simulation targets on agents. Memory-mode targets remain defined and the legacy workflow remains manual-only, but memory mode is not scheduled automatically because codspeed-memtrack cannot increase rlimit on the current Nx Agent environment.
  • User-facing changes: None.

Testing

  • node --check scripts/nx/run-codspeed-benchmark.mjs
  • Parsed changed benchmark package.json files with Node.
  • Parsed changed workflow YAML files with Ruby YAML.
  • Verified the pinned CodeSpeed 4.17.0 installer SHA256.
  • git diff --check
  • Re-validated .github/workflows/pr.yml with Ruby YAML after each auth/scope change.
  • Triggered CI through multiple auth iterations. Auth and GitHub provider setup are now passing on agents; latest run scopes automatic CodeSpeed to client-nav and SSR after memory-mode failed on agents with Failed to increase rlimit.
  • Attempted CI=1 NX_DAEMON=false pnpm nx show project @benchmarks/client-nav --json, but local validation is blocked before Nx starts because the bundled pnpm is 11.7.0 and the repo now requires pnpm >=11.9.0.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 52e1d2c7-ce88-4390-93df-50959bb2b23b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/codespeed-nx-agents

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.

@nx-cloud

nx-cloud Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit aa05c84

Command Status Duration Result
nx run-many --projects=@benchmarks/client-nav,@... ✅ Succeeded 1m 59s View ↗
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 3m 49s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 26s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-09 08:13:45 UTC

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: eb6982d6e8b9
  • Measured at: 2026-07-09T08:09:06.237Z
  • Baseline source: history:a3e24c35a58d
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
react-router.minimal 87.37 KiB 0 B (0.00%) 87.24 KiB 273.88 KiB 75.99 KiB ▁▄▄▄▄██████
react-router.full 91.10 KiB 0 B (0.00%) 90.96 KiB 285.78 KiB 79.15 KiB ▁▅▅▅▅██████
solid-router.minimal 35.56 KiB 0 B (0.00%) 35.44 KiB 106.08 KiB 32.05 KiB ▁▅▅▅▅██████
solid-router.full 40.61 KiB 0 B (0.00%) 40.49 KiB 121.30 KiB 36.54 KiB ▁▆▆▆▆██████
vue-router.minimal 53.07 KiB 0 B (0.00%) 52.94 KiB 150.12 KiB 47.70 KiB ▁▄▄▄▄██████
vue-router.full 59.03 KiB 0 B (0.00%) 58.90 KiB 168.88 KiB 52.93 KiB ▁▄▄▄▄██████
react-start.minimal 102.03 KiB 0 B (0.00%) 101.89 KiB 322.31 KiB 88.32 KiB ▁▃▃▃▆██████
react-start.deferred-hydration 102.76 KiB 0 B (0.00%) 101.91 KiB 323.69 KiB 88.91 KiB ▁▄▄▄▆██████
react-start.full 105.45 KiB 0 B (0.00%) 105.31 KiB 332.24 KiB 91.23 KiB ▁▃▃▃▅██████
react-start.rsbuild.minimal 99.74 KiB 0 B (0.00%) 99.57 KiB 316.74 KiB 85.81 KiB ▁▃▂▂▅██████
react-start.rsbuild.minimal-iife 100.14 KiB 0 B (0.00%) 99.98 KiB 317.67 KiB 86.21 KiB ▁▃▂▂▅██████
react-start.rsbuild.full 102.96 KiB 0 B (0.00%) 102.79 KiB 326.79 KiB 88.60 KiB ▁▃▃▃▅██████
solid-start.minimal 49.71 KiB 0 B (0.00%) 49.58 KiB 152.25 KiB 43.88 KiB ▁▃▃▃▆██████
solid-start.deferred-hydration 52.97 KiB 0 B (0.00%) 49.64 KiB 160.29 KiB 46.85 KiB ▁▃▃▃▅██████
solid-start.full 55.51 KiB 0 B (0.00%) 55.38 KiB 169.30 KiB 48.97 KiB ▁▄▄▄▆██████
vue-start.minimal 71.13 KiB 0 B (0.00%) 71.00 KiB 207.37 KiB 63.03 KiB ▁▄▄▄▇██████
vue-start.full 75.13 KiB 0 B (0.00%) 75.00 KiB 220.01 KiB 66.37 KiB ▁▄▄▄▆██████

Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.

@pkg-pr-new

pkg-pr-new Bot commented Jul 8, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7763

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7763

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7763

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7763

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7763

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7763

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7763

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7763

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7763

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7763

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7763

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7763

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7763

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7763

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7763

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7763

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7763

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7763

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7763

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7763

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7763

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7763

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7763

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7763

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7763

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7763

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7763

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7763

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7763

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7763

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7763

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7763

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7763

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7763

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7763

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7763

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7763

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7763

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7763

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7763

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7763

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7763

commit: aa05c84

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@codspeed-hq

codspeed-hq Bot commented Jul 9, 2026

Copy link
Copy Markdown

Merging this PR will create unknown performance changes

⚠️ No benchmarks were detected in both the base of the PR and the PR.
Please ensure that your benchmarks are correctly instrumented with CodSpeed.

Check out the benchmarks creation guide


Comparing codex/codespeed-nx-agents (aa05c84) with main (a3e24c3)

Open in CodSpeed

@nx-cloud nx-cloud Bot 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.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

We traced all 6 failures to a missing OS capability on the linux-medium-js agents: codspeed-memtrack requires the ability to raise rlimit, which the agent environment does not permit. This is a pre-existing infrastructure constraint — the PR code is correct, but the target agent type cannot support CodeSpeed's memory tracking mode. Resolving this requires an agent type with elevated OS capabilities or coordination with the CodeSpeed/infra team.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.


🎓 Learn more about Self-Healing CI on nx.dev

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