fix(telemetry): reconcile + commit canonical in fragment PRs

A fragment-only PR fails oss-path-to-production's telemetry-reconcile gate (it
recomputes telemetry-events.json and fails on staleness). After emitting each
fragment, install the registry's deps and run pnpm reconcile, then include
telemetry-events.json in the PR alongside the fragment — matching the Intelligence
CLI + surface-emitter pattern.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Taylor
2026-07-09 13:56:03 -05:00
parent c785dcea64
commit 5855496103
2 changed files with 35 additions and 1 deletions
@@ -77,6 +77,22 @@ jobs:
if: steps.token.outputs.token != ''
run: pnpm tsx scripts/telemetry/emit-fragment.ts --surface docs --out p2p/telemetry-registry/fragments/CopilotKit.docs.json
# Regenerate the canonical alongside the fragment — the registry's reconcile
# CI rejects a stale telemetry-events.json, so a fragment-only PR fails.
# Use the registry's own pnpm (its packageManager field).
- name: Setup pnpm for registry
if: steps.token.outputs.token != ''
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
package_json_file: p2p/package.json
- name: Reconcile registry
if: steps.token.outputs.token != ''
working-directory: p2p
run: |
pnpm install --frozen-lockfile
pnpm reconcile
- name: Open fragment PR
if: steps.token.outputs.token != ''
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
@@ -82,13 +82,31 @@ jobs:
if: steps.token.outputs.token != ''
run: pnpm tsx scripts/telemetry/emit-fragment.ts --surface runtime --out p2p/telemetry-registry/fragments/CopilotKit.runtime.json
# Regenerate the canonical alongside the fragment — the registry's reconcile
# CI rejects a stale telemetry-events.json, so a fragment-only PR fails.
# Use the registry's own pnpm (its packageManager field).
- name: Setup pnpm for registry
if: steps.token.outputs.token != ''
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
package_json_file: p2p/package.json
- name: Reconcile registry
if: steps.token.outputs.token != ''
working-directory: p2p
run: |
pnpm install --frozen-lockfile
pnpm reconcile
- name: Open fragment PR
if: steps.token.outputs.token != ''
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
with:
token: ${{ steps.token.outputs.token }}
path: p2p
add-paths: telemetry-registry/fragments/CopilotKit.runtime.json
add-paths: |
telemetry-registry/fragments/CopilotKit.runtime.json
telemetry-registry/telemetry-events.json
base: main
branch: telemetry/copilotkit-runtime
delete-branch: true