Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove duplicated code in orb backends #82

Merged
merged 2 commits into from
Mar 27, 2025

Conversation

leoparente
Copy link
Contributor

This pull request includes several changes to improve the consistency and code reuse across different backend components (device discovery, network discovery, and open telemetry). The changes primarily focus on updating the way requests are made to backend services and replacing the interface{} type with the more modern any type.

Improvements to request handling and code reuse:

Consistency improvements in network discovery:

Updates in open telemetry backend:

  • agent/backend/otel/otel.go: Updated the Configure, GetCapabilities, and other methods to use any instead of interface{} and replaced custom request handling with backend.CommonRequest. [1] [2] [3] [4] [5]

These changes enhance the maintainability and readability of the code by standardizing request handling and modernizing type usage across different backend components.

@leoparente leoparente self-assigned this Mar 26, 2025
Copy link

github-actions bot commented Mar 26, 2025

Go test coverage

STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟢 PASS 1.03s github.com/netboxlabs/orb-agent/agent 0.0% 1 0 0
🟢 PASS 0.02s github.com/netboxlabs/orb-agent/agent/backend 0.0% 0 0 0
🟢 PASS 0.00s github.com/netboxlabs/orb-agent/agent/backend/devicediscovery 0.0% 0 0 0
🟢 PASS 0.00s github.com/netboxlabs/orb-agent/agent/backend/networkdiscovery 0.0% 0 0 0
🟢 PASS 0.00s github.com/netboxlabs/orb-agent/agent/backend/otel 0.0% 0 0 0
🟢 PASS 0.00s github.com/netboxlabs/orb-agent/agent/backend/pktvisor 0.0% 0 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/backend/worker 0.0% 0 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/configmgr 0.0% 0 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/policies 0.0% 0 0 0
🟢 PASS 0.01s github.com/netboxlabs/orb-agent/agent/policymgr 0.0% 0 0 0
🟢 PASS 1.72s github.com/netboxlabs/orb-agent/agent/secretsmgr 8.0% 7 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/version 100.0% 1 0 0

Total coverage: 1.9%

@leoparente leoparente marked this pull request as ready for review March 26, 2025 18:20
@leoparente leoparente merged commit 8780d91 into develop Mar 27, 2025
5 checks passed
@leoparente leoparente deleted the chore/backends-cleanup branch March 27, 2025 12:56
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