Skip to content

refactor(event): replace "latest" magic string with @latest sentinel constant#583

Merged
BYK merged 1 commit intomainfrom
fix/event-view-latest-sentinel
Mar 26, 2026
Merged

refactor(event): replace "latest" magic string with @latest sentinel constant#583
BYK merged 1 commit intomainfrom
fix/event-view-latest-sentinel

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Mar 26, 2026

Summary

Follow-up to #574 — the bare string "latest" was used as a sentinel eventId value across 4 assignment sites and 1 comparison with no named constant.

Replaced with LATEST_EVENT_SENTINEL = "@latest", using the @-prefix convention established by IssueSelector magic selectors (@latest, @most_frequent) in arg-parsing.ts.

Changes

  • src/commands/event/view.ts: Added LATEST_EVENT_SENTINEL constant, replaced all 5 occurrences + updated comment
  • test/commands/event/view.test.ts: Updated 8 assertions to expect "@latest"

…INEL

The bare string "latest" was used as a sentinel eventId across 4
assignment sites and 1 comparison with no named constant.

Replaced with LATEST_EVENT_SENTINEL = "@latest", using the @-prefix
convention established by IssueSelector magic selectors (@latest,
@most_frequent) in arg-parsing.ts.
@github-actions
Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Dashboard

  • Add pagination and glob filtering to dashboard list by BYK in #560
  • Rich terminal chart rendering for dashboard view by BYK in #555

Init

  • Propagate sentry-trace headers to wizard API calls by betegon in #567
  • Treat bare slug as new project name when not found by BYK in #554

Other

  • (formatters) Colorize SQL in DB span descriptions by BYK in #546
  • (telemetry) Report unknown commands to Sentry by BYK in #563
  • Bidirectional cursor pagination (-c next / -c prev) by BYK in #564
  • Add sentry sourcemap inject and sentry sourcemap upload commands by BYK in #547
  • Native debug ID injection and sourcemap upload by BYK in #543

Bug Fixes 🐛

Dashboard

  • Validate display types against all datasets by betegon in #577
  • Auto-clamp widget limit instead of erroring by BYK in #573
  • Default issue dataset table columns to ["issue"] by betegon in #570
  • Scale timeseries bar width to fill chart area by BYK in #562
  • Resolve dashboard by ID/slug in addition to title by BYK in #559

Event

  • Detect SHORT-ID/EVENT-ID format in event view by BYK in #574
  • Auto-fallback to org-wide search when event 404s in project by BYK in #575

Other

  • (api) Show meaningful message for network errors instead of '0 Unknown' by BYK in #572
  • (event-view) Auto-redirect issue short IDs in two-arg form (CLI-MP) by BYK in #558
  • (help) Show help when user passes help as positional arg by BYK in #561
  • (issue) Auto-redirect bare org slug to org-all mode in issue list by BYK in #576
  • Reject @-selectors in parseOrgProjectArg with helpful redirect by BYK in #557

Internal Changes 🔧

Coverage

  • Use informational-patch input instead of sed hack by BYK in #544
  • Make checks informational on release branches by BYK in #541

Event

  • Replace "latest" magic string with @latest sentinel constant by BYK in #583
  • Deduplicate span tree building into shared helper by BYK in #581

Other

  • (api) Collapse stats on issue detail endpoints to save 100-300ms by BYK in #551
  • (ci) Upgrade GitHub Actions to Node 24 runtime by BYK in #542
  • (db) DRY up database layer with shared helpers and lint enforcement by BYK in #550
  • (issue-list) Use collapse parameter to skip unused Snuba queries by BYK in #545
  • Bump Bun from 1.3.9 to 1.3.11 by BYK in #552
  • Regenerate skill files by github-actions[bot] in ec1ffe28

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

126 passed | Total: 126 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1270 uncovered lines.
✅ Project coverage is 95.47%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.47%    95.47%        —%
==========================================
  Files          194       194         —
  Lines        28036     28037        +1
  Branches         0         0         —
==========================================
+ Hits         26766     26767        +1
- Misses        1270      1270         —
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit 9a70b24 into main Mar 26, 2026
22 checks passed
@BYK BYK deleted the fix/event-view-latest-sentinel branch March 26, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant