Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.17](backport #42746) [meraki] fix panic due to uninitialized device wifi structs #42812

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Feb 20, 2025

Overview

This PR fixes a panic occurring when fetching device channel utilization data by ensuring proper initialization of wifi0 and wifi1 struct pointers before access. It also replaces *meraki.Client with an interface to facilitate testing.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs


This is an automatic backport of pull request #42746 done by [Mergify](https://mergify.com).

* initialize structs if nil
use interface for client to facilitate testing

* add tests

* add changelog entry

* fix pr id

* make update

* fix linter

* revert getDeviceLicenses changes

* add more safety checks

* address reviews

(cherry picked from commit cd883f5)

# Conflicts:
#	NOTICE.txt
#	go.mod
@mergify mergify bot requested review from a team as code owners February 20, 2025 17:07
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Feb 20, 2025
@mergify mergify bot requested review from faec and leehinman and removed request for a team February 20, 2025 17:07
@mergify mergify bot assigned gpop63 Feb 20, 2025
Copy link
Contributor Author

mergify bot commented Feb 20, 2025

Cherry-pick of cd883f5 has failed:

On branch mergify/bp/8.17/pr-42746
Your branch is up to date with 'origin/8.17'.

You are currently cherry-picking commit cd883f511.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   CHANGELOG.next.asciidoc
	modified:   x-pack/metricbeat/module/meraki/device_health/device_health.go
	modified:   x-pack/metricbeat/module/meraki/device_health/device_health_test.go
	modified:   x-pack/metricbeat/module/meraki/device_health/devices.go
	modified:   x-pack/metricbeat/module/meraki/device_health/switchports.go
	modified:   x-pack/metricbeat/module/meraki/device_health/uplinks.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   NOTICE.txt
	both modified:   go.mod

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 20, 2025
@gpop63 gpop63 added the Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team label Feb 20, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 20, 2025
@gpop63 gpop63 added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Feb 20, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@gpop63 gpop63 merged commit ffa7b75 into 8.17 Feb 21, 2025
144 checks passed
@gpop63 gpop63 deleted the mergify/bp/8.17/pr-42746 branch February 21, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants