-
Notifications
You must be signed in to change notification settings - Fork 8
MTA-6826, 6827, 6828, 6829, 6830, 6831 CQA April work for rules development guide #359
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,8 @@ | ||
| :_newdoc-version: 2.18.3 | ||
| :_template-generated: 2025-05-28 | ||
|
|
||
| ifdef::context[:parent-context-of-java-conditions-capabilities: {context}] | ||
|
|
||
| :_mod-docs-content-type: ASSEMBLY | ||
|
|
||
| ifdef::context[:parent-context-of-java-conditions-capabilities: {context}] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not entirely sure what we are trying to achieve with this change, could you elaborate on it please Furthermore, the ifdef syntax with 2 statements seems complex. Typically we'd use ifdef if an assembly is re-used, however I don't think any of the assemblies in this PR are re-used right now? Could we review all this ifdef syntax for all of assemblies and asses if it could be simplified or removed? This could help with the unclosed parent context issue.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your comment. I'm sorry but the CQA and DITA runs did not catch any unclosed parent context issue. I think the |
||
| ifndef::context[] | ||
| [id="java-conditions-capabilities"] | ||
| endif::[] | ||
|
|
@@ -16,13 +14,8 @@ endif::[] | |
| :context: java-conditions-capabilities | ||
|
|
||
| [role="_abstract"] | ||
|
Pkylas007 marked this conversation as resolved.
|
||
| The `java.referenced` capability in the when condition for Java rules can define search queries for the following fields in the source code: | ||
|
|
||
| * Locations - such as the classes, methods, packages and so on | ||
| * Annotations | ||
| * Patterns | ||
| As an Architect, you can create custom rules to analyze the `Java` source code for problematic patterns before migration. The `Java` provider uses Eclipse Java Development Tools Language Server (JDTLS) that depends on the Eclipse Java Development Toolkit for utilities to search the source code. | ||
|
|
||
| You can refer to this section for a detailed explanation on the Locations, Annotations, and Patterns. | ||
|
|
||
| include::topics/rules-development/yaml-java-locations.adoc[leveloffset=+1] | ||
|
|
||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Outside of scope suggestions but a must before migration to AEM:
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,13 +16,7 @@ endif::[] | |||||
| :context: rule-yaml-metadata | ||||||
|
|
||||||
| [role="_abstract"] | ||||||
| The rule metadata contains information about the migration defined by the Architect. You can use rule metadata to: | ||||||
|
|
||||||
| * 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 used by {ProductShortName} to filter rules for an analysis. | ||||||
|
|
||||||
| As an Architect, you include information about effort in the rule metadata. Effort is a numerical value that accounts for the complexity in resolving the issue described in the rule. In the metadata, you can add category and label that guides Migrators when they resolve issues in the code. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I believe it should be "that guide" since we are talking about category and label? |
||||||
|
|
||||||
| include::topics/rules-development/yaml-rule-metadata.adoc[leveloffset=+1] | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,13 +16,13 @@ endif::[] | |||||
| :context: rules-introduction | ||||||
|
|
||||||
| [role="_abstract"] | ||||||
| This guide is intended for software engineers who want to create custom YAML-based rules for {ProductName} ({ProductShortName}) tools. | ||||||
| As an Architect, see the following sections to understand rules and rule syntax so that, you can create custom YAML-based rules for {ProductName} ({ProductShortName}) tools. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we can further refine this short description to set expectations for users. How about something like this?
Suggested change
|
||||||
|
|
||||||
| include::topics/rules-development/about-rules.adoc[leveloffset=+1] | ||||||
|
|
||||||
| include::topics/rules-development/yaml-rule-structure-syntax.adoc[leveloffset=+1] | ||||||
|
|
||||||
| ifdef::parent-context-of-getting-started[:context: {parent-context-of-rules-introduction}] | ||||||
| ifndef::parent-context-of-getting-started[:!context:] | ||||||
| ifdef::parent-context-of-rules-introduction[:context: {parent-context-of-rules-introduction}] | ||||||
| ifndef::parent-context-of-rules-introduction[:!context:] | ||||||
|
|
||||||
| :!rules-introduction: | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,27 +11,18 @@ include::topics/templates/document-attributes.adoc[] | |
| [id="rules-development-guide"] | ||
| = Configuring and using rules for an {ProductShortName} analysis | ||
|
|
||
|
|
||
| //Inclusive language statement | ||
| include::topics/making-open-source-more-inclusive.adoc[] | ||
|
|
||
| include::assemblies/rules-development-guide/assembly_rules-introduction.adoc[leveloffset=+1] | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was under assumption blank lines between includes are a must? |
||
| include::assemblies/rules-development-guide/assembly_rule-yaml-metadata.adoc[leveloffset=+1] | ||
|
|
||
| include::assemblies/rules-development-guide/assembly_rule-yaml-conditions.adoc[leveloffset=+1] | ||
|
|
||
| include::assemblies/rules-development-guide/assembly_java-conditions-detailed.adoc[leveloffset=+1] | ||
|
|
||
| include::assemblies/rules-development-guide/assembly_logical-chaining-custom-variables.adoc[leveloffset=+1] | ||
|
|
||
| include::assemblies/rules-development-guide/assembly_rule-yaml-actions.adoc[leveloffset=+1] | ||
|
|
||
| include::assemblies/rules-development-guide/assembly_creating-rule.adoc[leveloffset=+1] | ||
|
|
||
| include::assemblies/rules-development-guide/assembly_rule-rulesets.adoc[leveloffset=+1] | ||
|
|
||
|
|
||
| [id="_additional-resources"] | ||
| == Additional resources | ||
|
|
||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here and throughout the whole doc set: Rule sets spelling should be revisited.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, but this is not a spelling issue? :) rule sets/rulesets both have correct spelling but they are formatted differently. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,29 +8,27 @@ | |||||
| = The {ProductShortName} rules | ||||||
|
|
||||||
| [role="_abstract"] | ||||||
| The {ProductFullName} contains the analyzer that uses pluggable providers and rules to analyze static code, dependencies, and other files in your application. | ||||||
| {ProductFullName} analyzes the application source code to find issues based on user-generated rule and default rule definitions. You can fix issues in an analysis report before migrating the code to a target platform. You can view the rule syntax information to create a new rule or a ruleset. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
'user-generated' and 'default' modify the same plural noun. |
||||||
|
|
||||||
| The analyzer works with providers to detect issues that cause problems when you migrate the application to target technologies. The rule definition contains metadata description and condition patterns that describe a violation. | ||||||
| A ruleset is a collection of one or more rules. An Architect can create rulesets to organize one or more rules that analyze the source code for a specific target platform. | ||||||
|
|
||||||
| The analyzer runs a search query on the source code to match the violation described in the rule definition. The rule definition also contains a message that MTA displays when triggering an issue because of the violation. The analyzer uses default and user-provided (custom) rules during an analysis to identify issues. | ||||||
| You can use rules or rulesets as input arguments in an analysis. You can perform a rule-based analysis in the {ProductShortName} CLI, user interface, or by using one of the IDE plugins for {ProductShortName} (Visual Studio Code or IntelliJ). | ||||||
|
|
||||||
| [NOTE] | ||||||
| ==== | ||||||
| An {ProductShortName} Architect can create custom rules. You can use custom rules to identify the use of custom libraries or other components in the source code that might not be covered by the standard migration rules. | ||||||
| ==== | ||||||
| {mta-dl-plugin} uses rules to generate AI-assisted code resolutions. {mta-dl-plugin} uses the issue description and metadata in rules to form well-defined contexts. These contexts generate AI-assisted suggestions to resolve issues in the code that {ProductShortName} identified through an analysis. | ||||||
|
|
||||||
| A collection of one or more rules is called a ruleset. Creating rulesets provides a way of organizing multiple rules that analyze the source code for a specific target platform. | ||||||
| == How {ProductShortName} performs an analysis | ||||||
|
|
||||||
| You can use rules or rulesets as input arguments in an analysis. You can perform a rule-based analysis in the {ProductShortName} CLI, user interface, or by using one of the IDE plugins for {ProductShortName} (Visual Studio Code or IntelliJ). | ||||||
| {ProductFirstRef} contains the analyzer that uses pluggable providers and rules to analyze static code, dependencies, and other files in your application. | ||||||
|
|
||||||
| The rules can be used by {mta-dl-plugin} to generate AI-assisted code resolutions. The issue description and metadata in rules are used by the {mta-dl-plugin} to form well-defined contexts. These contexts generate AI-assisted suggestions to resolve issues in the code that are identified through an analysis. | ||||||
| The analyzer works with providers to detect issues that cause problems when you migrate the application to target technologies. The rule definition contains metadata description and condition patterns that describe a violation. | ||||||
|
|
||||||
| The analyzer runs a search query on the source code to match the violation described in the rule definition. The rule definition also contains a message that {ProductShortName} displays when triggering an issue because of the violation. The analyzer uses default and user-provided (custom) rules during an analysis to identify issues. | ||||||
|
|
||||||
|
|
||||||
| ifndef::rules-development-guide[] | ||||||
| For instructions on how to write custom rules, see [_{RulesDevBookName}_]. | ||||||
| endif::rules-development-guide[] | ||||||
|
|
||||||
|
|
||||||
| [role="_additional-resources"] | ||||||
| .Additional resources | ||||||
| * link:https://docs.redhat.com/en/documentation/migration_toolkit_for_applications/8.0/html/configuring_and_using_red_hat_developer_lightspeed_for_mta/index[Configuring and using Red Hat Developer Lightspeed for MTA] | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| :_newdoc-version: 2.18.7 | ||
| :_template-generated: 2026-03-27 | ||
| :_mod-docs-content-type: CONCEPT | ||
|
|
||
| [id="external-providers_{context}"] | ||
| = Provider capabilities in custom rules | ||
|
|
||
| [role="_abstract"] | ||
| The external providers, except `C#`, use the Language Server Protocol (LSP) server to perform an analysis. The provider forms a search query and sends it to the LSP server to check against the application. When the LSP server returns a match for the search in the source code, the analyzer triggers a violation. | ||
|
|
||
| Currently, {ProductShortName} supports the following providers: | ||
|
|
||
| * `builtin` | ||
| * `Java` | ||
| * `C#` | ||
| * External providers (for `Python`, `Go`, and `Node.js` applications) initialized by the generic provider binary | ||
|
|
||
| [NOTE] | ||
| ==== | ||
| You can use the generic provider binary to create an external provider for any language that is compliant with LSP specifications. | ||
| ==== | ||
|
|
||
| .Additional resources | ||
|
|
||
| * link:https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/[LSP 3.17 specifications] | ||
|
|
This file was deleted.
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.
Outside of scope suggestions for this and other files but must before migration to AEM: