[PR #4359] [CLOSED] feat: create job channel between management and client #20189

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/4359
Author: @aliamerj
Created: 8/16/2025
Status: Closed

Base: mainHead: jobs


📝 Commits (3)

  • 15c671d new bi-directional stream for jobs
  • 411f709 create bidirectional job channel to send requests from the server and receive responses from the client
  • 877dbb8 fix tests

📊 Changes

28 files changed (+1709 additions, -827 deletions)

View changed files

📝 client/cmd/testutil_test.go (+3 -2)
📝 client/internal/engine.go (+47 -1)
📝 client/internal/engine_test.go (+3 -2)
📝 client/server/server_test.go (+3 -2)
📝 management/server/account.go (+3 -0)
📝 management/server/account/manager.go (+3 -0)
📝 management/server/account_test.go (+1 -1)
📝 management/server/dns_test.go (+1 -1)
📝 management/server/grpcserver.go (+184 -12)
📝 management/server/http/handlers/peers/peers_handler.go (+2 -2)
📝 management/server/http/testing/testing_tools/tools.go (+2 -1)
management/server/jobChannel.go (+147 -0)
management/server/jobs.go (+15 -0)
📝 management/server/management_proto_test.go (+3 -2)
📝 management/server/management_test.go (+3 -0)
📝 management/server/mock_server/account_mock.go (+17 -0)
📝 management/server/nameserver_test.go (+1 -1)
📝 management/server/peer_test.go (+4 -4)
📝 management/server/permissions/operations/operation.go (+1 -0)
📝 management/server/route_test.go (+1 -1)

...and 8 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

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/4359 **Author:** [@aliamerj](https://github.com/aliamerj) **Created:** 8/16/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `jobs` --- ### 📝 Commits (3) - [`15c671d`](https://github.com/netbirdio/netbird/commit/15c671d57fa90a1e82f297173a0ea289f076cc78) new bi-directional stream for jobs - [`411f709`](https://github.com/netbirdio/netbird/commit/411f7091deecbcdbf34651dc8c38c4107a8c3d53) create bidirectional job channel to send requests from the server and receive responses from the client - [`877dbb8`](https://github.com/netbirdio/netbird/commit/877dbb8995a060aea10f27243918e592c59fdc67) fix tests ### 📊 Changes **28 files changed** (+1709 additions, -827 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/testutil_test.go` (+3 -2) 📝 `client/internal/engine.go` (+47 -1) 📝 `client/internal/engine_test.go` (+3 -2) 📝 `client/server/server_test.go` (+3 -2) 📝 `management/server/account.go` (+3 -0) 📝 `management/server/account/manager.go` (+3 -0) 📝 `management/server/account_test.go` (+1 -1) 📝 `management/server/dns_test.go` (+1 -1) 📝 `management/server/grpcserver.go` (+184 -12) 📝 `management/server/http/handlers/peers/peers_handler.go` (+2 -2) 📝 `management/server/http/testing/testing_tools/tools.go` (+2 -1) ➕ `management/server/jobChannel.go` (+147 -0) ➕ `management/server/jobs.go` (+15 -0) 📝 `management/server/management_proto_test.go` (+3 -2) 📝 `management/server/management_test.go` (+3 -0) 📝 `management/server/mock_server/account_mock.go` (+17 -0) 📝 `management/server/nameserver_test.go` (+1 -1) 📝 `management/server/peer_test.go` (+4 -4) 📝 `management/server/permissions/operations/operation.go` (+1 -0) 📝 `management/server/route_test.go` (+1 -1) _...and 8 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 <!-- branch-stack --> ### 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 - [ ] 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 05:06:57 -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#20189