-
Notifications
You must be signed in to change notification settings - Fork 73
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
Fixes #24085: We need a consistant presence of policyMode in compliance API outputs #5357
Conversation
nodeTmpInfos <- onlyNode match { | ||
case None => allNodeInfos.succeed | ||
case Some(id) => | ||
allNodeInfos |
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.
Upmerge will be a little scary on this one because of the NodeInfoService
to NodeFactsRepo
migration, but the same implementation already exists in 8.1...
Apart from this block, there should be nothing that is non-complicated to change ^^
PR updated with a new commit |
1 similar comment
PR updated with a new commit |
// A map to access the node fqdn and settings | ||
val nodeInfos = nodeTmpInfos.view.mapValues(n => (n.name, n)).toMap | ||
|
||
val nodeAndPolicyModeByRules = rules |
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.
I wonder if we shouldn't have a cache for that.
The "node/rule policy mode" is something that is costly to compute, and vary only at specific point (new node, change on rule/directive, change on groups - that's all?). So it looks like a good candidate to keep these data. I think actually the changes are the same than when a generation is needed, and the same than what we would like to have in the expected reports.
So, perhaps not something for that PR, but we need to keep in mind that when perf will need to get better
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.
LGTM, tests are consistant and datastructures are homogeneous between rules and nodes prism.
The performance impact is complicated to assess, it will need a specific task if needed.
This PR is not mergeable to upper versions. |
OK, squash merging this PR |
6e1db8b
to
462ce9b
Compare
https://issues.rudder.io/issues/24085
Basically just adding the policyMode field at every level of the compliance tree.
For nodes and directives, policyMode is already an attribute, but for a rule we need to compute it, so this is a bit less performant as it requires the set of node ids by group to be fetched.