Skip to content

fix(app): use plural source kind labels and OTel spelling - #3257

Merged
kodiakhq[bot] merged 3 commits into
mainfrom
teeohhem/tom/plural-types-otel-caps
Oct 2, 2026
Merged

kodiakhq[bot] merged 3 commits into
mainfrom
teeohhem/tom/plural-types-otel-caps

Conversation

@teeohhem

@teeohhem teeohhem commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Source kinds now show as Logs, Traces, OTel metrics, Sessions, and PromQL in both the "Source Data Type" radio group and the sources list under Team settings. The list used to print the raw kind with its first letter capitalized, so it showed "Metric" and "Promql" while the form said "OTEL Metrics".

One map, SOURCE_KIND_LABELS, feeds both. The schema warnings on the metric table form now say "OTel" as well, and capitalizeFirstLetter is deleted because the list was its last caller.

A new unit test checks the list labels. The E2E specs that click these radios by exact text are updated and pass locally.

Screenshots or video

Before After
Source form before Source form after
Sources list before Sources list after

How to test on Vercel preview

Preview routes: /search

Steps:

  1. Open /search.
  2. Click the source actions menu (data-testid="source-actions-menu") next to the source picker.
  3. Click "Create new source".
  4. Verify the "Source Data Type" options include "Logs", "Traces", "OTel metrics", and "Sessions", and that "Log", "Trace", and "OTEL Metrics" do not appear.

Team settings needs the API, which the local-mode preview doesn't run, so only the form is testable there.

References

  • Linear Issue: Fixes HDX-5584
  • Related PRs: N/A

🤖 Generated with Claude Code

The source form's data type options and the sources list now share one
label map: Logs, Traces, OTel Metrics, Sessions, PromQL.
@changeset-bot

changeset-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2a6a066

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Oct 2, 2026 1:47pm UTC
hyperdx-storybook Ready Ready Preview Oct 2, 2026 1:47pm UTC

Request Review

@github-actions github-actions Bot added the review/tier-2 Low risk — AI review + quick human skim label Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🔵 Tier 2 — Low Risk

Small, isolated change with no API route or data model modifications.

Why this tier:

  • Standard feature/fix — introduces new logic or modifies core functionality

Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns.
SLA: Resolve within 4 business hours.

Stats
  • Production files changed: 5
  • Production lines changed: 54 (+ 48 in test files, excluded from tier calculation)
  • Branch: teeohhem/tom/plural-types-otel-caps
  • Author: teeohhem

To override this classification, remove the review/tier-2 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 127 in total (1.80%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.


export const DEFAULT_DATABASE = 'default';

export const SOURCE_KIND_LABELS: Record<SourceKind, string> = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — SOURCE_KIND_LABELS lives in the source form's private constants, away from the existing kind→icon map

Move SOURCE_KIND_LABELS next to SOURCE_KIND_ICONS in packages/app/src/components/sourceSelectUtils.tsx, which is already the shared per-SourceKind display map. SourcesList would then import it from there instead of reaching into ./SourceForm/constants, and both kind maps (and any future kind) get updated in one place.

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

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Updates source type labels and spelling in the UI.

The PR appears safe to merge; no outstanding findings remain.

Summary

The PR gives the source form and Team settings list one shared set of plural source-kind labels, standardizes “OTel” in metric-schema warnings, removes the unused capitalization helper, and updates label tests.

  • Both previous findings are resolved: the metric label uses sentence case, and the list test covers all five kinds.

Reviews (3) · Last reviewed commit: "Merge branch 'main' into teeohhem/tom/pl..."

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found.

This is a tightly-scoped UI copy change: a shared SOURCE_KIND_LABELS: Record<SourceKind, string> map now feeds both the Sources form radio group and the Team-settings sources list, the metric-schema warnings switch OTEL → OTel, and the now-unused capitalizeFirstLetter is deleted. The Record<SourceKind, string> typing makes the label map compile-time exhaustive over all five enum members, TSource.kind is validated by z.nativeEnum(SourceKind) so the lookup cannot miss at runtime, and capitalizeFirstLetter has zero remaining callers repo-wide. Both prior greptile P2 comments are already addressed: the metric label reads OTel metrics (sentence case) and the new unit test asserts all five plural labels.

🔵 P3 nitpicks (2)
  • packages/app/src/components/Sources/SourceForm/SourceForm.tsx:635 — the form radio labels have no unit test; protection against form/list label divergence rests on the shared SOURCE_KIND_LABELS map plus the updated E2E specs, which only exercise the metrics/sessions/promql radios when their feature flags are on.
    • Fix: optionally add a lightweight render test over TableSourceForm asserting each radio label equals its SOURCE_KIND_LABELS entry; low value since the shared map is the structural guarantee and E2E already asserts the exact text.
  • packages/app/src/components/Sources/SourcesList.tsx:34 — SourcesList reaches into a sibling module via ./SourceForm/constants for a label map that is really owned by the Sources feature rather than the form.
    • Fix: if touched again, relocate SOURCE_KIND_LABELS to a neutral Sources/constants.ts shared by both components.

Reviewers (6): correctness, testing, maintainability, project-standards, kieran-typescript, previous-comments.

Testing gaps: Form radio labels are covered only indirectly (shared map + flag-gated E2E); the five list labels are directly unit-tested.

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

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 391 passed • 1 skipped • 1212s

Status Count
✅ Passed 391
❌ Failed 0
⚠️ Flaky 3
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

@pulpdrew pulpdrew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kodiakhq
kodiakhq Bot merged commit 0ddfe7d into main Oct 2, 2026
29 checks passed
@kodiakhq
kodiakhq Bot deleted the teeohhem/tom/plural-types-otel-caps branch October 2, 2026 13:54

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 2a6a0662 Deployed Oct 2, 2026 by vercel[bot]
Preview – hyperdx-storybook — 2a6a0662 Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge review/tier-2 Low risk — AI review + quick human skim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants