Skip to content

chore: Fix more test file lint warnings - #3758

Open
pulpdrew wants to merge 3 commits into
drew/more-test-lint-fixesfrom
drew/more-test-lint-fixes-again
Open

pulpdrew wants to merge 3 commits into
drew/more-test-lint-fixesfrom
drew/more-test-lint-fixes-again

Conversation

@pulpdrew

Copy link
Copy Markdown
Contributor

Summary

Fixes more lint warnings in test files, and reduces the lint warning cap accordingly.

Screenshots or video

No behavior changes

How to reproduce

How to test on Vercel preview

References

  • Linear Issue:
  • Related PRs:

@pulpdrew
pulpdrew added this pull request to stack #3756 November 21, 2026 15:20
@pulpdrew
pulpdrew requested a review from a team as a code owner November 21, 2026 15:20
@changeset-bot

changeset-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0f6f6d1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel

vercel Bot commented Nov 21, 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 Nov 21, 2026 3:29pm UTC
hyperdx-storybook Ready Ready Preview Nov 21, 2026 3:29pm UTC

Request Review

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 478 passed • 1 skipped • 1043s

Status Count
✅ Passed 478
❌ Failed 0
⚠️ Flaky 6
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

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

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: 2
  • Production lines changed: 4 (+ 1079 in test files, excluded from tier calculation)
  • Branch: drew/more-test-lint-fixes-again
  • Author: pulpdrew

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

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 108 in total (1.13%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 P0/P1 in code this PR adds or changes: fix before asking for review.
  • 🟡 P2 in code this PR changes: your call. Fix if small, otherwise reply.
  • 🔵 P3 is collapsed at the bottom: nobody needs to act on it before merge.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    priority. Reply with one sentence; if it is P0, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

2 finding(s): 🔴 0 P0/P1 · 🟡 0 P2 · 🔵 2 P3

No inline comments. 2 P3 folded at the bottom.

🔵 2 P3 — no action needed before merge
  • 🔵 P3 packages/app/src/components/__tests__/SourceForm.test.tsx:45 — Test retypes its own copy of the bidirectional-linking logic instead of testing the real helpers → This PR changes the hand-copied loop to read fields through Record<string, unknown>. The test still runs only its local correlationFields copy, so a regression in SourceForm.tsx would not fail it. The real logic already has typed helpers in packages/app/src/components/Sources/SourceForm/correlationFields.ts: CORRELATION_FIELD_MAP, getCorrelationFieldValue and setCorrelationFieldValue. Drive the test through those helpers (or the component) and drop the widened copy, which also removes the need for the Record<string, unknown> widening.
  • 🔵 P3 packages/app/src/components/__tests__/DBTraceWaterfallChart.test.tsx:44 — New any added in a PR whose purpose is removing lint warnings → mockTimelineChartProps: { latest: any } is a new any, which breaks the 'Avoid any' rule. Type it as { latest: Partial<ComponentProps<typeof TimelineChart>> } and use import type { TimelineChart } so the assertions on .rows are type-checked.

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.

@github-actions

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found.

This PR is a mechanical test-quality refactor: it replaces as unknown as X / as any casts in test files with fromAny / fromPartial from @total-typescript/shoehorn and type-guard narrowing, swaps string literals for SourceKind enum members, and lowers two lint caps (--max-warnings 372→199 in packages/app/package.json, as-any ratchet 99→67 in scripts/ci/ratchet-baseline.json). Independent verification confirmed the changes preserve test behavior:

  • SourceKind.Metric === 'metric' and SourceKind.Log === 'log', so every enum substitution is value-equivalent to the replaced literal.
  • The narrow(value, guard) helper and the isBuilderSavedChartConfig / isRawSqlSavedChartConfig / isBuilderChartConfig guards exist and are sound; replacing as BuilderSavedChartConfig with narrow(..., isBuilderSavedChartConfig) strengthens each test by throwing when the production function returns the wrong discriminant — behavior the old cast silently accepted.
  • fromPartial / fromAny substitutions are behaviorally equivalent to the prior fixtures; fromAny is reserved for deliberately-invalid sources (e.g. counter is not a MetricsDataType, flagged with an explicit comment), and mocked DOM events add an explicit preventDefault: jest.fn() so no event method goes undefined.
  • Both lint caps are lowered (never raised), consistent with the ratcheting mechanism, and track the warnings removed by this diff.

The three prior PR comments are all automated bot output (changeset-bot, vercel, e2e-results) with no human review feedback to re-verify.


Reviewers (5): correctness, testing, maintainability, project-standards, kieran-typescript.

Note: This review was finalized from the orchestrator's own line-by-line verification of the diff; the five reviewer sub-agents were dispatched but output was truncated before merge. No behavioral or type-safety regression was found in the verified risk areas (enum equivalence, guard soundness, assertion strength, cap consistency).

This branch was successfully deployed

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant