From 281af66ca01955e68f3b5b5adf109ab802e34efb Mon Sep 17 00:00:00 2001 From: midays Date: Sun, 18 Aug 2024 14:10:12 +0300 Subject: [PATCH 1/4] added readme file explaining the interaction between the provider and the analyzer --- docs/Analyzer and Provider Interaction.md | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/Analyzer and Provider Interaction.md diff --git a/docs/Analyzer and Provider Interaction.md b/docs/Analyzer and Provider Interaction.md new file mode 100644 index 00000000..5aa2cd40 --- /dev/null +++ b/docs/Analyzer and Provider Interaction.md @@ -0,0 +1,58 @@ +# Analyzer and Provider Interaction + +The analyzer works in tandem with the provider to effectively analyze and transform application code. Here's a detailed explanation of how this interaction typically works: + +## Provider vs Rulesets + +A ruleset is essentially a collection of rules that are used to analyze and transform code from one language to another or to adapt it to a different environment. Rulesets define the specific transformations, checks, and validations needed to handle different programming languages or frameworks. + +A provider refers to the entity or service that supplies these rulesets. Providers are tools that maintain and distribute rulesets for various languages and environments. They are responsible for ensuring that the rulesets are up-to-date, comprehensive, and accurate. Currently, the supported providers are Java, .NET, Go, Python, and Node.js. Java is fully supported, while .NET has a custom rule to assist with project analysis. Go, Python, and Node.js also require custom rules to function properly. + +## Interaction Between the Analyzer and Provider + +### Initialization + +When you run the `mta-cli` tool, it first determines the type of application and the corresponding provider needed (e.g., Java provider for a Java application). + +### Starting the Provider + +The `mta-cli` tool starts the provider in a container using a containerization tool like Docker or Podman. This containerized environment includes all necessary dependencies and tools required by the provider. + +### Code Submission + +The application’s source code or relevant parts of it are sent to the provider running in the container. This can be done by mounting volumes, copying files, or using APIs to transfer the code. + +### Execution of Rulesets + +The provider, now with access to the code, uses the analyzer to execute a series of rulesets. These rulesets are predefined sets of conditional logic checks on how to analyze the code, identify issues, suggest improvements, and possibly transform the code. + +## Detailed Workflow + +### Discovery and Analysis Initiation + +- `mta-cli` identifies the language and type of the application. +- `mta-cli` initiates the corresponding provider in a container. + +### Provider Setup + +- The container starts, providing an isolated environment. +- The provider within the container has the analyzer tool and necessary libraries pre-installed. + +### Analyzer Execution + +- The analyzer tool within the provider starts processing the code. +- The analyzer reads the code, parses it into an Abstract Syntax Tree (AST), and applies the rulesets. + +### Applying Rulesets + +- The provider applies the rulesets to the source code using the analyzer. + +### Generating Reports + +- The analyzer compiles a report based on the analysis, detailing issues found, suggestions for improvement, and any transformations made. +- This report is a single static HTML file; in the hub, the data is served dynamically to be introspective further. + +### Returning Results + +- The running provider mounts common directories that are used for input/output which in return contain the analysis report. +- `mta-cli` presents the results to the user in a readable format. From d2165d6324d51f655003bd4318cb431803d88918 Mon Sep 17 00:00:00 2001 From: midays Date: Sun, 18 Aug 2024 14:16:08 +0300 Subject: [PATCH 2/4] made bold words --- docs/Analyzer and Provider Interaction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Analyzer and Provider Interaction.md b/docs/Analyzer and Provider Interaction.md index 5aa2cd40..0e00de30 100644 --- a/docs/Analyzer and Provider Interaction.md +++ b/docs/Analyzer and Provider Interaction.md @@ -4,9 +4,9 @@ The analyzer works in tandem with the provider to effectively analyze and transf ## Provider vs Rulesets -A ruleset is essentially a collection of rules that are used to analyze and transform code from one language to another or to adapt it to a different environment. Rulesets define the specific transformations, checks, and validations needed to handle different programming languages or frameworks. +A **ruleset** is essentially a collection of rules that are used to analyze and transform code from one language to another or to adapt it to a different environment. Rulesets define the specific transformations, checks, and validations needed to handle different programming languages or frameworks. -A provider refers to the entity or service that supplies these rulesets. Providers are tools that maintain and distribute rulesets for various languages and environments. They are responsible for ensuring that the rulesets are up-to-date, comprehensive, and accurate. Currently, the supported providers are Java, .NET, Go, Python, and Node.js. Java is fully supported, while .NET has a custom rule to assist with project analysis. Go, Python, and Node.js also require custom rules to function properly. +A **provider** refers to the entity or service that supplies these rulesets. Providers are tools that maintain and distribute rulesets for various languages and environments. They are responsible for ensuring that the rulesets are up-to-date, comprehensive, and accurate. Currently, the supported providers are Java, .NET, Go, Python, and Node.js. Java is fully supported, while .NET has a custom rule to assist with project analysis. Go, Python, and Node.js also require custom rules to function properly. ## Interaction Between the Analyzer and Provider From c581503d0208cdcfeb6f152ce070af6bd865decf Mon Sep 17 00:00:00 2001 From: midays Date: Sun, 18 Aug 2024 14:20:21 +0300 Subject: [PATCH 3/4] made more adjustments Signed-off-by: midays --- docs/Analyzer and Provider Interaction.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/Analyzer and Provider Interaction.md b/docs/Analyzer and Provider Interaction.md index 0e00de30..b91f219f 100644 --- a/docs/Analyzer and Provider Interaction.md +++ b/docs/Analyzer and Provider Interaction.md @@ -6,7 +6,9 @@ The analyzer works in tandem with the provider to effectively analyze and transf A **ruleset** is essentially a collection of rules that are used to analyze and transform code from one language to another or to adapt it to a different environment. Rulesets define the specific transformations, checks, and validations needed to handle different programming languages or frameworks. -A **provider** refers to the entity or service that supplies these rulesets. Providers are tools that maintain and distribute rulesets for various languages and environments. They are responsible for ensuring that the rulesets are up-to-date, comprehensive, and accurate. Currently, the supported providers are Java, .NET, Go, Python, and Node.js. Java is fully supported, while .NET has a custom rule to assist with project analysis. Go, Python, and Node.js also require custom rules to function properly. +A **provider** refers to the entity or service that supplies these rulesets. Providers are tools that maintain and distribute rulesets for various languages and environments. They are responsible for ensuring that the rulesets are up-to-date, comprehensive, and accurate. + +* Currently, the supported providers are Java, .NET, Go, Python, and Node.js. Java is fully supported, while .NET has a custom rule to assist with project analysis. Go, Python, and Node.js also require custom rules to function properly. ## Interaction Between the Analyzer and Provider @@ -28,31 +30,31 @@ The provider, now with access to the code, uses the analyzer to execute a series ## Detailed Workflow -### Discovery and Analysis Initiation +### 1. Discovery and Analysis Initiation - `mta-cli` identifies the language and type of the application. - `mta-cli` initiates the corresponding provider in a container. -### Provider Setup +### 2. Provider Setup - The container starts, providing an isolated environment. - The provider within the container has the analyzer tool and necessary libraries pre-installed. -### Analyzer Execution +### 3. Analyzer Execution - The analyzer tool within the provider starts processing the code. - The analyzer reads the code, parses it into an Abstract Syntax Tree (AST), and applies the rulesets. -### Applying Rulesets +### 4. Applying Rulesets - The provider applies the rulesets to the source code using the analyzer. -### Generating Reports +### 5. Generating Reports - The analyzer compiles a report based on the analysis, detailing issues found, suggestions for improvement, and any transformations made. - This report is a single static HTML file; in the hub, the data is served dynamically to be introspective further. -### Returning Results +### 6. Returning Results - The running provider mounts common directories that are used for input/output which in return contain the analysis report. - `mta-cli` presents the results to the user in a readable format. From 78c05dcd545466e1e421221a91d3694caf9394ea Mon Sep 17 00:00:00 2001 From: midays Date: Sun, 18 Aug 2024 14:22:00 +0300 Subject: [PATCH 4/4] Changed file name Signed-off-by: midays --- ...d Provider Interaction.md => Analyzer_Provider_Interaction.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{Analyzer and Provider Interaction.md => Analyzer_Provider_Interaction.md} (100%) diff --git a/docs/Analyzer and Provider Interaction.md b/docs/Analyzer_Provider_Interaction.md similarity index 100% rename from docs/Analyzer and Provider Interaction.md rename to docs/Analyzer_Provider_Interaction.md