Skip to content

Handle nil pointer error#2217

Merged
ilija42 merged 6 commits into
mainfrom
obs-fix
Jul 3, 2026
Merged

Handle nil pointer error#2217
ilija42 merged 6 commits into
mainfrom
obs-fix

Conversation

@yashnevatia

@yashnevatia yashnevatia commented Jul 2, 2026

Copy link
Copy Markdown
Contributor
  • Handle nil pointer error when fetching dashboards.
  • Add option to deploy using folder UID. Generally the folder UID resolves properly but I hit a case when it did not and as a result I had missing dashboards. This is an additive change which does not hurt in case we run into the same issue again.

@yashnevatia yashnevatia requested a review from a team as a code owner July 2, 2026 14:09
Copilot AI review requested due to automatic review settings July 2, 2026 14:09
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

👋 yashnevatia, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

✅ API Diff Results - github.com/smartcontractkit/chainlink-common/observability-lib

✅ Compatible Changes (3)

api.(*Client) (1)
  • GetFolderByUID — ➕ Added
api.PostDashboardRequest (1)
  • FolderUID — ➕ Added
grafana.DeployOptions (1)
  • FolderUID — ➕ Added

📄 View full apidiff report

Copilot AI 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.

Pull request overview

Adds defensive nil checks when scanning Grafana search results to avoid a nil-pointer dereference in GetDashboardByNameFolderUID, improving robustness of the observability Grafana client API.

Changes:

  • Skip dashboards returned from /api/search that have Title or FolderUID unset before applying strings.EqualFold comparisons.

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

Comment thread observability-lib/api/dashboard.go Outdated
yashnevatia and others added 3 commits July 2, 2026 15:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@yashnevatia yashnevatia marked this pull request as draft July 2, 2026 15:35
Comment thread observability-lib/grafana/dashboard.go
dhaidashenko
dhaidashenko previously approved these changes Jul 2, 2026
@yashnevatia yashnevatia marked this pull request as ready for review July 3, 2026 09:15
@ilija42 ilija42 added this pull request to the merge queue Jul 3, 2026
Merged via the queue into main with commit 54d0978 Jul 3, 2026
32 of 33 checks passed
@ilija42 ilija42 deleted the obs-fix branch July 3, 2026 10:49
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.

4 participants