Skip to content

Update package versions and add CLI option validations#4151

Merged
amitamir merged 5 commits into
masterfrom
Feature/CLI_Support_API_Option_For_Dynamic_Arg
Mar 31, 2025
Merged

Update package versions and add CLI option validations#4151
amitamir merged 5 commits into
masterfrom
Feature/CLI_Support_API_Option_For_Dynamic_Arg

Conversation

@amitamir

@amitamir amitamir commented Mar 30, 2025

Copy link
Copy Markdown
Contributor

Updated project files to use Ginger.ExecuterService.Contracts v25.2.1. Added System.IO namespace and temp folder logic in CLIDynamicFile.cs. Introduced HandleDynamicOptions method in CLIProcessor.cs. Refactored HandleFileOptions method in CLIProcessor.cs. Implemented IOptionValidation in DoOptions and DynamicOptions. Added UseTempFolder and Url options with validation logic. Introduced IOptionValidation interface for CLI options validation.

Thank you for your contribution.
Before submitting this PR, please make sure:

  • PR description and commit message should describe the changes done in this PR
  • Verify the PR is pointing to correct branch i.e. Release or Beta branch if the code fix is for specific release , else point it to master
  • Latest Code from master or specific release branch is merged to your branch
  • No unwanted\commented\junk code is included
  • No new warning upon build solution
  • Code Summary\Comments are added to my code which explains what my code is doing
  • Existing unit test cases are passed
  • New Unit tests are added for your development
  • Sanity Tests are successfully executed for New and Existing Functionality
  • Verify that changes are compatible with all relevant browsers and platforms.
  • After creating pull request there should not be any conflicts
  • Resolve all Codacy comments
  • Builds and checks are passed before PR is sent for review
  • Resolve code review comments
  • Update the Help Library document to match any feature changes

Summary by CodeRabbit

  • New Features

    • Enhanced command-line processing with support for URL-based configuration retrieval and improved validation for mutually exclusive options.
    • Added functionality to use a temporary folder for local solution paths based on source control context.
    • Introduced a new method for constructing temporary folder paths based on repository names.
  • Chores

    • Upgraded a core dependency package across multiple components to leverage new improvements and fixes.

Updated project files to use Ginger.ExecuterService.Contracts v25.2.1.
Added System.IO namespace and temp folder logic in CLIDynamicFile.cs.
Introduced HandleDynamicOptions method in CLIProcessor.cs.
Refactored HandleFileOptions method in CLIProcessor.cs.
Implemented IOptionValidation in DoOptions and DynamicOptions.
Added UseTempFolder and Url options with validation logic.
Introduced IOptionValidation interface for CLI options validation.
@amitamir
amitamir requested a review from MeniKadosh1 March 30, 2025 13:47
@coderabbitai

coderabbitai Bot commented Mar 30, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes include upgrading the version of the Ginger.ExecuterService.Contracts package from 24.5.4 to 25.2.1 in several project files. New functionality has been added to support dynamic command line options, including conditional logic for handling temporary folders in configuration loading, and new methods for processing CLI options, such as handling URL inputs. Additionally, classes have been updated to validate options through a new IOptionValidation interface.

Changes

File(s) Change Summary
Ginger/Ginger/Ginger.csproj, Ginger/GingerCoreNET/GingerCoreNET.csproj, Ginger/GingerRuntime/GingerRuntime.csproj, Ginger/GingerCoreNETUnitTest/GingerCoreNETUnitTest.csproj Updated PackageReference Ginger.ExecuterService.Contracts from version 24.5.4 to 25.2.1.
Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs Added a conditional block in LoadGeneralConfigurations to set a temporary solution path based on the source control URL when UseTempFolder is true.
Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs Added new methods: HandleDynamicOptions, HandleUrlOptions, and ProcessExecConfigsAndExecute; adjusted HandleFileOptions to use the centralized execution method.
Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs Modified class signature to implement IOptionValidation; added properties UseTempSolutionFolder and ExecutionConfigurationSourceUrl along with a new Validate method enforcing option constraints.
Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs Introduced conditional logic in RunAsync to set the solution path using the new SetSolutionPathToTempFolder method when UseTempSolutionFolder is true.
Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs Updated to implement IOptionValidation; modified help texts for properties, added a new Url property, and implemented a Validate method that ensures mutual exclusivity between FileName and Url.
Ginger/GingerCoreNET/RunLib/CLILib/Interfaces/IOptionValidation.cs Added new internal interface IOptionValidation containing the method bool Validate().

Possibly related PRs

Suggested reviewers

  • Maheshkale447

Poem

