[PR #4367] [MERGED] [management/client] create job channel between management and client #23138

Open
opened 2026-08-05 06:06:50 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/4367
Author: @aliamerj
Created: 8/18/2025
Status: Merged
Merged: 8/28/2025
Merged by: @aliamerj

Base: feature/remote-debugHead: jobs-channel


📝 Commits (10+)

  • d5cbfba new bi-directional stream for jobs
  • d8bba9a create bidirectional job channel to send requests from the server and receive responses from the client
  • 5bd0773 fix tests
  • 7a37407 fix lint and close bug
  • cd44915 fix lint
  • 86e83ec clean up & fix close of closed channel
  • c8396d9 add nolint:staticcheck
  • 598553d remove some redundant code from the job channel PR since this one is a cleaner rewrite
  • e709e0d cleanup removes a pending job safely
  • 5e7a8c4 change proto

📊 Changes

26 files changed (+1848 additions, -830 deletions)

View changed files

📝 client/cmd/testutil_test.go (+3 -2)
📝 client/internal/engine.go (+28 -0)
📝 client/internal/engine_test.go (+3 -2)
📝 client/server/server_test.go (+3 -2)
📝 management/internals/server/boot.go (+1 -1)
📝 management/internals/server/controllers.go (+6 -0)
📝 management/internals/server/modules.go (+1 -1)
📝 management/server/account.go (+3 -0)
📝 management/server/account_test.go (+1 -1)
📝 management/server/dns_test.go (+1 -1)
📝 management/server/grpcserver.go (+138 -10)
📝 management/server/http/testing/testing_tools/tools.go (+2 -1)
management/server/jobChannel.go (+149 -0)
📝 management/server/management_proto_test.go (+3 -2)
📝 management/server/management_test.go (+3 -0)
📝 management/server/mock_server/account_mock.go (+1 -0)
📝 management/server/nameserver_test.go (+1 -1)
📝 management/server/peer_test.go (+4 -4)
📝 management/server/route_test.go (+1 -1)
📝 shared/management/client/client.go (+1 -0)

...and 6 more files

📄 Description

Describe your changes

This PR sets up a communication channel between the management server and the client to handle job requests and responses.

What was done:

  • Created a Job channel for each peer in JobManager.
  • Send messages from management to the client.
  • Send replies from the client back to management.
  • Prepared client-side Job() stream to receive messages from the server.
  • Integrated peer lifecycle management with ephemeral and secrets managers.

Stack

  • feature/remote-debug - ⚠️ No PR associated with branch

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/__


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/4367 **Author:** [@aliamerj](https://github.com/aliamerj) **Created:** 8/18/2025 **Status:** ✅ Merged **Merged:** 8/28/2025 **Merged by:** [@aliamerj](https://github.com/aliamerj) **Base:** `feature/remote-debug` ← **Head:** `jobs-channel` --- ### 📝 Commits (10+) - [`d5cbfba`](https://github.com/netbirdio/netbird/commit/d5cbfba0f1a65da9341f72afcf549b96b91dd847) new bi-directional stream for jobs - [`d8bba9a`](https://github.com/netbirdio/netbird/commit/d8bba9aeb94fe8e89dd9e7e444358c41bca02abc) create bidirectional job channel to send requests from the server and receive responses from the client - [`5bd0773`](https://github.com/netbirdio/netbird/commit/5bd077370cdc6a6f499d3bd484b1ef6dcda937e6) fix tests - [`7a37407`](https://github.com/netbirdio/netbird/commit/7a37407dfac57b9085a23f88190bb7c3d48a4166) fix lint and close bug - [`cd44915`](https://github.com/netbirdio/netbird/commit/cd4491575643bce4a72fe279c8f3fb5b9a9efc69) fix lint - [`86e83ec`](https://github.com/netbirdio/netbird/commit/86e83ece5a48558c5799ebfc8ec92c1dbc56bf2e) clean up & fix close of closed channel - [`c8396d9`](https://github.com/netbirdio/netbird/commit/c8396d90ba30a5f712cb64533d78df918b1d76ec) add nolint:staticcheck - [`598553d`](https://github.com/netbirdio/netbird/commit/598553d5102cdd8d4b80ebfe0e9473152b8f12ed) remove some redundant code from the job channel PR since this one is a cleaner rewrite - [`e709e0d`](https://github.com/netbirdio/netbird/commit/e709e0d4625d2827548a2bc460a547e654187eb1) cleanup removes a pending job safely - [`5e7a8c4`](https://github.com/netbirdio/netbird/commit/5e7a8c4191522326674e79d891b8a1fe08ff6ae9) change proto ### 📊 Changes **26 files changed** (+1848 additions, -830 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/testutil_test.go` (+3 -2) 📝 `client/internal/engine.go` (+28 -0) 📝 `client/internal/engine_test.go` (+3 -2) 📝 `client/server/server_test.go` (+3 -2) 📝 `management/internals/server/boot.go` (+1 -1) 📝 `management/internals/server/controllers.go` (+6 -0) 📝 `management/internals/server/modules.go` (+1 -1) 📝 `management/server/account.go` (+3 -0) 📝 `management/server/account_test.go` (+1 -1) 📝 `management/server/dns_test.go` (+1 -1) 📝 `management/server/grpcserver.go` (+138 -10) 📝 `management/server/http/testing/testing_tools/tools.go` (+2 -1) ➕ `management/server/jobChannel.go` (+149 -0) 📝 `management/server/management_proto_test.go` (+3 -2) 📝 `management/server/management_test.go` (+3 -0) 📝 `management/server/mock_server/account_mock.go` (+1 -0) 📝 `management/server/nameserver_test.go` (+1 -1) 📝 `management/server/peer_test.go` (+4 -4) 📝 `management/server/route_test.go` (+1 -1) 📝 `shared/management/client/client.go` (+1 -0) _...and 6 more files_ </details> ### 📄 Description ## Describe your changes This PR sets up a communication channel between the management server and the client to handle job requests and responses. ### What was done: - Created a Job channel for each peer in JobManager. - Send messages from management to the client. - Send replies from the client back to management. - Prepared client-side Job() stream to receive messages from the server. - Integrated peer lifecycle management with ephemeral and secrets managers. ## Issue ticket number and link #4354 ## Stack - `feature/remote-debug` - :warning: No PR associated with branch <!-- branch-stack --> - \#4367 :point\_left: ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] 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](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] 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/>\_\_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 06:06:50 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#23138