feat(experiments/mcp): Event search for shared metrics#67283
Conversation
MCP UI Apps size report
|
|
Reviews (1): Last reviewed commit: "Update skills description" | Re-trigger Greptile |
❌ Eager graphHow much code each root forces the browser to download and decode through static imports — the regression class total bundle size can't see.
✅ Largest files eagerly reachable from
|
| Size | File |
|---|---|
| 927.9 KiB | src/styles/global.scss |
| 609.0 KiB | public/hedgehog/burning-money-hog.png |
| 541.9 KiB | public/hedgehog/waving-hog.png |
| 357.8 KiB | ../node_modules/.pnpm/@posthog+icons@0.37.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 343.5 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 301.5 KiB | src/lib/api.ts |
| 279.2 KiB | ../node_modules/.pnpm/posthog-js@1.396.3/node_modules/posthog-js/dist/rrweb.js |
| 268.3 KiB | ../common/tailwind/tailwind.css |
| 264.9 KiB | src/queries/schema/schema-general.ts |
| 228.3 KiB | src/types.ts |
Largest files eagerly reachable from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 1.92 MiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/code-bubble.mjs |
| 1.25 MiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/einstein-group.mjs |
| 1.07 MiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/evel.mjs |
| 927.9 KiB | src/styles/global.scss |
| 919.6 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/driving-hogzilla.mjs |
| 787.8 KiB | src/queries/validators.js |
| 739.3 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/coding-group.mjs |
| 692.5 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/wizard-hog.mjs |
| 677.6 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/lemonade.mjs |
| 640.1 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/scott-pilgrim.mjs |
Posted automatically by check-eager-graph · sizes are input-source bytes from the esbuild metafile · part of #32479
|
⏭️ Skipped snapshot commit because branch advanced to The new commit will trigger its own snapshot update workflow. If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:
|
|
Size Change: -455 kB (-0.65%) Total Size: 69.5 MB 📦 View Changed
ℹ️ View Unchanged
|
Query snapshots: Backend query snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
|
Reviews (2): Last reviewed commit: "Fix CI comment" | Re-trigger Greptile |
There was a problem hiding this comment.
Additive optional query parameter with proper team isolation, no SQL injection risk (Python-level set comparison, ORM parameterized final filter), clean refactor of existing logic into a shared utility, and good test coverage. The resolved bot comment about DISTINCT+ORDER BY was addressed in the final code.
Problem
An agent can only find a reusable shared experiment metric by its
searchterm which matches name/description/tags. But teams name metrics by their own conventions, so there's no way to discover "is there already a shared metric measuring event X?"Changes
?event=filter to the shared-metrics list endpoint: returns metrics whose query references that event (directly or via the step events of any action the metric uses) - mirrors the existing?event=filter on the experiments listfilter_metric_group_ids_by_eventhelper inmetric_utils, and refactor the experiments-list filter to use itconfiguring-experiment-analyticsskill to prefilter by?event=before comparingqueryHow did you test this code?
I'm an agent; no manual testing. Automated tests I ran (all green):
test_experiment_saved_metrics.py— neweventfilter cases: direct event, event behind an action, action-label/metric-type/node-kind tokens not matched, composition withsearch(AND), and thateventnever filters a detail retrieve.test_experiment_service.py+test_presentation_api.py— the existing experiments-list?event=suites, to confirm the shared-helper extraction is behavior-preserving.test_metric_utils.py— the action-resolution primitives.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Built with Claude Code. Skills invoked:
/improving-drf-endpoints,/implementing-mcp-tools,/writing-tests.Key decisions: started from a broader plan (a computed
definition/signaturefield on the serializer) and cut it — it was largely a re-projection of the already-returnedquery, and the signature over-matched. Landed on the minimal server capability (?event=) instead. An earlier coarsequery__icontainssubstring was rejected because it matched structural tokens (metric_type,kind, uuids) and stale action names; switching to the events-plus-resolved-actions approach (reusing the experiments-list convention) fixed that and let us share code.