Skip to content

[meraki] Add nil checks for Resty response in Meraki API calls#44193

Merged
gpop63 merged 10 commits intoelastic:mainfrom
gpop63:meraki/add_resty_checks
May 17, 2025
Merged

[meraki] Add nil checks for Resty response in Meraki API calls#44193
gpop63 merged 10 commits intoelastic:mainfrom
gpop63:meraki/add_resty_checks

Conversation

@gpop63
Copy link
Contributor

@gpop63 gpop63 commented May 3, 2025

Proposed commit message

This PR adds checks for the Resty response object in all Meraki API calls to ensure proper handling of nil responses.

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

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 3, 2025
@mergify
Copy link
Contributor

mergify bot commented May 3, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b meraki/add_resty_checks upstream/meraki/add_resty_checks
git merge upstream/main
git push upstream meraki/add_resty_checks
@mergify mergify bot assigned gpop63 May 3, 2025
@mergify
Copy link
Contributor

mergify bot commented May 3, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @gpop63? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.
@gpop63 gpop63 changed the title Meraki/add resty checks May 3, 2025
@gpop63 gpop63 marked this pull request as ready for review May 3, 2025 13:33
@gpop63 gpop63 requested a review from a team as a code owner May 3, 2025 13:33
@gpop63 gpop63 added the Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team label May 3, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 3, 2025
@gpop63 gpop63 added needs_team Indicates that the issue/PR needs a Team:* label bugfix labels May 3, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 3, 2025
@botelastic
Copy link

botelastic bot commented May 3, 2025

This pull request doesn't have a Team:<team> label.

@gpop63 gpop63 added backport-8.17 Automated backport with mergify backport-8.18 Automated backport to the 8.18 branch backport-8.x Automated backport to the 8.x branch with mergify labels May 3, 2025
@gpop63 gpop63 requested a review from a team as a code owner May 15, 2025 08:37
@gpop63
Copy link
Contributor Author

gpop63 commented May 15, 2025

@elastic/beats-tech-leads hello, could I get a review please? we had to fix something in the meraki fork that's the reason for the go.mod changes

@ishleenk17
Copy link
Member

@elastic/beats-tech-leads hello, could I get a review please? we had to fix something in the meraki fork that's the reason for the go.mod changes

@tommyers-elastic could you please check and approve this.

Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

Approving go.mod changes.

@gpop63
Copy link
Contributor Author

gpop63 commented May 16, 2025

/test

2 similar comments
@gpop63
Copy link
Contributor Author

gpop63 commented May 16, 2025

/test

@gpop63
Copy link
Contributor Author

gpop63 commented May 16, 2025

/test

@gpop63
Copy link
Contributor Author

gpop63 commented May 17, 2025

/test

@gpop63 gpop63 merged commit 812b877 into elastic:main May 17, 2025
195 checks passed
mergify bot pushed a commit that referenced this pull request May 17, 2025
)

* add checks for resty res object

* add changelog entry

* fix pr id

* de morgans law

* check err contents for getDeviceLicenses

* update meraki fork

* add ByBand nil check

---------

Co-authored-by: Ishleen Kaur <102962586+ishleenk17@users.noreply.github.com>
(cherry picked from commit 812b877)

# Conflicts:
#	go.mod
#	go.sum
mergify bot pushed a commit that referenced this pull request May 17, 2025
)

* add checks for resty res object

* add changelog entry

* fix pr id

* de morgans law

* check err contents for getDeviceLicenses

* update meraki fork

* add ByBand nil check

---------

Co-authored-by: Ishleen Kaur <102962586+ishleenk17@users.noreply.github.com>
(cherry picked from commit 812b877)

