-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add remote configuration dispatcher #2705
Conversation
904ca43
to
8c7212d
Compare
64ca007
to
d32c2a1
Compare
Minor note, just in case: Be careful not to add too noisy debug logs. They are indeed for us, but often we tell customers to enable |
8c7212d
to
aa89610
Compare
d32c2a1
to
d564501
Compare
aa89610
to
f03c058
Compare
af361fa
to
9fc092d
Compare
9692f2e
to
7ccbbb1
Compare
9fc092d
to
d18da96
Compare
8226347
to
e70ca73
Compare
… strings and use human readable strings
e70ca73
to
8efc23e
Compare
[instance_of(Datadog::Core::Remote::Configuration::Repository::Change::Inserted)] | ||
) | ||
|
||
dispatcher.dispatch(changes, repository) | ||
end | ||
end | ||
end | ||
|
||
describe Datadog::Core::Remote::Dispatcher::Matcher::Product do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor note but... I::Think::We're::Getting::A::Bit::Too::Deep::With::All::The::Namespacing. Consider flattening things a bit maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super fair point.
I think we can have a cleanup PR once all the code has landed in master
What does this PR do?
Add a dispatcher.
The last commit is only adding some spec cleanup and has nothing to do with the actual logic of the PR e70ca73. Please review separately
Motivation
Remote configuration
Additional Notes
The dispatcher gets registered against using a receiver for a block to be called and a matcher to select relevant changes from the changeset.
Upon changes, the dispatcher matches changes against the matcher and calls the receiver, passing the subset of changes as well as the repository itself. This is because:
A generic matcher that takes a block is available, for other matchers to be implemented. A simple product matcher is implemented, based on the generic one.
How to test the change?
Wait a bit to receive first batch of RC. This should happen:
Go in the DD Application Security UI and add a new IP to the list. Wait a bit. This should pop up: