test(dashboards): cover release-marker scoping by the tile's own filter - #2905
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR adds dashboard E2E coverage for release-marker scoping through a tile’s series-level filter.
Confidence Score: 3/5The PR is not yet safe to merge because the previously reported delimiter-based series mismatch and kind-biased annotation cap remain unresolved. Series matching still splits keys on a delimiter that may occur inside service names, and annotation kinds are still concatenated before the global cap, allowing one kind to hide another. Files Needing Attention: packages/app/src/ChartUtils.tsx; packages/app/src/components/charts/chartAnnotations.tsx
|
| Filename | Overview |
|---|---|
| packages/app/tests/e2e/components/ChartEditorComponent.ts | Adds a modal-scoped helper for setting the series-level WHERE condition in Lucene mode. |
| packages/app/tests/e2e/features/release-markers.spec.ts | Adds regression coverage asserting release markers honor the tile’s own service filter. |
| packages/app/tests/e2e/page-objects/DashboardPage.ts | Allows tile creation to set an optional series-level filter before running and saving the chart. |
Reviews (2): Last reviewed commit: "test(dashboards): cover release-marker s..." | Re-trigger Greptile
Deep Review✅ No critical issues found. This is a test-only diff: one new E2E spec plus supporting page-object infrastructure ( 🔵 P3 nitpicks (4)
Reviewers (5): correctness, testing, maintainability, kieran-typescript, project-standards. Testing gaps:
|
319c3c3 to
e30ecc3
Compare
The existing spec scoped its chart with a dashboard-wide filter, which travels as `filters` and was already applied to the releases query — so it stayed green while the tile's *own* filter was ignored entirely. A time chart keeps that filter in its series' `aggCondition`, and nothing exercised it. What slipped through was worse than a wasted query: the markers came back spanning every service in the source, none matched a line on an ungrouped chart, and `resolveAnnotationSeries` dropped all of them. Filter a tile to one service and you saw no markers at all. Add a test that filters only the tile, asserting the filtered service's two releases are drawn and the other service's is not. `setSeriesWhere` needs no app-code hook: it reuses the `series-where-input` and `where-language-switch` test ids and the `switchWhereToLucene` helper. It sets the language explicitly because the mode is sticky in localStorage — a previous spec can leave it on SQL — and because `series-where-input` only exists on the Lucene branch, SearchWhereInput's SQL branch rendering a CodeMirror that carries no test id. Lookups are scoped to the tile-editor modal, since the dashboard behind it renders the same markup. `addTileWithSource` takes the filter as an optional third argument; its other callers pass two and are unchanged.
58dd53f to
d4d0403
Compare
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
E2E Test Results✅ All tests passed • 296 passed • 1 skipped • 1075s
Tests ran across 4 shards in parallel. |
Test-only. Adds the E2E coverage that should have caught the second bug in #2894, now that #2894 has merged.
Why
A review comment on #2894 pointed out that the release-marker scope read
chart.config.where, but timeseries charts don't use it — they keep their filter in each series'aggCondition. That was right, and the consequence was worse than a wasted query: the markers came back spanning every service in the source, none matched a line on an ungrouped chart, andresolveAnnotationSeriesdropped all of them. Filter a tile to one service and you saw no markers.The E2E suite was green through all of it. Its scoping test uses
setGlobalFilter, a dashboard filter, which travels asfiltersand was already applied. Nothing exercised the tile's own filter — the field users actually type into.The fix landed on #2894 with unit coverage only. This closes the loop at the level that would have prevented the mistake.
What
One test that filters only the tile, no dashboard filter, and asserts the filtered service's two releases are drawn and the other service's is not.
ChartEditorComponent.setSeriesWherereaches a series' Where. It switches to Lucene explicitly for two reasons: the mode is sticky in localStorage, so a previous spec can leave it on SQL, andseries-where-inputonly exists on the Lucene branch —SearchWhereInput's SQL branch renders a CodeMirror that carries no test id. Lookups are scoped to the tile-editor modal, since the dashboard behind it renders the same markup.addTileWithSourcegrows an optional third argument. Its two other callers (dashboard-template-import.spec.ts,lucene-autocomplete.spec.ts) pass two, so their behaviour is byte-identical.No app-code changes
Three files, all under
packages/app/tests/e2e/.An earlier revision of this branch added a
data-testid="series-where"wrapper, becauseSearchWhereInputforwards a test id only on its Lucene branch. #2902 has since landeddata-testid="series-where-input", awhere-language-switchtest id and aswitchWhereToLucenehelper, so the hook is no longer needed and the helper is built on those instead.Verification
Re-proved it's a real regression test, not a tautology. With
aggConditionScopeFiltertemporarily stubbed toreturn undefined— reproducing the pre-fix behaviour of reading only the statement-levelwhere— the new test fails as:which is exactly the user-visible symptom. Stub reverted; suite green.
make dev-e2e FILE=release-markers— 4/4 passing.make dev-e2e FILE=dashboard-template-import— 11/11 passing (otheraddTileWithSourcecaller).make dev-e2e FILE=lucene-autocomplete— 4/4 passing (owns the test ids and helper this reuses).make ci-lint— 0 errors, 590 warnings, unchanged.No changeset: test-only, and #2894 already carries the feature's.
🤖 Generated with Claude Code