Repository navigation
ci(node): integrate shared benchmark reports - #5454
dustinbyrne wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Not approved — this change needs a human reviewer.
Re-adding the stamphog label gives the same result unless the changed files change.
stamphog can't auto-approve this pull request because two gates failed. The deny-list gate flagged it as infra_cicd, since it adds .github/workflows/node-benchmark-report.yml and changes .github/workflows/node-benchmarks.yml. The tier gate classified it as T2-never, because it touches CI workflows across two areas. The size gate passed, so splitting the change wouldn't clear the refusal. Please ask a human reviewer, such as a CI or infra owner, to review and merge it.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✗ | matches: infra_cicd |
| size | ✓ | 41L, 2F substantive, 47L/3F incl. docs/generated/snapshots — within ceiling |
| tier | ✗ | classified as T2-never: T2-never (47L, 3F, two-areas, ci) |
| stamphog 2.6.1 | .stamphog/policy.yml @ unknown · reviewed head 8783dd4 |
📝 No Changeset FoundThis PR doesn't include a changeset. A changeset is required to release a new version. How to add a changesetRun this command and follow the prompts: pnpm changesetRemember: Never use |
|
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 8783dd4: 2 Should fix.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
| contents: read | ||
| actions: read | ||
| pull-requests: write | ||
| uses: PostHog/.github/.github/workflows/sdk-benchmark-report.yml@ced4b9694b90c9221bc277b1c8d9f013eafe56c5 # SDK benchmark workflow (PostHog/.github PR #84) |
There was a problem hiding this comment.
P2 · Preserve queued publishers for different pull requests
When three benchmark runs finish close together, the pinned reusable workflow puts all Node publishers in one concurrency group. GitHub replaces the pending job even with cancel-in-progress: false, so a different PR loses its report. Queue publishers without dropping them or serialize by verified PR.
| --repetitions 6 | ||
|
|
||
| - name: Render benchmark comparison | ||
| if: ${{ !cancelled() && (steps.measure.outcome == 'success' || steps.measure.outcome == 'failure') }} |
There was a problem hiding this comment.
P2 · Carry measurement failures into partial reports
If run.mjs throws after saving a successful pair, such as on an invalid metric, this step renders the last saved documents without the exception. The publisher also ignores the source-run conclusion, so it posts a normal-looking comparison for an aborted suite. Propagate the measurement failure into both reports.
Coherence0 spec problems · 0 failing chokepoints · 2 spec gaps · 0 guard failures 44 components, 7 bullets (5 invariants, 2 requirements), 0 problems Chokepoints: none declared. Spec gaps: 2 entrances with outside or unknown trust and no traced control, and 10 more held by the adoption baseline
Close one with |
Node SDK acceptance v2Commit: f58c2d7 Capture v0✅ 55 passed / ❌ 1 non-passing / Drill-down: run artifacts → ❌ migration/yaml-parity-v1/remote-flags-v1.feature::Omitted GeoIP settings default to enabled in flag requests — failed_assertionFlags field differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v1.feature:134 the first flags request field "geoip_disable" should equal JSON false Operation: Field: Expected: false Actual value: true Harness exit: 1; report validation exit: 1. Capture v1✅ 120 passed / ❌ 1 non-passing / Drill-down: run artifacts → ❌ migration/yaml-parity-v1/remote-flags-v1.feature::Omitted GeoIP settings default to enabled in flag requests — failed_assertionFlags field differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v1.feature:134 the first flags request field "geoip_disable" should equal JSON false Operation: Field: Expected: false Actual value: true Harness exit: 1; report validation exit: 1. |
| --repetitions 6 | ||
|
|
||
| - name: Render benchmark comparison | ||
| if: ${{ !cancelled() && (steps.measure.outcome == 'success' || steps.measure.outcome == 'failure') }} |
There was a problem hiding this comment.
P2 · Publish failures that occur before measurement
When a build or test:benchmarks fails before measure, this condition skips rendering and the raw artifact contains at most revisions.json. The pinned publisher requires all three result files, so it cannot post the failure and leaves any previous benchmark comment in place. Publish an explicit pre-measurement failure instead.
| ...['steady', 'burst'].flatMap((drain_strategy) => | ||
| [32, 4096].map((payload_bytes) => ({ | ||
| id: `capture.drain.${drain_strategy}.${payload_bytes}`, | ||
| mode: 'drain', | ||
| payload_bytes, | ||
| operations: smoke ? 200 : 1000, | ||
| concurrency: 1, | ||
| drain_strategy, | ||
| flush_every: drain_strategy === 'steady' ? 100 : smoke ? 200 : 1000, | ||
| completion_boundary: 'completed_delivery', | ||
| passes: ['timing', 'allocation', 'memory'], |
There was a problem hiding this comment.
P2 · Reserve time to upload results before the job timeout
The four drain workloads add 144 worker executions to a suite whose prior CI runs already took roughly 20 minutes under a 30-minute job timeout. A slower SDK or runner can exhaust that deadline, cancelling the job before partial results are rendered or uploaded. Bound measurement below the job deadline or increase the timeout with a separate upload reserve.
There was a problem hiding this comment.
PostHog Review · Standard · reviewed f58c2d7: 2 Should fix.
This is review round 3 on this pull request. When findings keep coming back in the same code, the approach is usually the problem. Before the next fix, check whether a different design would remove the whole class of findings.
| - name: Collect and render benchmark comparison | ||
| uses: PostHog/.github/.github/actions/benchmark-report@9b34fde6b26df7d874b85d2de09904b4ab701234 # SDK benchmark reporting (PostHog/.github PR #84) | ||
| with: | ||
| mode: collect | ||
| source-status: ${{ needs.benchmark.result }} | ||
| shard-manifest: packages/node/benchmarks/shards.json |
There was a problem hiding this comment.
P2 · Publish a failure when a shard stops after timeouts
If two workers time out before a shard finishes its inventory, run.mjs saves partial results and stops, but collect rejects their incomplete workload coverage before producing bundle.json. The publisher then has no canonical artifact and leaves any previous PR comment in place. Provide a verified failure-report path for incomplete shards.
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| shard: [flags-single, flags-scaling, flags-memory, capture] |
There was a problem hiding this comment.
P2 · Skip benchmark shards for unrelated changes
Every pull request update now starts all four shards, including changes unrelated to posthog-node. Each shard independently installs and builds both revisions without caching, multiplying runner usage and queue pressure across the monorepo. Restore an affected-package guard, including benchmark workflow paths, before starting the matrix.
Changes
Stacked on the Node benchmark producer PR #5453.
workflow_runconsumer using the shared trusted publishing workflow. No SDK/PR code executes in the writable job.Dependencies:
a558711336bd3b81be4a820ed10f26372fc568ed)ced4b9694b90c9221bc277b1c8d9f013eafe56c5)Both shared components and this caller configuration need normal review. Automatic PR comments activate only after the
workflow_runcaller lands on the default branch; summaries can render on this PR already.Validation
CI/tooling only; no SDK runtime, workload, or release changes in this layer. Performance differences remain informational.
Agent context
Autonomy: Human-driven (agent-assisted).
Implemented with Pi and reviewed independently. The stack keeps producer measurements separate from shared reporting integration.