konveyor / kantra

A CLI that unifies analysis and transformation capabilities of Konveyor
Apache License 2.0
9 stars 27 forks source link

[BUG] Custom rule is not properly picked up when there is an app in the folder #350

Open jmle opened 1 month ago

jmle commented 1 month ago

Is there an existing issue for this?

Konveyor version

0.5.3

Priority

Critical

Current Behavior

When specifying a custom rules directory in the command line with --rule, if the directory has also a folder with application data, ie the Coolstore app, the rule is not properly picked up:

.
├── ruleset.yaml
├── rule.yaml
└── test-data
    └── coolstore

If I remove the test-data directory, the rule works again.

Also, many tmp folders are created for some reason:

[...]
INFO[0001] creating temp ruleset                         name=img path=/tmp/analyze-rules-3378947653/test-data/coolstore/src/main/webapp/bower_components/patternfly/dist/img
[...]

Expected Behavior

Kantra (and/or the analyzer) should be able to search in a folder recursively for rules, ignoring everything that is not a rule, and the rule should be properly processed.

How Reproducible

Always (Default)

Steps To Reproduce

  1. Create a folder structure similar to the one specified in the "Current behavior" section. The additional rule should be correct.
  2. Analyze an application with --rules <folder> and the proper targets.
  3. See that the rule is not being picked up.

Environment

Anything else?

No response

konveyor-ci-bot[bot] commented 1 month ago

This issue is currently awaiting triage. If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance. The triage/accepted label can be added by org members.

jmle commented 1 month ago

Potentially we could ignore folders with certain names like data when recursively walking through the directories, at least once we have settled on a convention for dir names?