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 #11876: Broken reporting in Rudder 4.3 with standart directives #1824
Fixes #11876: Broken reporting in Rudder 4.3 with standart directives #1824
Conversation
PR rebased |
0ac9b2d
to
b165a22
Compare
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.
Just a comment because I had 2 minutes to read, i need to look deeper tomorrow
@@ -235,7 +235,7 @@ object ExpectedReportsSerialisation { | |||
~ ("components" -> (d.components.map { c => | |||
( | |||
("componentName" -> c.componentName) | |||
~ ("cardinality" -> c.cardinality) | |||
// ~ ("cardinality" -> c.cardinality // #10625: ignore cardinality) |
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 think you should remove the line
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'm going to remove it along with https://www.rudder-project.org/redmine/issues/11940 so that the "real" uniqueVariable cleaning is in the matching PR
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.
OK then the pull request is ok to me :)
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 don't see how the unique variable are managed now, as well as priority and ordering
, variables = expandedVars | ||
, originalVariables = originalVars | ||
) | ||
val expandedVars = Policy.mergeVars(policyVars.map( _.expandedVars.values).toList.flatten) |
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.
there is a change of behaviour here: policy were ordered by priority, and if equal, alphanumerically
it had an impact on the order of variable, and usage of uniqueVariable.
this is replaced here by an unordered set, for both expandedVars and originalVars, which may result in different order for both, and it breaks completely the uniqueVariable usage - unless its done somewhere else, and I failed to see it (and in this case, we don't need to use lists)
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.
my bad, after talking with @fanf , he explained me that policyVars are sorted, and the map().toList kept the order
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.
It is still sorted, but I will add comments to make it clearer.
} else { | ||
val variable = mergedVars.get(newVar.spec.name) match { | ||
case None => | ||
Variable.matchCopy(newVar, setMultivalued = true) //asIntance is ok here, I believe |
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.
this comment is not true anymore
@@ -925,12 +884,15 @@ object BuildNodeConfiguration extends Loggable { | |||
// one more thing: we need to take care of unique variables. |
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'm not sure it handles unique variable there
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.
it does :)
, originalVars = mergeVars(sorted.flatMap(_.originalVars.values)) | ||
, trackerVariable= base.trackerVariable.spec.cloneSetMultivalued.toVariable(sorted.flatMap(_.trackerVariable.values)) | ||
) | ||
val vars = sorted.map { d => PolicyVars( |
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.
the name vars has been confusing me seriously
PR rebased |
b165a22
to
ee7f2a7
Compare
, expandedVars : Map[String, Variable] | ||
, originalVars : Map[String, Variable] // variable with non-expanded ${node.prop etc} values | ||
, trackerVariable : TrackerVariable | ||
, policyVars : NonEmptyList[PolicyVars] |
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.
<3
|
||
// now the first draft is the mode prioritary. We keep it as "main" draft | ||
// now the first draft is the most prioritary. We keep it as "main" draft |
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.
Now the first draft has priority
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.
Looks good to me, apart the commented lines to remove !
The end of cardinality \o/
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'm VinceMacBuche, and i approve this Pull request
This PR is not mergeable to upper versions. |
This PR is not mergeable to upper versions. |
OK, merging this PR |
OK, merging this PR |
https://www.rudder-project.org/redmine/issues/11876