Skip to content

Conversation

@jajeffries
Copy link
Contributor

@jajeffries jajeffries commented Oct 22, 2025

This pull request refactors the way agent configuration and connection details are handled and transmitted in the fleet config manager, improving clarity and extensibility. The changes introduce a new ConnectionDetails struct for passing MQTT connection parameters, update the messaging system to include the agent's configuration YAML in capability messages, and update related tests accordingly.

Connection details handling

  • Introduced a new ConnectionDetails struct in agent/configmgr/fleet/connection.go to encapsulate all MQTT connection parameters, replacing multiple function arguments with a single struct for clarity and maintainability.
  • Refactored all usages of the Connect method in both production and test code to use the new ConnectionDetails struct, ensuring consistent connection parameter passing. [1] [2] [3] [4]

Agent configuration transmission

  • Added marshaling of the agent's configuration to YAML and included it as a string in capability messages sent over MQTT, allowing backend systems to receive the agent's full configuration. [1] [2] [3] [4]

Messaging and capabilities

  • Updated the sendCapabilities method and related message struct to accept and transmit the agent configuration, and refactored backend info collection for improved error handling and structure. [1] [2]

Test updates

  • Modified all relevant unit tests in agent/configmgr/fleet/to_rpc_test.go to supply the agent configuration string and verify its inclusion in capability messages, ensuring full coverage of the new functionality. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

Dependency update

  • Added the gopkg.in/yaml.v3 dependency for YAML marshaling in the agent configuration manager.

@github-actions
Copy link

Go test coverage

STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent 0.0% 0 0 0
🟢 PASS 1.11s github.com/netboxlabs/orb-agent/agent/backend 33.3% 30 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/devicediscovery 67.1% 2 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/backend/mocks 0.0% 0 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/networkdiscovery 59.0% 2 0 0
🟢 PASS 4.02s github.com/netboxlabs/orb-agent/agent/backend/opentelemetryinfinity 46.3% 2 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/pktvisor 67.0% 2 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/snmpdiscovery 58.5% 2 0 0
🟢 PASS 5.03s github.com/netboxlabs/orb-agent/agent/backend/worker 68.1% 3 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/config 100.0% 6 0 0
🟢 PASS 31.19s github.com/netboxlabs/orb-agent/agent/configmgr 50.2% 14 0 0
🟢 PASS 4.55s github.com/netboxlabs/orb-agent/agent/configmgr/fleet 71.3% 126 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/policies 100.0% 15 0 0
🟢 PASS 1.03s github.com/netboxlabs/orb-agent/agent/policymgr 71.2% 10 0 0
🟢 PASS 23.37s github.com/netboxlabs/orb-agent/agent/secretsmgr 48.9% 54 0 0
🟢 PASS 1.02s github.com/netboxlabs/orb-agent/agent/telemetry 81.7% 19 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/version 100.0% 1 0 0

Total coverage: 57.4%

@jajeffries jajeffries marked this pull request as ready for review October 22, 2025 11:54
@jajeffries jajeffries merged commit 8930029 into develop Oct 22, 2025
5 checks passed
@jajeffries jajeffries deleted the feat/OBS-1529-send-config branch October 22, 2025 12:08
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

🎉 This PR is included in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

🎉 This PR is included in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants