Skip to content

fix(service-logs): normalize identical date range#2813

Closed
RemiBonnet wants to merge 1 commit into
stagingfrom
codex/fix-service-log-date-range
Closed

fix(service-logs): normalize identical date range#2813
RemiBonnet wants to merge 1 commit into
stagingfrom
codex/fix-service-log-date-range

Conversation

@RemiBonnet

Copy link
Copy Markdown
Member

What changed

  • Normalize identical service-log startDate and endDate values into a one-hour range.
  • Cap the normalized end date at the current time, matching the metrics dashboard behavior.
  • Keep non-identical and incomplete ranges unchanged.
  • Add focused unit coverage for the date-range normalization.

Why

Alert links can only interpolate timestamps, so they may generate service-log URLs where startDate === endDate. Those values were passed unchanged to Loki, producing a zero-length query range and no useful logs.

Validation

  • yarn jest --config libs/domains/service-logs/feature/jest.config.ts libs/domains/service-logs/feature/src/lib/hooks/use-service-history-logs/normalize-service-history-date-range.spec.ts --runInBand (4 tests passed)
  • ESLint on the three changed files
  • Prettier check on the three changed files
  • git diff --check

Environment note

The Nx project target could not start its plugin worker in the isolated worktree, so the focused Jest, ESLint, and Prettier commands were run directly.

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.04%. Comparing base (ff1fdd9) to head (9821493).

Files with missing lines Patch % Lines
...e-service-history-logs/use-service-history-logs.ts 0.00% 4 Missing ⚠️
...story-logs/normalize-service-history-date-range.ts 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2813      +/-   ##
===========================================
- Coverage    47.20%   47.04%   -0.16%     
===========================================
  Files         1176       35    -1141     
  Lines        25445     1288   -24157     
  Branches      7546      427    -7119     
===========================================
- Hits         12011      606   -11405     
+ Misses       11395      560   -10835     
+ Partials      2039      122    -1917     
Flag Coverage Δ
unittests 47.04% <50.00%> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@RemiBonnet

Copy link
Copy Markdown
Member Author

Superseded by #2814 using the requested branch name.

@RemiBonnet RemiBonnet closed this Jul 13, 2026
@RemiBonnet RemiBonnet deleted the codex/fix-service-log-date-range branch July 13, 2026 10:18
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