-
Notifications
You must be signed in to change notification settings - Fork 43
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
🐛 Analysis - Update the TaskGroup to id selected rulesets #2034
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2034 +/- ##
==========================================
+ Coverage 39.20% 42.37% +3.17%
==========================================
Files 146 172 +26
Lines 4857 5520 +663
Branches 1164 1360 +196
==========================================
+ Hits 1904 2339 +435
- Misses 2939 3065 +126
- Partials 14 116 +102
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
https://issues.redhat.com/browse/MTA-3330 A custom target that references a repository will be created with a related `RuleSet`. A repository may be defined on the ruleSet. An analysis task defines _included_ labels which determine which rulesets are pulled (downloaded) from the hub. Since ruleSets that reference repositories do not have labels, the addon did not know to download it and clone the repository. Solution: The new rules.ruleSets will be used to pass a list of RuleSet (refs) selected by the user (by selecting targets). Each will be be unconditionally fetched by the addon. For each ruleset with a repository the addon will: - clone the repository - update .yaml files - replacing the `labels` element with `konveyor.io/include=always`. related: konveyor/tackle2-ui#2034 --------- Signed-off-by: Jeff Ortel <[email protected]>
https://issues.redhat.com/browse/MTA-3330 A custom target that references a repository will be created with a related `RuleSet`. A repository may be defined on the ruleSet. An analysis task defines _included_ labels which determine which rulesets are pulled (downloaded) from the hub. Since ruleSets that reference repositories do not have labels, the addon did not know to download it and clone the repository. Solution: The new rules.ruleSets will be used to pass a list of RuleSet (refs) selected by the user (by selecting targets). Each will be be unconditionally fetched by the addon. For each ruleset with a repository the addon will: - clone the repository - update .yaml files - replacing the `labels` element with `konveyor.io/include=always`. related: konveyor/tackle2-ui#2034 --------- Signed-off-by: Jeff Ortel <[email protected]> Signed-off-by: Cherry Picker <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
Targets getting selected will add labels. The set of labels isn't visible until the options step. On that step the labels can be changed. When the labels change, the new set of labels need to be mapped back to the targets. The mapping code needs to: - Keep the correct set of target cards selected as per the current set of selected target labels - Keep targets selected that lack any labels (currently only custom source repository targets have no labels) Signed-off-by: Scott J Dickerson <[email protected]>
d478e86
to
ed417ab
Compare
https://issues.redhat.com/browse/MTA-3330 A custom target that references a repository will be created with a related `RuleSet`. A repository may be defined on the ruleSet. An analysis task defines _included_ labels which determine which rulesets are pulled (downloaded) from the hub. Since ruleSets that reference repositories do not have labels, the addon did not know to download it and clone the repository. Solution: The new rules.ruleSets will be used to pass a list of RuleSet (refs) selected by the user (by selecting targets). Each will be be unconditionally fetched by the addon. For each ruleset with a repository the addon will: - clone the repository - update .yaml files - replacing the `labels` element with `konveyor.io/include=always`. related: konveyor/tackle2-ui#2034 --------- Signed-off-by: Jeff Ortel <[email protected]> Signed-off-by: Cherry Picker <[email protected]> Signed-off-by: Jeff Ortel <[email protected]> Signed-off-by: Cherry Picker <[email protected]> Co-authored-by: Jeff Ortel <[email protected]>
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 OK! Standard analysis works fine.
const ruleSetRefsFromSelectedTargets: Ref[] = fieldValues.selectedTargets | ||
.map(({ ruleset }) => ruleset) | ||
.filter(Boolean) | ||
.map<Ref>(({ id, name }) => ({ id: id ?? 0, name: name ?? "" })); |
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 zero ID be used by some existing rule set? if yes then I would go with safer value.
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.
Nope. Ids start at 1.
} | ||
const updatedFormLabels = !matchingLabel | ||
? formLabels | ||
: toggle(formLabels, matchingLabel, (tl) => tl.label); |
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.
nice!
Supports: https://issues.redhat.com/browse/MTA-3330 The way custom targets are handled by the analysis wizard has been updated. There are no visual changes. At analysis start time, a `Taskgroup` is submitted containing all of the user's choices. To better support custom targets, the `ruleSet` of any selected custom targets will no be submitted as part of the `Taskgroup.TaskData.rules`. Identifying the `ruleSet` will allow the custom target's rules to be enabled in analysis. In support of this change: - The wizard's form data now stores a `Target[]` instead of a `number[]` to make working with the selected targets more convenient across the wizard components. - Any code working with just the `targetId` has been updated to use the full `Target` object - The handlers for changes to the target labels on the wizard's options step better handle mapping the selected label changes to target card selection --------- Signed-off-by: Scott J Dickerson <[email protected]> Signed-off-by: Cherry Picker <[email protected]>
…ed rulesets (#2034) (#2042) Backport-of: #2034 Supports: https://issues.redhat.com/browse/MTA-3330 The way custom targets are handled by the analysis wizard has been updated. There are no visual changes. At analysis start time, a `Taskgroup` is submitted containing all of the user's choices. To better support custom targets, the `ruleSet` of any selected custom targets will no be submitted as part of the `Taskgroup.TaskData.rules`. Identifying the `ruleSet` will allow the custom target's rules to be enabled in analysis. In support of this change: - The wizard's form data now stores a `Target[]` instead of a `number[]` to make working with the selected targets more convenient across the wizard components. - Any code working with just the `targetId` has been updated to use the full `Target` object - The handlers for changes to the target labels on the wizard's options step better handle mapping the selected label changes to target card selection --------- Signed-off-by: Scott J Dickerson <[email protected]> Signed-off-by: Cherry Picker <[email protected]>
Supports: https://issues.redhat.com/browse/MTA-3330
The way custom targets are handled by the analysis wizard has been updated. There are no visual changes.
At analysis start time, a
Taskgroup
is submitted containing all of the user's choices. To better support custom targets, theruleSet
of any selected custom targets will no be submitted as part of theTaskgroup.TaskData.rules
. Identifying theruleSet
will allow the custom target's rules to be enabled in analysis.In support of this change:
Target[]
instead of anumber[]
to make working with the selected targets more convenient across the wizard components.targetId
has been updated to use the fullTarget
object