Skip to content

fix: correct graphql-api.log timestamp formatting#1918

Merged
elibosley merged 1 commit intomainfrom
codex/fix-log-timestamp-format-1914
Mar 15, 2026
Merged

fix: correct graphql-api.log timestamp formatting#1918
elibosley merged 1 commit intomainfrom
codex/fix-log-timestamp-format-1914

Conversation

@elibosley
Copy link
Member

@elibosley elibosley commented Mar 15, 2026

Summary

  • fix the pretty logger time format so minutes are rendered correctly in graphql-api.log
  • extract the pretty log time format into a shared constant
  • add a regression test covering the month-vs-minutes formatting bug

Testing

  • pnpm test src/test/core/log.test.ts
  • pnpm type-check

Closes #1914

Summary by CodeRabbit

  • Tests

    • Added test coverage for log timestamp formatting to validate consistent local time display in logs.
  • Refactor

    • Extracted log time format configuration into a reusable constant for improved maintainability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a105eaa3-16b6-4d91-bc4a-e3bf641ac5b3

📥 Commits

Reviewing files that changed from the base of the PR and between c3e9767 and f045465.

📒 Files selected for processing (3)
  • api/src/__test__/core/log.test.ts
  • api/src/core/log.constants.ts
  • api/src/core/log.ts

Walkthrough

Extracts the pino-pretty time format configuration into a named constant and updates the log timestamp format string from 'SYS:HH:mm:ss' to 'SYS:HH:MM:ss'. Includes a test to validate the timestamp formatting behavior.

Changes

Cohort / File(s) Summary
Log Format Configuration
api/src/core/log.constants.ts, api/src/core/log.ts
Introduces PRETTY_LOG_TIME_FORMAT constant with value 'SYS:HH:MM:ss' and updates the pretty log stream's translateTime configuration to use this constant instead of an inline string.
Test Coverage
api/src/__test__/core/log.test.ts
New test file validating pino-pretty timestamp formatting, verifying that log output contains correctly formatted local time in brackets, appropriate log level, and test message.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A timestamp that drifted through time,
Now caught in a format sublime,
MM and not mm,
Make logs look like them—
Minutes in place, now everything's prime! 🕐✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: correcting the timestamp formatting in graphql-api.log by fixing the time format constant.
Linked Issues check ✅ Passed The changes directly address issue #1914 by fixing the logger time format (correcting minutes rendering) and adding a regression test as required.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the timestamp formatting issue and implementing the required regression test; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/fix-log-timestamp-format-1914
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL:

https://preview.dl.unraid.net/unraid-api/tag/PR1918/dynamix.unraid.net.plg

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.96%. Comparing base (36c56f7) to head (f045465).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1918      +/-   ##
==========================================
+ Coverage   50.94%   50.96%   +0.01%     
==========================================
  Files        1023     1024       +1     
  Lines       70542    70558      +16     
  Branches     7681     7693      +12     
==========================================
+ Hits        35941    35958      +17     
+ Misses      34477    34476       -1     
  Partials      124      124              

☔ View full report in Codecov by Sentry.
📢 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.

@elibosley elibosley merged commit 243c5a8 into main Mar 15, 2026
13 checks passed
@elibosley elibosley deleted the codex/fix-log-timestamp-format-1914 branch March 15, 2026 20:51
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.

The datetime values recorded in /var/log/graphql-api.log are wrong

1 participant