Bug #20071
closedCompliance incorrectly computed when two components have the same name and cfe vars are involved
Description
This is related to #19990 but perhaps it's older than that.
In the case when we have two components with the same name, and at least one of them has a cfengine variable, and all returned report values could match the variable, we count all matching cases for the variable, not removing the value from the other component.
We know that with current structure, it's undecidable in general case (typically, if there is two cfengine vars that convert to a .*
pattern), but here, we don't do the pairing that is tried in the old 6.2 cases (in recPairReports
).
Example:
Expected reports: - block1: "componentXXX", expected value: "${loop}" - block2: "componentXXX", expected value: "inBlock2" Reports: - "componentXXX", "loop1", success - "componentXXX", "loop2", success - "componentXXX", "loop3", success - "componentXXX", "inBlock2", error
In that case, componentXXX
in block2 will have its correct value with status error
.
But componentXXX
in block1 will ALSO have status error
with 4 reports, its own three loops and the one for blocks2.
Workaround¶
The workaround is easy: change the name for one of the component.
Correction¶
The only correct and definitive solution for that problem is to give each reprots an unique ID in expected reports and use that in compliance computation.
Updated by François ARMAND about 3 years ago
- Related to Bug #19990: Technique editor blocks do not report as expected added
Updated by Vincent MEMBRÉ almost 3 years ago
- Target version changed from 7.1.0~beta1 to 7.1.0~beta2
- Priority changed from 16 to 30
Updated by Vincent MEMBRÉ over 2 years ago
- Target version changed from 7.1.0~beta2 to 7.1.0~rc1
Updated by Alexis Mousset over 2 years ago
- Status changed from New to Rejected
This part has changed significantly in 7.1
Updated by François ARMAND over 1 year ago
- Related to Bug #22388: Bad report maching when reportid are present added
Updated by François ARMAND over 1 year ago
- Status changed from Rejected to In progress
- Target version changed from 7.1.0~rc1 to 7.2.9
- Priority changed from 30 to 0
- Regression set to No
We should at least add a unit test to demonstrate that it is actually corrected in 7.2 with reportid
Updated by François ARMAND over 1 year ago
- Status changed from In progress to Pending technical review
- Assignee changed from François ARMAND to Vincent MEMBRÉ
- Pull Request set to https://github.com/Normation/rudder/pull/4897
Updated by François ARMAND over 1 year ago
- Related to User story #20851: Regroup report with their values, not with the expanded value added
Updated by François ARMAND over 1 year ago
- Related to Architecture #23084: Remove constraint on component name pattern for matching reports added
Updated by François ARMAND over 1 year ago
- Related to Bug #20808: Missing reports with a reportid are missing in compliance added
Updated by François ARMAND over 1 year ago
- Status changed from Pending technical review to Resolved
Test will be done along with https://issues.rudder.io/issues/22388 - see comments in PR