Repository navigation
feat(app): SLO builder for a new SLO - #3803
alex-fedotyev wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Duplicate code analysis1 new clone introduced by this PR.
If one of these duplicates a helper that already exists, import it instead jscpd compared this branch against |
E2E Test Results✅ All tests passed • 478 passed • 1 skipped • 1096s
Tests ran across 4 shards in parallel. |
Adds /slos/new and a "New SLO" button on the list. The builder edits the API's definition directly, so schema errors show on the field they belong to. Its indicator section picks a log or trace source, the eligible events (a SQL or Lucene where, empty for every event in the source) and the SQL condition a good event matches, which starts from the source's status or severity column. The target and window start at 99.9% over a rolling 30 days. Saving runs the API's check of the SLO's query, so a condition ClickHouse rejects shows its message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47ecd83 to
c350096
Compare
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
| size="sm" | ||
| sqlPlaceholder="For example ServiceName = 'checkout'" | ||
| lucenePlaceholder="For example ServiceName:checkout" | ||
| data-testid="slo-eligible-input" |
There was a problem hiding this comment.
🟡 P2 — slo-eligible-input test id never reaches the input in SQL mode, which is the form's default
SearchWhereInput (packages/app/src/components/SearchInput/SearchWhereInput.tsx:229-256) only forwards data-testid to SearchInputV2, the Lucene input. The SQLInlineEditorControlled branch drops it. This form defaults eligible.whereLanguage to 'sql', so the id is never rendered. Either forward data-testid to the SQL editor in SearchWhereInput, or put the id on a wrapper element here.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| // user wrote. | ||
| const seededGoodRef = useRef<string | undefined>(undefined); | ||
| useEffect(() => { | ||
| if (!source) return; |
There was a problem hiding this comment.
🟡 P2 — The effect that seeds and replaces the good condition has no test
The effect fills in the condition from the source and replaces it on a source switch only if the user hasn't edited it. That is the builder's main new logic, but sloForm.test.ts only covers the resolver and toSloInput. Add a component test: pick source A, check the seeded condition, switch to source B and check it is replaced; then edit the condition, switch again and check the edit is kept.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
PR Review
3 finding(s): 🔴 0 P0/P1 · 🟡 2 P2 · 🔵 1 P3 2 posted as inline comment(s) on the changed lines. 1 P3 folded at the bottom. 🔵 1 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. The SLO builder is well-structured: the form edits the API's 🟡 P2 -- recommended
🔵 P3 nitpicks (3)
Reviewers (9): correctness, testing, maintainability, project-standards, kieran-typescript, frontend-races, adversarial, agent-native, learnings-researcher. Prior PR comments were all automated (Vercel, changeset-bot, jscpd, e2e) with no human feedback on this diff, so no previous-comments reviewer ran; the jscpd clone it reports is in Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
Summary
Adds /slos/new and a "New SLO" button on the list. The builder edits the
API's definition directly, so schema errors show on the field they belong
to. Its indicator section picks a log or trace source, the eligible events
(a SQL or Lucene where, empty for every event in the source) and the SQL
condition a good event matches, which starts from the source's status or
severity column. The target and window start at 99.9% over a rolling 30
days. Saving runs the API's check of the SLO's query, so a condition
ClickHouse rejects shows its message.
Stack
Part 16 of 27 PRs in a GitHub stack (stack #3815). The header says this PR merges into the branch below it, but the stack's base is
main: merging a PR lands it and every PR below it onmain, one squashed commit each. Each diff is only its own change, and CI runs as if each PR targetsmain.Parts 1 to 6 are shared code, 7 to 13 the API and its MCP tools, and 14 to 27 the app. Everything ships behind
ENABLE_SLOS(API) andNEXT_PUBLIC_ENABLE_SLOS(app), both off by default.Screenshots or video
How to reproduce
Starting point:
yarn devon this branch (the pages need the API)..env.developmentturns onENABLE_SLOSandNEXT_PUBLIC_ENABLE_SLOS(parts 7 and 14). Use a trace or log source with data; the demo server works.On the previous part: the list has no way to create an SLO.
On this branch:
Test plan
components/Slos/__tests__/sloForm.test.ts(errors on the right fields, template-specific validation, latency units)How to test on Vercel preview
N/A: SLOs need the API, and the preview runs in local mode, where they are off.
References
[no-changeset: allow] The changeset for this piece is in part 27.
[no-story: allow] The new SLO components are page-level and fed by queries and form state, so this feature has no Storybook stories.
[ui-states: allow] No new empty, loading or error states here beyond the ones listed above.
[as-cast: allow] The cast check matches the word "as" in comments and strings here; the diff has no
ascasts.