-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Apply orb policies #194
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Go test coverage
Total coverage: 58.8% |
MicahParks
approved these changes
Oct 8, 2025
leoparente
approved these changes
Oct 8, 2025
mfiedorowicz
reviewed
Oct 8, 2025
|
🎉 This PR is included in version 2.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors the MQTT message handling logic in the Fleet configuration manager to improve modularity, testability, and separation of concerns. The primary change is the introduction of a new
Messagingstruct that encapsulates all message dispatching and handling logic, decoupling it from the core MQTT connection code. This also results in updated method signatures, improved dependency injection (notably for the policy manager), and more comprehensive unit tests with mock implementations.Refactoring and Modularity Improvements:
Messagingstruct infrom_rpc.goto handle all MQTT message dispatching and processing, moving logic out ofMQTTConnectionand improving separation of concerns. TheMessagingstruct now manages group membership and agent policy messages, and is injected with aPolicyManagerdependency for better testability and modularity.MQTTConnectionto include amessagingfield and delegate message-related logic (capabilities, group memberships, and policy updates) to theMessagingstruct. This includes changes to the constructor and method signatures to pass thePolicyManagerand agent ID where needed. [1] [2] [3] [4] [5]API and Interface Changes:
NewMQTTConnectionto require aPolicyManagerand updated all usages accordingly. TheConnectmethod now also takes theagentIDas a separate parameter and passes it through to message handlers. [1] [2] [3]MQTTConnectionfor subscribing and publishing to topics, which are now passed as function parameters to the message handlers for improved decoupling.Testing Improvements:
PolicyManagerinterface in bothconnection_test.goandfrom_rpc_test.go, enabling more robust and isolated unit tests for message handling logic. [1] [2]Messagingstruct and mock dependencies, ensuring that message dispatching and handler logic are properly exercised and validated. [1] [2] [3]Other Notable Changes:
encoding/jsonwhere no longer needed.These changes collectively make the Fleet configuration manager's MQTT handling more modular, maintainable, and testable, laying the groundwork for future enhancements.
References:
[1] [2] [3] [4] [5] [6]