Skip to content

feat(apollo-vertex): typed telemetry seam for solution-tests#971

Draft
frankkluijtmans wants to merge 1 commit into
mainfrom
frankkluijtmans/telemetry-demo-docs
Draft

feat(apollo-vertex): typed telemetry seam for solution-tests#971
frankkluijtmans wants to merge 1 commit into
mainfrom
frankkluijtmans/telemetry-demo-docs

Conversation

@frankkluijtmans

Copy link
Copy Markdown
Contributor

Adds an optional, fully-typed track telemetry callback to SolutionTestsConfig so a host can route Solution Tests action events to its own analytics backend, defaulting to a no-op when omitted. Each action hook (run, create, toggle-active, delete, force-stop batch/run, adopt/update/remove baseline) fires a named event on success, with SolutionTestEventMap as the single typed source of truth for event names and payloads, exported from the package barrel. The docs page gains a Telemetry section documenting the callback, the event contract, and a bullet under Customizing.

👨 Generated with Kluijt Code

Copilot AI review requested due to automatic review settings July 24, 2026 14:04

Copilot AI 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.

Pull request overview

Adds a typed telemetry “seam” to the Apollo Vertex Solution Tests template so host apps can optionally receive strongly-typed analytics events for Solution Tests actions and related UI interactions.

Changes:

  • Introduces SolutionTestEventMap (+ related types) and optional config.track callback in SolutionTestsConfig.
  • Emits telemetry events from Solution Tests mutation hooks and several UI interaction points.
  • Exports the telemetry types from the package barrel and documents the telemetry contract in the template page.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/apollo-vertex/registry/solution-tests/use-solution-tests.ts Adds track calls to run/create/toggle-active/delete mutations (tracking on onMutate).
apps/apollo-vertex/registry/solution-tests/use-run-results.ts Adds track calls for adopt job / update baseline mutations.
apps/apollo-vertex/registry/solution-tests/use-force-stop.ts Adds track calls for force-stopping batch and run mutations.
apps/apollo-vertex/registry/solution-tests/use-baseline-jobs.ts Adds track call for removing a baseline mutation.
apps/apollo-vertex/registry/solution-tests/solution-tests-view.tsx Tracks tab view and row expansion UI interactions.
apps/apollo-vertex/registry/solution-tests/run-details.tsx Tracks run result inspection events.
apps/apollo-vertex/registry/solution-tests/index.ts Re-exports telemetry types from config.ts.
apps/apollo-vertex/registry/solution-tests/expanded-run-tests.tsx Tracks opening run details from expanded runs view.
apps/apollo-vertex/registry/solution-tests/expanded-agents.tsx Tracks viewing raw expected output in the agent expanded view.
apps/apollo-vertex/registry/solution-tests/config.ts Defines SolutionTestEventMap and typed TrackSolutionTestEvent; adds optional track to config + resolved config.
apps/apollo-vertex/app/templates/solution-tests/page.mdx Documents the track callback and event contract; adds telemetry notes under customizing.
Comments suppressed due to low confidence (1)

apps/apollo-vertex/app/templates/solution-tests/page.mdx:135

  • The table is presented right after saying SolutionTestEventMap is the source of truth, but it only lists the action events and omits the UI interaction events that are also part of the map. Add a clarifying sentence so readers don’t assume the table is exhaustive.
`SolutionTestEventMap` is the single source of truth for the event contract, so
the callback is fully typed: `properties` is narrowed to the payload of the
`event` you pass. Compose the map into your own app's event map to keep the
wiring type-safe end to end.

Comment on lines +120 to +122
Omit it and tracking is a no-op. Because the events fire from the mutation hooks
(`useRunTests`, `useCreateTest`, and friends), only the smart container reports
them. A bare `SolutionTestsView` wired to your own handlers does not.
Comment on lines 45 to +49
mutationFn: ({ testIds }: { testIds?: string[]; mode: RunTestsMode }) =>
actions.runTests(testIds),
// Track the user action on trigger (not success) — we want intent, not outcome.
onMutate: ({ testIds, mode }) =>
track?.("VS.SolutionTest.Run", { mode, testCount: testIds?.length ?? 0 }),
Copilot AI review requested due to automatic review settings July 24, 2026 14:18
@frankkluijtmans
frankkluijtmans force-pushed the frankkluijtmans/telemetry-demo-docs branch from e61305f to a04ba38 Compare July 24, 2026 14:18
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Jul 24, 2026, 07:24:00 AM
apollo-docs Ready Preview · Logs Jul 24, 2026, 07:24:00 AM
apollo-landing Ready Preview · Logs Jul 24, 2026, 07:24:00 AM
apollo-vertex Ready Preview · Logs Jul 24, 2026, 07:24:00 AM

@frankkluijtmans
frankkluijtmans force-pushed the frankkluijtmans/telemetry-demo-docs branch from a04ba38 to a3b5f47 Compare July 24, 2026 14:18
@github-actions github-actions Bot added the size:L 100-499 changed lines. label Jul 24, 2026
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package bundle size on this PR (no JS/TS source changes detected under packages/* or web-packages/*).

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core 9.0% 43.84 MB 57.45 MB ±0
@uipath/apollo-react 38.7% 7.45 MB 28.56 MB ±0
@uipath/apollo-wind 41.5% 401.6 KB 2.60 MB +32 B
@uipath/ap-chat 85.8% 43.44 MB 55.94 MB ±0

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1950 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1720
ISC 89
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.2 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI 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.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (3)

apps/apollo-vertex/app/templates/solution-tests/page.mdx:122

  • The telemetry section says events only fire from the mutation hooks and that a bare SolutionTestsView won't emit them, but SolutionTestsView now emits several UI interaction events itself (TabViewed, TestExpanded, BatchExpanded). This doc should distinguish between action events (from hooks) vs UI interaction events (from the view).
Omit it and tracking is a no-op. Because the events fire from the mutation hooks
(`useRunTests`, `useCreateTest`, and friends), only the smart container reports
them. A bare `SolutionTestsView` wired to your own handlers does not.

apps/apollo-vertex/registry/solution-tests/use-solution-tests.ts:49

  • The PR description says telemetry events fire "on success", but the implementation (and this docs page) describe firing on intent (onMutate) rather than on success. Please align the PR description with the actual behavior, or switch the implementation/docs to onSuccess if success-only is intended.
    // Track the user action on trigger (not success) — we want intent, not outcome.
    onMutate: ({ testIds, mode }) =>
      track?.("VS.SolutionTest.Run", { mode, testCount: testIds?.length ?? 0 }),

apps/apollo-vertex/app/templates/solution-tests/page.mdx:134

  • The event contract (SolutionTestEventMap) includes UI interaction events (tab viewed, row expanded, etc.), but the Telemetry table only lists the action events. Either list the UI events too or explicitly state the table is action-only and point readers to SolutionTestEventMap for the full set.
`SolutionTestEventMap` is the single source of truth for the event contract, so
the callback is fully typed: `properties` is narrowed to the payload of the
`event` you pass. Compose the map into your own app's event map to keep the
wiring type-safe end to end.

Comment on lines 45 to +49
mutationFn: ({ testIds }: { testIds?: string[]; mode: RunTestsMode }) =>
actions.runTests(testIds),
// Track the user action on trigger (not success) — we want intent, not outcome.
onMutate: ({ testIds, mode }) =>
track?.("VS.SolutionTest.Run", { mode, testCount: testIds?.length ?? 0 }),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:apollo-vertex size:L 100-499 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants