[management] no events for temporary peers#5719
Conversation
📝 WalkthroughWalkthroughAddPeer now skips persisting activity events when Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
management/server/peer.go (1)
1485-1485: Consider extracting the"wasm"magic string to a named constant.The
"wasm"kernel version check appears in bothmanager.goand here. Extracting it to a constant (e.g.,peer.KernelVersionWASM) would improve maintainability and reduce the risk of typos.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@management/server/peer.go` at line 1485, Extract the magic string "wasm" into a shared constant (e.g., KernelVersionWASM) so both manager.go and peer.go use the same identifier; add the constant to the peer package (or appropriate package where peer.Meta is defined), then replace occurrences of the literal string checks (for example the condition using peer.ProxyMeta.Embedded and peer.Meta.KernelVersion in peer.go and the corresponding check in manager.go) with comparisons against peer.KernelVersionWASM to ensure consistency and avoid typos.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@management/server/peer.go`:
- Line 1485: Extract the magic string "wasm" into a shared constant (e.g.,
KernelVersionWASM) so both manager.go and peer.go use the same identifier; add
the constant to the peer package (or appropriate package where peer.Meta is
defined), then replace occurrences of the literal string checks (for example the
condition using peer.ProxyMeta.Embedded and peer.Meta.KernelVersion in peer.go
and the corresponding check in manager.go) with comparisons against
peer.KernelVersionWASM to ensure consistency and avoid typos.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3e6dbb8a-238c-44fe-b86f-ff4f27e24de7
📒 Files selected for processing (2)
management/internals/modules/peers/manager.gomanagement/server/peer.go



Describe your changes
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
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