Skip to content

Conversation

@Pkylas007
Copy link
Collaborator

JIRA

Version

  • 8.0.0

Preview

What changed

  • Changed the user guide title to Configuring and using rules for MTA analysis.
  • Introducing assemblies for all sections and introductions in assemblies.
  • Introduced new modules for nested conditions, custom Go rule, custom Python rule, and custom Node.js rule.
  • Rewrote the introduction in some of the assemblies and provided internal links to target modules.
  • Provided examples for Java locations and provider capability fields.

@Pkylas007 Pkylas007 force-pushed the mta-5290-rules-modularization branch from d1b70a7 to 9d3e214 Compare December 15, 2025 10:52
Copy link
Collaborator

@ibragins ibragins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Pkylas007 Pkylas007 changed the title MTA-5290 First commit of Rules Development Modularization Work MTA-5290 Rules Development Modularization Work Jan 9, 2026
@Pkylas007 Pkylas007 requested a review from jmle January 12, 2026 06:53
@Pkylas007 Pkylas007 force-pushed the mta-5290-rules-modularization branch from 06a9acb to 9613c25 Compare January 12, 2026 06:58
Comment on lines 63 to 72
For instance, looking for a method named `method` declared on
`org.konveyor.MyClass` that returns a `List` of a type that extends
`java.lang.String` and accepts a single parameter:

[source,yaml]
----
java.referenced:
location: METHOD
pattern: 'org.konveyor.Myclass.method(*) java.util.List<? extends java.lang.String>'
----
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to change this whole paragraph to what I said in the coment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, reversed the error while modifying the example. Please check again.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that this example is not METHOD_CALL or CONSTRUCTOR_CALL, but just METHOD (which looks for method declarations, not calls). I can't remember now what I said in the earlier comment because it has disappeared for some reason. We need here a METHOD_CALL example, I think I have provided you one somewhere else? We can move this example to the METHOD section

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok, understood. I have removed these descriptions of method_call and constructor_call in the introduction. These locations are explained with examples in the following table.

It's an old introduction and I think it can be modified to be more relevant later.

pattern: javax.xml.*
----
+
[WARNING]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmle Could you let me know if this warning here is correct? If not, I can remove it. It says dot must not be placed after the javax.xml package.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this for the moment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, thanks!

