Skip to content

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

Merged
rmnbrd merged 1 commit into
stagingfrom
fix/service-log-date-range
Jul 13, 2026
Merged

fix(service-logs): normalize identical date range#2814
rmnbrd merged 1 commit into
stagingfrom
fix/service-log-date-range

Conversation

@RemiBonnet

@RemiBonnet RemiBonnet commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

Alert links can generate service-log URLs where startDate === endDate. These values were passed unchanged to Loki, resulting in a zero-length query range and no useful logs.

This PR:

  • expands identical service-log dates into a one-hour range;
  • caps the normalized end date at the current time, matching the metrics dashboard behavior;
  • keeps different or incomplete ranges unchanged;
  • adds focused unit tests for the normalization logic.

To review, open service logs with identical startDate and endDate query parameters and verify that logs are queried over the normalized one-hour range.

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

Focused validation completed:

  • 4 unit tests passed with Jest
  • Changed files checked with Prettier
  • Changed files checked with ESLint
  • git diff --check

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

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer — N/A, no UI changes
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

@RemiBonnet RemiBonnet marked this pull request as ready for review July 13, 2026 10:26

@rmnbrd rmnbrd 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.

Tested and approved, LGTM 👍

@rmnbrd rmnbrd merged commit b091ba8 into staging Jul 13, 2026
29 checks passed
@rmnbrd rmnbrd deleted the fix/service-log-date-range branch July 13, 2026 11:38
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.

2 participants