Skip to content

[code-simplifier] Reuse gatewayTimestampToTime in agentEntryToTimelineEvent#34864

Merged
pelikhan merged 1 commit into
mainfrom
code-simplifier/reuse-gateway-timestamp-helper-f2903519bf1a9eb7
May 26, 2026
Merged

[code-simplifier] Reuse gatewayTimestampToTime in agentEntryToTimelineEvent#34864
pelikhan merged 1 commit into
mainfrom
code-simplifier/reuse-gateway-timestamp-helper-f2903519bf1a9eb7

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 26, 2026

refactor: reuse gatewayTimestampToTime in agentEntryToTimelineEvent

Summary

Removes duplicated timestamp-parsing logic from agentEntryToTimelineEvent
in pkg/cli/gateway_logs_timeline.go, replacing it with a call to the
existing shared helper gatewayTimestampToTime.

Changes

File Change
pkg/cli/gateway_logs_timeline.go Replace inline dual-format timestamp parsing with gatewayTimestampToTime call

Motivation

gatewayTimestampToTime was introduced to centralise gateway timestamp
parsing (handling both formats in one place). agentEntryToTimelineEvent
was not yet updated to use it, leaving a second copy of the same logic.
This change closes that gap.

Impact

  • Behaviour: No functional change — the same two timestamp formats are
    handled, in the same order, with the same fallback behaviour.
  • Scope: Single file, low risk.
  • Breaking: No.

Testing

No new tests required; existing timeline tests cover the parsing path.
Verify with go build ./pkg/cli/... and any relevant gateway_logs
unit tests.

Generated by PR Description Updater for issue #34864 · sonnet46 839.2K ·

The agentEntryToTimelineEvent function duplicated the RFC3339Nano/RFC3339
timestamp parsing logic already encapsulated in gatewayTimestampToTime.
Replace the inline parsing with a call to the shared helper.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review May 26, 2026 04:55
Copilot AI review requested due to automatic review settings May 26, 2026 04:55
@pelikhan pelikhan merged commit 1aa3c80 into main May 26, 2026
20 checks passed
@pelikhan pelikhan deleted the code-simplifier/reuse-gateway-timestamp-helper-f2903519bf1a9eb7 branch May 26, 2026 04:55
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented May 26, 2026

PR Code Quality Reviewer completed the code quality review.

No action needed: PR #34864 is already merged. The single-file change replaces 7 lines of duplicated RFC3339Nano→RFC3339 fallback parsing with a call to the existing gatewayTimestampToTime helper. Behavior is identical, no edge cases are lost, and the refactoring is correct and safe. No review comments warranted.

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented May 26, 2026

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #34864 does not have the 'implementation' label and has only 3 new lines of code in business logic directories (well below the 100-line threshold).

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented May 26, 2026

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented May 26, 2026

🧪 Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. The only changed file is pkg/cli/gateway_logs_timeline.go (a production Go file). Test Quality Sentinel skipped.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies unified timeline construction in the CLI by reusing the existing shared timestamp parser (gatewayTimestampToTime) inside agentEntryToTimelineEvent, removing duplicated RFC3339Nano→RFC3339 fallback parsing logic while keeping behavior consistent with the other timeline sources.

Changes:

  • Replaced inline timestamp parsing in agentEntryToTimelineEvent with gatewayTimestampToTime(entry.Timestamp)
  • Kept the same “RFC3339Nano first, then RFC3339” parsing behavior and failure semantics (return (zero, false) when unparseable)
Show a summary per file
File Description
pkg/cli/gateway_logs_timeline.go Removes duplicate timestamp parsing in agent event conversion by delegating to the shared gatewayTimestampToTime helper

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@github-actions github-actions Bot mentioned this pull request May 26, 2026
Copy link
Copy Markdown
Contributor Author

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /zoom-out and /improve-codebase-architecture — approving this clean deduplication.

📋 Summary

Positive Highlights

  • ✅ Eliminates duplicated RFC3339Nano→RFC3339 fallback logic already encapsulated in gatewayTimestampToTime
  • ✅ Makes agentEntryToTimelineEvent consistent with sibling functions gatewayEntryToTimelineEvent and rpcEntryToTimelineEvent
  • ✅ Net -4 lines with zero functional change — a pure improvement
  • ✅ No new abstractions; change follows established project patterns

Nothing blocking here — straightforward and well-executed simplification.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 977.2K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants