Skip to content

fix: use canonical reflect pointer kind#186

Merged
jingxiang-z merged 1 commit into
mainfrom
fix/reflect-pointer-vet
May 4, 2026
Merged

fix: use canonical reflect pointer kind#186
jingxiang-z merged 1 commit into
mainfrom
fix/reflect-pointer-vet

Conversation

@jingxiang-z
Copy link
Copy Markdown
Collaborator

@jingxiang-z jingxiang-z commented May 1, 2026

Summary

  • Replace deprecated reflect.Ptr usages with reflect.Pointer in OTLP conversion reflection code.

Why

  • CI runs golangci-lint 2.12.0, whose govet inline analyzer flags reflect.Ptr and expects the canonical reflect.Pointer constant.

Validation

  • go test ./internal/exporter/converter
  • golangci-lint run --timeout=5m

Summary by CodeRabbit

  • Refactor
    • Improved internal pointer handling in attribute conversion logic to enhance code reliability.

Note: This release includes internal improvements with no user-visible changes.

Signed-off-by: Jingxiang Zhang <jingzhang@nvidia.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a8582221-48f5-4317-a7eb-25a82e5f9c97

📥 Commits

Reviewing files that changed from the base of the PR and between 18af139 and cc32564.

📒 Files selected for processing (1)
  • internal/exporter/converter/otlp.go

📝 Walkthrough

Walkthrough

The PR updates convertStructToOTLPAttributesWithPrefix in the OTLP converter to use reflect.Pointer instead of reflect.Ptr for detecting pointer-kind values during reflection-based attribute conversion. Two locations in the function switch this constant name while preserving nil-pointer checks and dereference behavior.

Changes

Reflection API Update

Layer / File(s) Summary
Pointer Kind Detection
internal/exporter/converter/otlp.go (lines 565–568, 626–632)
Pointer-kind checks in convertStructToOTLPAttributesWithPrefix are updated from reflect.Ptr to reflect.Pointer in both the early-exit check and the field-kind switch case, preserving nil-safety and recursive struct-to-attributes conversion logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A pointer kind renamed with grace,
From Ptr to Pointer's embrace,
The logic stays true, nil checks hold fast,
Reflection flows smooth, this change is past!

🚥 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 clearly and specifically identifies the main change: replacing deprecated reflect.Ptr with the canonical reflect.Pointer constant in the OTLP conversion code.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/reflect-pointer-vet

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

@jingxiang-z jingxiang-z marked this pull request as ready for review May 4, 2026 16:27
@jingxiang-z jingxiang-z merged commit 685e639 into main May 4, 2026
16 checks passed
@jingxiang-z jingxiang-z deleted the fix/reflect-pointer-vet branch May 4, 2026 16:58
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