# Conflicts:
#	go.sum
#	x-pack/metricbeat/module/meraki/device_health/devices.go
gpop63 added a commit that referenced this pull request May 17, 2025
…in Meraki API calls (#44357)

* [meraki] Add `nil` checks for Resty response in Meraki API calls (#44193)

* add checks for resty res object

* add changelog entry

* fix pr id

* de morgans law

* check err contents for getDeviceLicenses

* update meraki fork

* add ByBand nil check

---------

Co-authored-by: Ishleen Kaur <102962586+ishleenk17@users.noreply.github.com>
(cherry picked from commit 812b877)

# Conflicts:
#	go.mod
#	go.sum

* fix

---------

Co-authored-by: Gabriel Pop <94497545+gpop63@users.noreply.github.com>
Co-authored-by: Gabriel Pop <gabriel.pop@elastic.co>
@gpop63 gpop63 added the backport-8.19 Automated backport to the 8.19 branch label May 19, 2025
mergify bot pushed a commit that referenced this pull request May 19, 2025
)

* add checks for resty res object

* add changelog entry

* fix pr id

* de morgans law

* check err contents for getDeviceLicenses

* update meraki fork

* add ByBand nil check

---------

Co-authored-by: Ishleen Kaur <102962586+ishleenk17@users.noreply.github.com>
(cherry picked from commit 812b877)

# Conflicts:
#	x-pack/metricbeat/module/meraki/device_health/devices.go
@gpop63 gpop63 added the backport-9.0 Automated backport to the 9.0 branch label May 19, 2025
mergify bot pushed a commit that referenced this pull request May 19, 2025
)

* add checks for resty res object

* add changelog entry

* fix pr id

* de morgans law

* check err contents for getDeviceLicenses

* update meraki fork

* add ByBand nil check

---------

Co-authored-by: Ishleen Kaur <102962586+ishleenk17@users.noreply.github.com>
(cherry picked from commit 812b877)

# Conflicts:
#	x-pack/metricbeat/module/meraki/device_health/devices.go
gpop63 added a commit that referenced this pull request May 19, 2025
…in Meraki API calls (#44358)

* [meraki] Add `nil` checks for Resty response in Meraki API calls (#44193)

* add checks for resty res object

* add changelog entry

* fix pr id

* de morgans law

* check err contents for getDeviceLicenses

* update meraki fork

* add ByBand nil check

---------

Co-authored-by: Ishleen Kaur <102962586+ishleenk17@users.noreply.github.com>
(cherry picked from commit 812b877)

# Conflicts:
#	go.sum
#	x-pack/metricbeat/module/meraki/device_health/devices.go

* fix

* fix changelog

---------

Co-authored-by: Gabriel Pop <94497545+gpop63@users.noreply.github.com>
Co-authored-by: Gabriel Pop <gabriel.pop@elastic.co>
gpop63 added a commit that referenced this pull request May 19, 2025
…in Meraki API calls (#44367)

* [meraki] Add `nil` checks for Resty response in Meraki API calls (#44193)

* add checks for resty res object

* add changelog entry

* fix pr id

* de morgans law

* check err contents for getDeviceLicenses

* update meraki fork

* add ByBand nil check

---------

Co-authored-by: Ishleen Kaur <102962586+ishleenk17@users.noreply.github.com>
(cherry picked from commit 812b877)

# Conflicts:
#	x-pack/metricbeat/module/meraki/device_health/devices.go

* fix changelog

---------

Co-authored-by: Gabriel Pop <94497545+gpop63@users.noreply.github.com>
Co-authored-by: Gabriel Pop <gabriel.pop@elastic.co>
gpop63 added a commit that referenced this pull request May 20, 2025
…n Meraki API calls (#44368)

* [meraki] Add `nil` checks for Resty response in Meraki API calls (#44193)

* add checks for resty res object

* add changelog entry

* fix pr id

* de morgans law

* check err contents for getDeviceLicenses

* update meraki fork

* add ByBand nil check

---------

Co-authored-by: Ishleen Kaur <102962586+ishleenk17@users.noreply.github.com>
(cherry picked from commit 812b877)

# Conflicts:
#	x-pack/metricbeat/module/meraki/device_health/devices.go

* fix

* fix changelog

---------

Co-authored-by: Gabriel Pop <94497545+gpop63@users.noreply.github.com>
Co-authored-by: Gabriel Pop <gabriel.pop@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.x Automated backport to the 8.x branch with mergify backport-8.17 Automated backport with mergify backport-8.18 Automated backport to the 8.18 branch backport-8.19 Automated backport to the 8.19 branch backport-9.0 Automated backport to the 9.0 branch bugfix Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team

3 participants