In fields of code where changes hop,
I’m a rabbit, here to cheer nonstop.
With temp folders and options so neat,
Our CLI now sings a brand new beat.
Upgraded packages, oh what a treat!
🐇💻 Keep on coding, the path is sweet!

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce79067 and 3254bfa.

📒 Files selected for processing (10)
  • Ginger/Ginger/Ginger.csproj (1 hunks)
  • Ginger/GingerCoreNET/GingerCoreNET.csproj (1 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs (2 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs (6 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs (4 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs (2 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs (1 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/Interfaces/IOptionValidation.cs (1 hunks)
  • Ginger/GingerCoreNETUnitTest/GingerCoreNETUnitTest.csproj (1 hunks)
  • Ginger/GingerRuntime/GingerRuntime.csproj (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
Ginger/GingerRuntime/GingerRuntime.csproj (1)
Learnt from: sudarshan0212
PR: Ginger-Automation/Ginger#4024
File: Ginger/GingerRuntime/GingerRuntime.csproj:43-43
Timestamp: 2025-03-25T06:06:50.023Z
Learning: Version 24.6.1 of Ginger.ExecuterService.Contracts is unlisted and should not be suggested for updates.
Ginger/Ginger/Ginger.csproj (1)
Learnt from: sudarshan0212
PR: Ginger-Automation/Ginger#4024
File: Ginger/GingerRuntime/GingerRuntime.csproj:43-43
Timestamp: 2025-03-25T06:06:50.023Z
Learning: Version 24.6.1 of Ginger.ExecuterService.Contracts is unlisted and should not be suggested for updates.
🧬 Code Definitions (3)
Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs (3)
Ginger/Ginger/App.xaml.cs (1)
  • DoOptions (349-356)
Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs (1)
  • Validate (39-49)
Ginger/GingerCoreNET/RunLib/CLILib/Interfaces/IOptionValidation.cs (1)
  • Validate (12-12)
Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs (2)
Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs (2)
  • Verb (28-107)
  • Validate (97-106)
Ginger/GingerCoreNET/RunLib/CLILib/Interfaces/IOptionValidation.cs (1)
  • Validate (12-12)
Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs (3)
Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs (1)
  • Validate (97-106)
Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs (1)
  • Validate (39-49)
Ginger/GingerCoreNET/RunLib/CLILib/Interfaces/IOptionValidation.cs (1)
  • Validate (12-12)
🔇 Additional comments (21)
Ginger/GingerRuntime/GingerRuntime.csproj (1)

44-44: Update PackageReference for Ginger.ExecuterService.Contracts
The package version has been updated to 25.2.1 in this project file, which aligns with the overall dependency upgrade objective of the PR. Please verify that all features and integrations relying on this package are compatible with the new version.

Ginger/Ginger/Ginger.csproj (1)

724-724: Consistent PackageReference Upgrade Across Projects
The PackageReference for Ginger.ExecuterService.Contracts has been updated to version 25.2.1 here as well. This change is consistent with similar updates in other project files, ensuring uniform dependency management. Confirm that no breaking changes arise from this upgrade by running the appropriate integration tests.

Ginger/GingerCoreNETUnitTest/GingerCoreNETUnitTest.csproj (1)

92-92: Updated PackageReference to Ginger.ExecuterService.Contracts (v25.2.1)

The package reference has been updated to version 25.2.1 in this unit test project. This change is consistent with the overall package upgrade mandate. Please ensure that the new version is fully compatible with the existing unit tests and that there are no unexpected breaking changes.

Ginger/GingerCoreNET/GingerCoreNET.csproj (1)

262-262: Updated PackageReference to Ginger.ExecuterService.Contracts (v25.2.1)

The package reference in this project has been updated to version 25.2.1 in line with the broader upgrade across the solution. Verify that all dependent modules and compilation targets remain compatible with the new version.

Ginger/GingerCoreNET/RunLib/CLILib/Interfaces/IOptionValidation.cs (1)

1-14: Well-structured interface for CLI option validation.

This new interface is properly designed with a single responsibility (validation) and is well-documented with appropriate XML comments. The interface correctly defines a validation method that returns a boolean to indicate success or failure.

Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs (1)

32-32: Correctly added System.IO namespace.

Adding the System.IO namespace is appropriate for the new functionality that uses Path methods.

Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs (1)

47-50: Properly handling the UseTempFolder flag.

The code correctly sets the solution path to a temporary folder when the UseTempFolder flag is true.

Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs (5)

19-20: Correctly added required namespaces.

The added namespaces properly support the new functionality involving the IOptionValidation interface and logging.


29-29: Good implementation of IOptionValidation interface.

The class now correctly implements the IOptionValidation interface, allowing for validation of CLI options.


44-44: Appropriately grouped option for mutual exclusivity.

Adding the "solution path" group to the Solution option properly indicates that it's mutually exclusive with the UseTempFolder option.


91-92: Well-defined UseTempFolder option.

The UseTempFolder option is correctly defined with the same "solution path" group as the Solution option, indicating mutual exclusivity. The help text clearly explains its purpose.


97-106: Well-implemented validation for mutually exclusive options.

The Validate method correctly enforces that Solution and UseTempFolder cannot be used simultaneously, providing a clear error message.

Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs (4)

19-20: No issues with the new using statements.
They correctly reference the relevant namespaces needed for the extended functionalities.


22-22: Importing 'System' namespace.
No functional issues here; it aligns with the usage of Uri and other system-level classes.


28-29: Verb name and interface implementation look consistent.
Updating the help text to "Run dynamic xml/json" clarifies supported file types, and implementing IOptionValidation is aligned with the project's CLI validation approach.


36-37: New property 'Url' introduced.
Defining it as a Uri is a good choice for type safety.

Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs (5)

31-32: Added references to System.Net and System.Net.Http.
This is necessary for making HTTP requests in the new URL-handling logic.


98-98: Routing 'DynamicOptions' to the dedicated handler.
Using await HandleDynamicOptions(opts) ensures asynchronous processing of dynamic files or URLs.


114-121: Validate 'DoOptions' before execution.
The newly introduced validation call (opts.Validate()) helps ensure that mutually exclusive fields are not both set. The error handling logic is consistent with other CLI paths.


313-354: New 'HandleUrlOptions' method for dynamic execution via URL.
This is a well-structured workflow:

  1. Sets the CLI mode to dynamic.
  2. Uses an HttpClientHandler with system proxy by default.
  3. Logs success/failure appropriately.

403-420: Centralized 'ProcessExecConfigsAndExecute' method.
Loading configurations and proceeding to CLILoadAndPrepare followed by ExecuteRunSet streamlines the code for dynamic or config-based runs. The error handling approach (setting Environment.ExitCode) is consistent with the rest of the CLI code.

Comment thread Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs Outdated
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b4941e and aedce66.

📒 Files selected for processing (3)
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs (2 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs (2 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs (2 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs (1)
Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs (1)
  • GetTempFolderPathForRepo (1029-1034)
Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs (1)
Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs (1)
  • GetTempFolderPathForRepo (1029-1034)
🔇 Additional comments (4)
Ginger/GingerCoreNET/RunLib/CLILib/CLIDynamicFile.cs (1)

127-130: Support for temporary folder logic looks good.

The conditional check for UseTempFolder is implemented correctly, using the helper method to get the temporary folder path.

Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs (2)

47-50: Temporary folder handling logic looks good.

The implementation correctly checks the UseTempFolder flag and sets the solution path accordingly.


409-412: Good reuse of helper method.

The method correctly leverages the centralized GetTempFolderPathForRepo implementation from CLIHelper.

Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs (1)

39-39: LGTM! Addition of System.IO namespace.

This import is necessary for the new method that uses Path functions.

Comment thread Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs (1)

1020-1043: 🛠️ Refactor suggestion

URL parsing improved but directory existence check still missing.

The method constructs a temporary folder path by extracting the repository name from the source control URL. While you've improved the URL parsing by trimming trailing slashes and using Path.GetFileNameWithoutExtension, the method still doesn't ensure the directory exists.

public string GetTempFolderPathForRepo(string sourceControlUrl = null)
{
    string urlToUse = sourceControlUrl ?? SourceControlURL;
    string repoName = string.Empty;

    if (!string.IsNullOrEmpty(urlToUse))
    {
        // Remove trailing slash if present
        urlToUse = urlToUse.TrimEnd('/');

        repoName = Path.GetFileNameWithoutExtension(urlToUse.Split('/').Last());
    }

-   return Path.Combine(Path.GetTempPath(), repoName);
+   string tempPath = Path.Combine(Path.GetTempPath(), repoName);
+   
+   // Ensure directory exists
+   if (!Directory.Exists(tempPath))
+   {
+       Directory.CreateDirectory(tempPath);
+   }
+   
+   return tempPath;
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aedce66 and a2dd49e.

📒 Files selected for processing (1)
  • Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs (2 hunks)
🔇 Additional comments (1)
Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs (1)

39-39: LGTM! System.IO namespace is correctly imported.

The System.IO namespace is properly added to support the new file and directory operations in the GetTempFolderPathForRepo method.

Comment thread Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs
Renamed `UseTempFolder` to `UseTempSolutionFolder` in `DoOptions.cs` and `DoOptionsHanlder.cs`, affecting the command-line option attribute, property name, and validation logic.

Renamed `executionConfigSourceUrl` to `execConfigSourceUrl` in `DoOptions.cs` and `DynamicOptions.cs`, affecting the command-line option attribute and validation logic.

Updated validation error messages to reflect the new property names.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs (1)

94-95: 🧹 Nitpick (assertive)

Introduce optional execConfigSourceUrl
Defining ExecutionConfigurationSourceUrl as a Uri is helpful for clarity. Consider adding a small validation for absolute URIs in the Validate() method.

A possible adjustment:

 public bool Validate()
 {
     if (UseTempSolutionFolder && !string.IsNullOrEmpty(Solution))
     {
         Reporter.ToLog(eLogLevel.ERROR, $"'solution' & 'useTempSolutionFolder' are mutually exclusive.");
         return false;
     }

+    if (ExecutionConfigurationSourceUrl is not null && !ExecutionConfigurationSourceUrl.IsAbsoluteUri)
+    {
+        Reporter.ToLog(eLogLevel.ERROR, "Invalid URL scheme or format in 'execConfigSourceUrl'");
+        return false;
+    }

     return true;
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a2dd49e and b686885.

📒 Files selected for processing (3)
  • Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs (4 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs (2 hunks)
  • Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs (2)
Learnt from: amitamir
PR: Ginger-Automation/Ginger#4151
File: Ginger/GingerCoreNET/RunLib/CLILib/CLIProcessor.cs:292-0
Timestamp: 2025-03-30T14:00:25.054Z
Learning: The CommandLineParser library automatically handles validation to ensure required parameters are provided when options are in the same group. Custom Validate() methods (from IOptionValidation interface) are used for more complex validations like ensuring options are mutually exclusive.
Learnt from: amitamir
PR: Ginger-Automation/Ginger#4151
File: Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs:39-0
Timestamp: 2025-03-30T14:01:53.677Z
Learning: In the CommandLineParser library, options in the same group (using the Group attribute) ensure that at least one option from that group must be provided. For example, in DynamicOptions class, both 'FileName' and 'Url' are in the "source" group, ensuring at least one must be specified. Custom Validate() methods are then used to enforce additional constraints like mutual exclusivity.
🧬 Code Definitions (2)
Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs (1)
Ginger/GingerCoreNET/RunLib/CLILib/CLIHelper.cs (1)
  • GetTempFolderPathForRepo (1029-1043)
Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs (3)
Ginger/Ginger/App.xaml.cs (1)
  • DoOptions (349-356)
Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs (1)
  • Validate (39-49)
Ginger/GingerCoreNET/RunLib/CLILib/Interfaces/IOptionValidation.cs (1)
  • Validate (12-12)
🔇 Additional comments (10)
Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs (2)

47-50: Conditional logic for setting solution path
The new check for UseTempSolutionFolder is appropriate. It cleanly prevents accidental overlap with a user-specified folder by overwriting mOpts.Solution under a single condition.


409-412: Centralize all path computations in CLIHelper
Returning the path from the helper is consistent with the recommended approach from previous code reviews. The logic appears correct and avoids duplication.

Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs (4)

19-20: Implementation of IOptionValidation
Importing the interface and updating the class signature to implement IOptionValidation is a good step toward organizing validations.

Also applies to: 29-29


44-44: Grouping 'solution' with 'solution path'
This attribute clarifies that solution belongs to the same group as useTempSolutionFolder. Good usage of the CommandLine grouping feature.


91-92: New property UseTempSolutionFolder
This property nicely integrates into the solution path group for toggling a temp folder destination in the CLI.


97-106: Validate() method
The mutual exclusivity check for UseTempSolutionFolder and Solution is accurate and prevents conflicting CLI arguments.

Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs (4)

19-20: Extended references
Added references to Amdocs.Ginger.Common, Amdocs.Ginger.CoreNET.RunLib.CLILib.Interfaces, and System. These imports look correct for URL handling and interface usage.

Also applies to: 22-22


28-29: Class now supports IOptionValidation
Declaring [Verb("dynamic", HelpText = "Run dynamic xml/json")] clarifies command usage. Implementing IOptionValidation keeps validation consistent with the rest of the CLI code.


33-33: FileName option
Allowing dynamic file input (XML/JSON) is flexible. No issues found.


39-49: Validate() method
The mutual exclusivity check between FileName and Url is correct, preventing conflicting inputs.

Comment thread Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs Outdated
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/DoOptions.cs
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs Outdated
Comment thread Ginger/GingerCoreNET/RunLib/CLILib/DynamicOptions.cs
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.

2 participants