Skip to content

[client] Fix mgmProber interface to match unexported GetServerPublicKey#5815

Merged
pappz merged 1 commit intomainfrom
fix/profilemanager-mgmprober-interface
Apr 7, 2026
Merged

[client] Fix mgmProber interface to match unexported GetServerPublicKey#5815
pappz merged 1 commit intomainfrom
fix/profilemanager-mgmprober-interface

Conversation

@pappz
Copy link
Copy Markdown
Collaborator

@pappz pappz commented Apr 7, 2026

Update the mgmProber interface to use HealthCheck() instead of the now-unexported GetServerPublicKey(), aligning with the changes in the management client API.

Describe your changes

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • Refactor
    • Simplified management URL migration health-checking mechanism by using a more direct verification approach, reducing unnecessary operations and test complexity.

Update the mgmProber interface to use HealthCheck() instead of the
now-unexported GetServerPublicKey(), aligning with the changes in the
management client API.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

The mgmProber interface used for management URL migration probing was updated to replace the GetServerPublicKey() (*wgtypes.Key, error) method with HealthCheck() error. The probing control flow now uses the health-check capability, with corresponding updates to the test mock implementation.

Changes

Cohort / File(s) Summary
Interface Update
client/internal/profilemanager/config.go
Modified mgmProber interface to replace GetServerPublicKey() method with HealthCheck() method, changing the management URL migration probing mechanism from key retrieval to health-check verification.
Test Mock Update
client/internal/profilemanager/config_test.go
Updated mockMgmProber to implement the new HealthCheck() method returning nil, removed WireGuard key generation/storage from mock, and simplified test setup in TestUpdateOldManagementURL.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • mlsmaycon
  • lixmal

Poem

🐰 twitches whiskers with glee
Keys once checked, now health we see!
Simpler probes, clean as can be,
HealthCheck hops—one, two, three! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating the mgmProber interface to use HealthCheck() instead of GetServerPublicKey(), which directly matches the changeset.
Description check ✅ Passed The PR description follows the required template structure with title, sections for changes, checklist, and documentation selection. All mandatory fields are populated, though the 'Describe your changes' and 'Issue ticket number' sections lack detail.

✏️ 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/profilemanager-mgmprober-interface

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 7, 2026

@pappz pappz merged commit 6da34e4 into main Apr 7, 2026
41 of 43 checks passed
@pappz pappz deleted the fix/profilemanager-mgmprober-interface branch April 7, 2026 11:13
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