@Pkylas007 Pkylas007 requested a review from jmle January 13, 2026 08:04
@Pkylas007 Pkylas007 requested a review from anarnold97 January 13, 2026 11:16
Comment on lines 33 to 34
`annotated` :: Checks for specific annotations and their elements, such as name and value, in the Java code using a query. For example, the following query matches the `Bean` (url = “http://www.example.com”) annotation in the method.
+
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

formatting?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected it, thanks!


`labels` :: List of string labels for the rule.
`effort` :: Number of expected story points to fix this issue.
`links` :: One or more hyperlinks pointing to documentation around the migration issues that you find.+
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

formatting

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected, thanks!

* Estimate the total migration effort
* Prioritize issues that must be resolved based on the effort
* Evaluate if a resolution is mandatory through rule category before migrating the applications to the target technologies or platforms
* Define labels for which {ProductShortName} filters rules to trigger a violation.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Define labels for which {ProductShortName} filters rules to trigger a violation.
* Define labels for which {ProductShortName} filter rules trigger a violation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified the sentence, thanks!

*ruleID* :: This is a unique ID for the rule. It must be unique within the ruleset.
*labels* :: A list of string labels associated with the rule. (See xref:yaml-rule-labels_rule-yaml-metadata[Labels]).
*effort* :: Effort is an integer value that indicates the level of effort needed to resolve this issue.
*category* :: Category describes severity of the issue for migration. Values can be one of `mandatory`, `potential` or `optional`. For more details, see xref:yaml-rule-categories_rule-yaml-metadata[Rule categories].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*category* :: Category describes severity of the issue for migration. Values can be one of `mandatory`, `potential` or `optional`. For more details, see xref:yaml-rule-categories_rule-yaml-metadata[Rule categories].
*category* :: Category describes the severity of the issue for migration. Values can be one of `mandatory`, `potential` or `optional`. For more details, see xref:yaml-rule-categories_rule-yaml-metadata[Rule categories].

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the article, thanks!


.Using the provider capability in custom rules

In a rule, the when block is where the conditions for matching the rule are specified. Each provider offers a series of capabilities to do matching.. The search query in the rule condition can contain patterns, code locations, specific dependencies to be found, etc, to evaluate the source code and dependencies. The provider sends the LSP server a request to check the search query against the application being analyzed. When the LSP server returns a match for the search in the source code, the analyzer triggers a violation.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In a rule, the when block is where the conditions for matching the rule are specified. Each provider offers a series of capabilities to do matching.. The search query in the rule condition can contain patterns, code locations, specific dependencies to be found, etc, to evaluate the source code and dependencies. The provider sends the LSP server a request to check the search query against the application being analyzed. When the LSP server returns a match for the search in the source code, the analyzer triggers a violation.
In a rule, the when block is where the conditions for matching the rule are specified. Each provider offers a series of capabilities to do matching.. The search query in the rule condition can contain patterns, code locations, specific dependencies to be found, and so on, to evaluate the source code and dependencies. The provider sends the LSP server a request to check the search query against the application being analyzed. When the LSP server returns a match for the search in the source code, the analyzer triggers a violation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced etc, thanks!

|Location |Description |Rule condition example

|TYPE|Matches against all types including classes, interfaces, enum, and annotation types that appear anywhere.
a|The following example looks for occurences of `java.util.List`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
a|The following example looks for occurences of `java.util.List`.
a|The following example looks for occurrences of `java.util.List`.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected the spelling, thanks!

location: PACKAGE
----

would match on each of the following import and the FQN usage:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
would match on each of the following import and the FQN usage:
would match on each of the following imports and the FQN usage:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected, thanks!

|===
|Location |Description |Rule condition example

|TYPE|Matches against all types including classes, interfaces, enum, and annotation types that appear anywhere.
Copy link
Collaborator

@anarnold97 anarnold97 Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
|TYPE|Matches against all types including classes, interfaces, enum, and annotation types that appear anywhere.
|TYPE|Matches against all types, including classes, interfaces, enums, and annotation types that appear anywhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the change, thanks!

|FIELD|Matches against a type appearing in a field
declaration. It can be coupled with an annotation match happening on the field. See
xref:yaml-annotation-inspection_java-conditions-capabilities[Annotation inspection]
a|The following example searches if `QueueConnectionFactory` appears in a field declaration and is used to obtain connection to JMS queues. Replace the string `QueueConnectionFactory` with `ConnectionFactory`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
a|The following example searches if `QueueConnectionFactory` appears in a field declaration and is used to obtain connection to JMS queues. Replace the string `QueueConnectionFactory` with `ConnectionFactory`.
a|The following example searches if `QueueConnectionFactory` appears in a field declaration and is used to obtain a connection to JMS queues. Replace the string `QueueConnectionFactory` with `ConnectionFactory`.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the article, thanks!

Comment on lines 146 to 148
|CLASS (declaration)|Matches against a given method declaration. Can
be coupled with an annotation match. See
xref:yaml-annotation-inspection_java-conditions-capabilities[Annotation inspection].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
|CLASS (declaration)|Matches against a given method declaration. Can
be coupled with an annotation match. See
xref:yaml-annotation-inspection_java-conditions-capabilities[Annotation inspection].
|CLASS (declaration)|Matches against a given method declaration. It can be coupled with an annotation match. See xref:yaml-annotation-inspection_java-conditions-capabilities[Annotation inspection].

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed extra spaces, thanks!

pattern: java.io.FileOutputStream(java.lang.String, boolean)
----
|IMPORT|Matches against class imports. You can use it with FQNs or an asterisk (*) to allow for wider matches.
a|The following example matches with the import of `org.apache.lucene.search` package and sub packages in the source code.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
a|The following example matches with the import of `org.apache.lucene.search` package and sub packages in the source code.
a|The following example matches with the import of `org.apache.lucene.search` package and subpackages in the source code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined the word, thanks!

value: a Java regular expression to match the value of the element
----

It is also possible to match an annotation with specific elements, without having to specify the symbol it annotates. The following example would also match on the `@Bean` annotation in the same code as the previous example:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It is also possible to match an annotation with specific elements, without having to specify the symbol it annotates. The following example would also match on the `@Bean` annotation in the same code as the previous example:
It is also possible to match an annotation with specific elements without having to specify the symbol it annotates. The following example would also match on the `@Bean` annotation in the same code as the previous example:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the comma, thanks!

[role="_abstract"]
The `or` condition performs a logical OR operation on the results of an array of conditions.

The `or` condition matches when _any_ of its child conditions matches, for example:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `or` condition matches when _any_ of its child conditions matches, for example:
The `or` condition matches when _any_ of its child conditions match, for example:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected the error, thanks!

= Chaining in the Java provider

[role="_abstract"]
In the `java` provider, the `filepaths` variable must be uppercased. for example:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the `java` provider, the `filepaths` variable must be uppercased. for example:
In the `java` provider, the `filepaths` variable must be uppercased, for example:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced the period with a comma, thanks!

= Hyperlinks

[role="_abstract"]
Hyperlinks can be provided along with a `message` or `tag` action to provide relevant information about the issue, which has been discovered:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Hyperlinks can be provided along with a `message` or `tag` action to provide relevant information about the issue, which has been discovered:
Hyperlinks can be provided along with a `message` or `tag` action to provide relevant information about the issue that has been discovered:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced which with that, thanks!

----
# links point to external hyperlinks
# rule authors are expected to provide
# relevant hyperlinks for quick fixes, docs and so on.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# relevant hyperlinks for quick fixes, docs and so on.
# relevant hyperlinks for quick fixes, docs, and so on.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the comma, thanks!

----

`labels` :: List of string labels for the rule.
`effort` :: Number of expected story points to fix this issue.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`effort` :: Number of expected story points to fix this issue.
`effort` :: Number of expected story points to resolve this issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced fix with resolve, thanks!

= Creating a custom Node.js rule

[role="_abstract"]
You must create custom rules to analyze `Node.js` applications by using {ProductShortName}. A `Node.js` rule can contain the `nodejs.referenced` capability which supports the `pattern` field.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You must create custom rules to analyze `Node.js` applications by using {ProductShortName}. A `Node.js` rule can contain the `nodejs.referenced` capability which supports the `pattern` field.
You must create custom rules to analyze `Node.js` applications by using {ProductShortName}. A `Node.js` rule can contain the `nodejs.referenced` capability that supports the `pattern` field.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced which with that, thanks!

Copy link
Collaborator

@anarnold97 anarnold97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small issues, nothing major

Feel free to merge once you have dealt with these issues

@Pkylas007 Pkylas007 force-pushed the mta-5290-rules-modularization branch from 2874bed to b108dcc Compare January 15, 2026 06:19
@Pkylas007
Copy link
Collaborator Author

Some small issues, nothing major

Feel free to merge once you have dealt with these issues

Thank you for the corrections! I have updated the suggested changes in the document.

Signed-off-by: Prabha Kylasamiyer Sundara Rajan <pkylasam@pkylasam-thinkpadp16vgen1.bengluru.csb>
@Pkylas007 Pkylas007 force-pushed the mta-5290-rules-modularization branch from 5007009 to 84f500c Compare January 15, 2026 06:46
@Pkylas007 Pkylas007 merged commit cf04b97 into migtools:main Jan 15, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants