Skip to content

Conversation

@jajeffries
Copy link
Contributor

This pull request adds support for handling the dataset_removed RPC message in the agent's messaging system. It introduces logic to process dataset removal events, ensures robust error handling for malformed messages or missing dependencies, and provides comprehensive test coverage for the new functionality.

Support for dataset removal handling:

  • Added logic in DispatchToHandlers (in from_rpc.go) to handle the dataset_removed RPC function by decoding the payload and invoking a new handler, handleDatasetRemoval.
  • Implemented the handleDatasetRemoval method to retrieve the relevant policy, check for backend existence, and remove the specified dataset from the policy using the backend.

Testing improvements:

  • Extended the main dispatch test (TestMessageHandlers_DispatchToHandlers) to cover the dataset_removed message type, verifying correct interaction with policy manager and backend logic.
  • Added targeted tests for error scenarios and handler logic:
    • Test for malformed dataset_removed payloads to ensure errors are handled gracefully.
    • Tests for successful dataset removal, as well as failures due to policy retrieval errors or missing backend, checking that the handler behaves correctly in each case.

@github-actions
Copy link

github-actions bot commented Oct 10, 2025

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 0.01s github.com/netboxlabs/orb-agent/agent/backend 0.0% 0 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/devicediscovery 79.4% 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 80.6% 2 0 0
🟢 PASS 4.02s github.com/netboxlabs/orb-agent/agent/backend/opentelemetryinfinity 74.1% 2 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/pktvisor 71.7% 2 0 0
🟢 PASS 4.03s github.com/netboxlabs/orb-agent/agent/backend/snmpdiscovery 80.2% 2 0 0
🟢 PASS 5.03s github.com/netboxlabs/orb-agent/agent/backend/worker 80.6% 3 0 0
🟢 PASS 1.02s github.com/netboxlabs/orb-agent/agent/config 100.0% 6 0 0
🟢 PASS 31.16s github.com/netboxlabs/orb-agent/agent/configmgr 51.5% 13 0 0
🟢 PASS 4.42s github.com/netboxlabs/orb-agent/agent/configmgr/fleet 67.5% 74 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 70.3% 10 0 0
🟢 PASS 30.20s github.com/netboxlabs/orb-agent/agent/secretsmgr 48.9% 54 0 0
🟢 PASS 1.01s github.com/netboxlabs/orb-agent/agent/version 100.0% 1 0 0

Total coverage: 62.4%

Base automatically changed from feat/OBS-1490-remove-group to develop October 10, 2025 12:30
@jajeffries jajeffries force-pushed the feat/OBS-1450-remove-dataset branch from 1059690 to d0c9b43 Compare October 10, 2025 12:34
@jajeffries jajeffries marked this pull request as ready for review October 10, 2025 12:35
@jajeffries jajeffries merged commit 45a1cca into develop Oct 10, 2025
5 checks passed
@jajeffries jajeffries deleted the feat/OBS-1450-remove-dataset branch October 10, 2025 12:59
@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