-
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 #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting #3650
Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting #3650
Conversation
0863f40
to
bb47760
Compare
.../rudder/rudder-core/src/main/scala/com/normation/cfclerk/domain/VariableAndSectionSpec.scala
Show resolved
Hide resolved
bb47760
to
985c3a1
Compare
Commit modified |
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.
WIP, fastly broken
.../rudder/rudder-core/src/main/scala/com/normation/cfclerk/domain/VariableAndSectionSpec.scala
Outdated
Show resolved
Hide resolved
@@ -437,3 +436,20 @@ object DisplayPriority { | |||
} | |||
} | |||
} | |||
|
|||
sealed trait CompositionRule | |||
case object WorstReport extends CompositionRule |
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.
can you put the case
s in the object and mark them final
(it's the conventional pattern used elsewhere)
.../rudder/rudder-core/src/main/scala/com/normation/cfclerk/domain/VariableAndSectionSpec.scala
Outdated
Show resolved
Hide resolved
...s/rudder/rudder-core/src/main/scala/com/normation/cfclerk/xmlparsers/SectionSpecParser.scala
Outdated
Show resolved
Hide resolved
.../rudder/rudder-core/src/main/scala/com/normation/rudder/domain/reports/ExpectedReports.scala
Outdated
Show resolved
Hide resolved
.../rudder/rudder-core/src/main/scala/com/normation/cfclerk/domain/VariableAndSectionSpec.scala
Outdated
Show resolved
Hide resolved
...es/rudder/rudder-core/src/main/scala/com/normation/rudder/domain/reports/StatusReports.scala
Outdated
Show resolved
Hide resolved
...es/rudder/rudder-core/src/main/scala/com/normation/rudder/domain/reports/StatusReports.scala
Outdated
Show resolved
Hide resolved
...er/rudder-core/src/main/scala/com/normation/rudder/services/policies/DeploymentService.scala
Outdated
Show resolved
Hide resolved
webapp/sources/rudder/rudder-web/src/main/elm/editor/sources/ViewBlock.elm
Outdated
Show resolved
Hide resolved
|> appendChild cloneIcon | ||
removeIcon = element "i" |> addClass "fa fa-times-circle" | ||
removeButton = element "button" | ||
|> addClass "text-danger method-action tooltip-bs" |
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.
missing title
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 remove button does not work for components in groups
PR updated with a new commit |
10 similar comments
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
05700ee
to
f16781f
Compare
PR updated with a new commit |
5 similar comments
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
...s/rudder/rudder-core/src/main/scala/com/normation/cfclerk/xmlparsers/SectionSpecParser.scala
Show resolved
Hide resolved
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.
Reviewed ~1/3 :) Some tiyn things to update for now, overall very good
case WorstReport => | ||
ComplianceLevel.compute(ReportType.getWorseType(subComponents.map(_.status)) :: Nil) | ||
case SumReport => ComplianceLevel.sum(subComponents.map(_.compliance)) | ||
case FocusReport(component) => ComplianceLevel.sum(findChildren(component).map(_.compliance)) |
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 that if the component is not found, it should not be 0 or whatever ComplianceLevel.sum(Nil)
does, but it should be a missing report error.
componentName : String | ||
//only one ComponentValueStatusReport by value | ||
//only one ComponentValueStatusReport by valuex. |
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.
typo
case _ => Left(Unexpected(s"Value '${value}' is not a valid reporting composition rule.")) | ||
} | ||
} | ||
} |
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 would prefer that each ReportingLogic
has a name
attribute, and that name is used everywhere when the string is needed. If we want to ensure consistency.
So something like:
sealed trait ReportingLogic { def name: Sring}
final case object WorstReport extends ReportingLogic { val name = "worst" }
final case class FocusReport(component : String) extends ReportingLogic { val name = "focus:${component}" }
etc
import ReportingLogic._ | ||
(("componentName" -> c.componentName) | ||
~ ("composition" -> (c.reportingLogic match { | ||
case WorstReport => "worst" |
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.
c.reportingLogic.name
reportingLogic match { | ||
case WorstReport => ("type"-> "worst") | ||
case SumReport => ("type"-> "sum") | ||
case FocusReport(component) => ("type" -> "focus") ~ ("value" -> component) |
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, so you need to split name
and serialize
in ReportingLogic
(with by default val serialize = name
and for focus report something different)
val reportingLogic = block.reportingLogic match { | ||
case WorstReport => "worst" | ||
case SumReport => "sum" | ||
case FocusReport(component) => s"focus:${component}" |
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.
block.reportingLogic.serialize
|
||
val t5 = System.nanoTime | ||
u4 += t5-t4 | ||
|
||
|
||
(missing, unexpected, expected) | ||
( unexpected, expected) |
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 get why you don't have missing at all here: the case is still possible if some reports were lost (are more likely because of bad reporting logic somewhere)
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.
They are already treated in another branch, i got duplicated missing if i keep it
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.
yes the difference is here: https://github.com/Normation/rudder/pull/3650/files/b5ee112bc450916897f1e3cbd6a032ff6feb5b21#diff-32bcd76fdbbd93efed1323a8e48c79320607d7ef97094e819936a74e6fab88feR938
Previously we treated missing reports in its own place, so we were parsing all reports to check missing components so we produced our missing reports ,then when doing expected we were filtering missing key ( by using okKeys)
in expected we now look for all expected keys, and when treating a component if we don't have reports we produce a missing
So we were going through all expected reports twice so find all missing and now this is done in one go
PR updated with a new commit |
1 similar comment
PR updated with a new commit |
OK, squash merging this PR |
…clearer techniques and a better reporting
… Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
…ock and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
…ponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
…iqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
…t et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
…omponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
… fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Rename GroupComponent et UniqueComponent into Block and Value Fixes #19323: Be able to group reporting and methods so that we have clearer techniques and a better reporting
ecca3be
to
f5e8a9f
Compare
https://issues.rudder.io/issues/19323