feat(customer-analytics): add value suggestions endpoint for account custom properties - #69500
Conversation
…custom properties Generated-By: PostHog Code Task-Id: 3faf9d95-024e-4878-bd8b-57e2e9e46724
🤖 CI report✅ Bundle size — 🟢 -6.06 MiB (-8.0%)Uncompressed size of every built Total: 69.86 MiB · 🟢 -6.06 MiB (-8.0%)
Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report ✅ Eager graph — within budgetHow much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy
🟢 Largest files eagerly shipped from
|
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 789 B | src/scenes/ChunkLoadErrorBoundary.tsx |
| 668 B | src/index.tsx |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 277.1 KiB | ../node_modules/.pnpm/posthog-js@1.398.2/node_modules/posthog-js/dist/rrweb.js |
| 266.9 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 |
| 224.6 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 213.6 KiB | ../node_modules/.pnpm/posthog-js@1.398.2/node_modules/posthog-js/dist/module.js |
| 164.0 KiB | src/queries/validators.js |
| 154.0 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 105.7 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
| 90.5 KiB | ../node_modules/.pnpm/@tiptap+core@3.20.1_@tiptap+pm@3.20.1/node_modules/@tiptap/core/dist/index.js |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
✅ Dist folder size — 🟢 -20.26 MiB (-1.4%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1433.69 MiB · 🟢 -20.26 MiB (-1.4%)
ℹ️ MCP UI apps size — 31 app(s), 15642.0 KB JS
Built size of each MCP UI app (main.js + styles.css).
| App | JS | CSS |
|---|---|---|
| debug | 579.0 KB | 173.6 KB |
| action | 426.8 KB | 173.6 KB |
| action-list | 543.7 KB | 173.6 KB |
| cohort | 425.8 KB | 173.6 KB |
| cohort-list | 542.7 KB | 173.6 KB |
| email-template | 425.7 KB | 173.6 KB |
| error-details | 442.6 KB | 173.6 KB |
| error-issue | 426.5 KB | 173.6 KB |
| error-issue-list | 543.6 KB | 173.6 KB |
| experiment | 540.9 KB | 173.6 KB |
| experiment-list | 544.5 KB | 173.6 KB |
| experiment-results | 542.7 KB | 173.6 KB |
| feature-flag | 546.4 KB | 173.6 KB |
| feature-flag-list | 550.0 KB | 173.6 KB |
| feature-flag-testing | 429.6 KB | 173.6 KB |
| insight-actors | 541.6 KB | 173.6 KB |
| invite-email-preview | 425.1 KB | 173.6 KB |
| llm-costs | 539.0 KB | 173.6 KB |
| session-recording | 427.6 KB | 173.6 KB |
| session-summary | 432.9 KB | 173.6 KB |
| survey | 427.4 KB | 173.6 KB |
| survey-global-stats | 541.8 KB | 173.6 KB |
| survey-list | 544.4 KB | 173.6 KB |
| survey-stats | 541.8 KB | 173.6 KB |
| trace-span | 426.2 KB | 173.6 KB |
| trace-span-list | 543.6 KB | 173.6 KB |
| workflow | 426.2 KB | 173.6 KB |
| workflow-list | 543.1 KB | 173.6 KB |
| query-results | 724.5 KB | 173.6 KB |
| render-ui | 615.7 KB | 173.6 KB |
| visual-review-snapshots | 430.6 KB | 173.6 KB |
🦔 Hogbox preview · ✅ ready▶ Open the preview
commit |
- numeric search: filter formatted values before the 50-item limit fills, instead of slicing the queryset first (searches beyond the 50 smallest values no longer return empty) - skip non-finite value_num rows instead of crashing the endpoint on a stray row - skip options with missing/empty labels in select suggestions Generated-By: PostHog Code Task-Id: 9a9664d7-c2a8-4c3a-9e25-967ee99ae9d9
|
Reviews (1): Last reviewed commit: "fix(customer-analytics): apply review fi..." | Re-trigger Greptile |
Generated-By: PostHog Code Task-Id: 9a9664d7-c2a8-4c3a-9e25-967ee99ae9d9
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
…dynamic ORM keys Clears the semgrep orm-field-injection finding: instead of interpolating a column name into .exclude() dict keys, branch on the data type and use literal field lookups for the numeric and string paths. Generated-By: PostHog Code Task-Id: 9a9664d7-c2a8-4c3a-9e25-967ee99ae9d9
…r mypy Generated-By: PostHog Code Task-Id: 9a9664d7-c2a8-4c3a-9e25-967ee99ae9d9
There was a problem hiding this comment.
All three bot-raised concerns (numeric-search truncation, blank select labels, non-finite crash, and the resource-level-vs-object-level access model) were fixed or credibly rebutted with a diff-verified fix and tests; the access-control pattern matches the product's own documented, accepted architecture (confirmed by reading the CLAUDE.md and the viewset's existing scope_object/mixin usage), and the author is on the owning team with STRONG familiarity, giving independent assurance for this API-surface change.
- Author wrote 100% of the modified lines and has 68 merged PRs in these paths (familiarity STRONG).
- arthurdedeus reviewed the current head.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 175L, 7F substantive, 400L/12F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (400L, 12F, two-areas, feat) |
| stamphog 2.0.0b3 | .stamphog/policy.yml @ bf52e45 · reviewed head d7592b5 |
Problem
Part 1/3 of custom property filters for the accounts list (split from #69415). The filter UI needs value suggestions per custom property, and the lazy join's boolean coalescing breaks typed filtering.
Changes
GET custom_property_definitions/values/?key=<id>&value=<search>: select → option labels, boolean → true/false, text/numeric → distinct active values (soft-deleted and other teams excluded)How did you test this code?
Unit tests: suggestions logic (select labels, soft-delete + team isolation, numeric formatting), endpoint envelope, and query-runner lazy-join/typed round-trip tests — 83 passing.
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Automatic notifications
Docs update
No
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Authored by Claude Code (PostHog Code); split out of #69415 by layer. Skills invoked: /improving-drf-endpoints, /writing-tests. The endpoint response shape ({results: [{name}], refreshing}) matches the shared property-values picker contract on the frontend, which lands in the follow-up PRs.
Created with PostHog Code