Uploaded image for project: 'Migration Toolkit for Applications'
  1. Migration Toolkit for Applications
  2. MTA-4629

CLI doesn't allow custom targets

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Critical Critical
    • MTA 7.2.2
    • MTA 7.2.0
    • MTA CLI
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • False
    • Critical
    • None

      The CLI doesn't allow passing targets that don't come out of the box with the tool (available via --list-targets. That means that the following will fail even if the custom rules file contains rules for custom-target:

      kantra analyze --input app.ear --output ./reports --target custom-target  --rules rules-with-custom-target.yaml
      

      The only way to get the CLI to execute custom rules with custom targets is by completely removing the -target flag and using the -rules flag to point to a rules file:

      kantra analyze --input app.ear --output ./reports  --rules rules-with-multiple-custom-targets.yaml
      

      In a rules file with multiple custom targets, this would mean that the user would have to execute them all and would not be allowed to select which ones should be picked up.

      It gets even more difficult when combining rules that come out of the box with the tool with custom rules:

      kantra analyze --input app.ear --output ./reports --target quarkus  --rules rules-with-custom-target.yaml
      

      The previous command would include the quarkus rules that come out of the box with the tool, and only those rules from the rules file that have that target, ignoring the rest. This makes it impossible to combine builtin targets with custom targets.

      The required behavior, as we previously had in the MTA 6 CLI, should allow the user to configure custom targets using the --target flag with the following conditions:

      • If no --rules flag is passed, the command should fail stating that the target is not available.
      • If at least one --rules flag is passed, the analyzer should check if the custom target exists in any of the rules files being passed as parameters. If it does exist, only rules with that target should be executed. If it doesn't, it should fail stating that the custom target doesn't exist in the custom rules being passed as parameters.
      kantra analyze --input app.ear --output ./reports --target quarkus --target custom-target  --rules rules-with-custom-target.yaml
      

      The previous command should execute all quarkus rules that come out of the box, all rules with the quarkus target in the custom rules, and all rules with the custom-target target included in the custom rules as well.

              emcmulla@redhat.com Emily McMullan
              rromanni@redhat.com Ramon Roman Nissen
              Igor Braginsky Igor Braginsky
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: