Skip to content

MultiPOM Design changes#4161

Merged
Maheshkale447 merged 3 commits into
Releases/Betafrom
BugFix/MultiPomUpdateFix
Apr 3, 2025
Merged

MultiPOM Design changes#4161
Maheshkale447 merged 3 commits into
Releases/Betafrom
BugFix/MultiPomUpdateFix

Conversation

@prashelke

@prashelke prashelke commented Apr 3, 2025

Copy link
Copy Markdown
Contributor

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

    • Introduced an enhanced run set selection component within the wizard, allowing users to easily update their selections.
    • Added dynamic control for the wizard's navigation, enabling or disabling the previous button based on context.
  • Refactor

    • Streamlined the underlying configuration mapping to improve reliability and clarity when associating application models with run set configurations.
    • Improved property naming conventions for better consistency and readability.

@coderabbitai

coderabbitai Bot commented Apr 3, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes update the UI and underlying data models across several components. A new ComboBox DataTemplate has been added to the wizard page, and its event handling is implemented. The run set configuration mapping is reversed to improve clarity, with additional observable lists introduced. Furthermore, wizard navigation is enhanced through a new method for toggling the previous button state, and the multi-POM run set mapping has been refactored to use structured properties instead of a comma-separated string.

Changes

File(s) Change Summary
Ginger/.../POMObjectMappingWithRunsetWizardPage.xaml Added a new DataTemplate (xComboBoxTemplate) containing a ComboBox (xRunSetComboBox) with UI property configurations and an associated selection-changed event.
Ginger/.../POMObjectMappingWithRunsetWizardPage.xaml.cs Reversed the dictionary mapping (from RunSetConfig → List<ApplicationPOMModel> to ApplicationPOMModel → List<RunSetConfig>), added an ObservableList<RunSetConfig>, modified method parameter order in LoadRunsetConfigToRunsetExecutor, and implemented RunSetComboBox_SelectionChanged.
Ginger/.../WizardWindow.xaml.cs and GingerCoreNET/.../IWizardWindow.cs Introduced the SetPrevButtonEnabled method to enable/disable the previous button in the wizard interface.
GingerCoreNET/.../MultiPomRunSetMapping.cs Removed the commaSeparatedApplicationPOMModels property and added structured properties: ApplicationAPIModel, ApplicationAPIModelName, RunSetConfigList, and SelectedRunset.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant C as xRunSetComboBox
    participant P as POMObjectMappingWithRunsetWizardPage
    U->>C: Select a run set option
    C->>P: Trigger RunSetComboBox_SelectionChanged
    P->>P: Update ObservableList & mapping logic
    P-->>U: UI reflects updated selection
Loading
sequenceDiagram
    participant E as External Component
    participant W as WizardWindow
    E->>W: Call SetPrevButtonEnabled(bool)
    W->>W: Update xPrevButton.IsEnabled
    W-->>E: Previous button state updated
Loading

Suggested reviewers

  • Maheshkale447

Poem

Oh, I’m a rabbit coding with glee,
Hopping through changes so sprightly and free.
A ComboBox new makes the UI bloom,
And wizard buttons dance in their room.
With mapping refined and logic so bright,
This bunny celebrates code day and night!
🥕🐰

✨ 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: 1

🔭 Outside diff range comments (2)
Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/UpdateMultipleWizard/POMObjectMappingWithRunsetWizardPage.xaml.cs (2)

283-299: ⚠️ Potential issue

Parameter order flipped in method signature.

The method signature has been changed to place runSetConfig before runsetExecutor. While this works functionally, it's inconsistent with the method call at line 233, which passes parameters in a different order.

Apply this fix to maintain consistency:

-LoadRunsetConfigToRunsetExecutor(runsetExecutor: WorkSpace.Instance.RunsetExecutor, runSetConfig: mSelectedPomWithRunset.SelectedRunset, mCLIHelper: mCLIHelper);
+LoadRunsetConfigToRunsetExecutor(runSetConfig: mSelectedPomWithRunset.SelectedRunset, runsetExecutor: WorkSpace.Instance.RunsetExecutor, mCLIHelper: mCLIHelper);

Or alternatively change the method signature to match the calling convention.


279-281: 🧹 Nitpick (assertive)

Implement the TestAllRunSet method.

The method is currently empty with a "To Do" comment. Considering the PR aims to complete the MultiPOM Design changes, this should be implemented.

Would you like me to suggest an implementation for the TestAllRunSet method? It should likely execute tests for all selected run sets in sequence or parallel.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f68259f and 708f696.

📒 Files selected for processing (5)
  • Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/UpdateMultipleWizard/POMObjectMappingWithRunsetWizardPage.xaml (1 hunks)
  • Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/UpdateMultipleWizard/POMObjectMappingWithRunsetWizardPage.xaml.cs (9 hunks)
  • Ginger/Ginger/WizardLib/WizardWindow.xaml.cs (1 hunks)
  • Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs (1 hunks)
  • Ginger/GingerCoreNET/WizardLib/IWizardWindow.cs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs (2)
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4150
File: Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs:38-39
Timestamp: 2025-04-01T11:43:47.188Z
Learning: The property in MultiPomRunSetMapping class was renamed from 'applicationPOMModels' to 'ApplicationPOMModels' to follow C# PascalCase naming conventions for public properties.
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4150
File: Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs:28-28
Timestamp: 2025-04-01T06:48:16.412Z
Learning: The property in MultiPomRunSetMapping class was renamed from 'runSetConfig' to 'RunSetConfig' to follow C# PascalCase naming conventions for public properties.
Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/UpdateMultipleWizard/POMObjectMappingWithRunsetWizardPage.xaml.cs (2)
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4150
File: Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs:28-28
Timestamp: 2025-04-01T06:48:16.412Z
Learning: The property in MultiPomRunSetMapping class was renamed from 'runSetConfig' to 'RunSetConfig' to follow C# PascalCase naming conventions for public properties.
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4150
File: Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs:38-39
Timestamp: 2025-04-01T11:43:47.188Z
Learning: The property in MultiPomRunSetMapping class was renamed from 'applicationPOMModels' to 'ApplicationPOMModels' to follow C# PascalCase naming conventions for public properties.
🧬 Code Definitions (3)
Ginger/Ginger/WizardLib/WizardWindow.xaml.cs (1)
Ginger/GingerCoreNET/WizardLib/IWizardWindow.cs (1)
  • SetPrevButtonEnabled (31-31)
Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs (3)
Ginger/GingerCoreNET/Application Models/Execution/POM/POMExecutionUtils.cs (1)
  • ApplicationPOMModel (65-77)
Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (12)
  • List (2296-2347)
  • List (4899-4974)
  • List (5213-5247)
  • List (6039-6060)
  • List (6130-6182)
  • List (8290-8302)
  • List (10152-10155)
  • List (10199-10218)
  • List (10292-10299)
  • List (10301-10362)
  • List (10707-10710)
  • List (10732-10735)
Ginger/GingerCoreCommon/Run/RunSetConfig.cs (1)
  • RunSetConfig (37-526)
Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/UpdateMultipleWizard/POMObjectMappingWithRunsetWizardPage.xaml.cs (6)
Ginger/GingerCoreNET/Application Models/Execution/POM/POMExecutionUtils.cs (1)
  • ApplicationPOMModel (65-77)
Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs (1)
  • MultiPomRunSetMapping (17-88)
Ginger/GingerCoreCommon/Repository/ApplicationModelLib/ApplicationModelBase.cs (1)
  • ToString (53-56)
Ginger/GingerCoreNET/WizardLib/IWizardWindow.cs (3)
  • ProcessStarted (24-24)
  • SetFinishButtonEnabled (29-29)
  • SetPrevButtonEnabled (31-31)
Ginger/Ginger/WizardLib/WizardWindow.xaml.cs (1)
  • ProcessStarted (402-408)
Ginger/GingerCoreNET/Run/RunsetExecutor.cs (1)
  • RunsetExecutor (49-1054)
🔇 Additional comments (17)
Ginger/GingerCoreNET/WizardLib/IWizardWindow.cs (1)

30-31: Clear and consistent interface addition.

The new SetPrevButtonEnabled method follows the same pattern as the existing SetFinishButtonEnabled method, providing consistent control over wizard navigation buttons.

Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/UpdateMultipleWizard/POMObjectMappingWithRunsetWizardPage.xaml (1)

42-44: Appropriate DataTemplate for RunSet selection.

The ComboBox template is properly structured with appropriate properties and an event handler for selection changes. This template enhances the UI for run set selection, which aligns with the MultiPOM design changes.

Ginger/Ginger/WizardLib/WizardWindow.xaml.cs (1)

441-444: Proper implementation of the interface method.

The implementation correctly sets the enabled state of the previous button based on the provided parameter, consistent with the interface definition.

Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs (1)

46-53: Improved model structure with more specific properties.

The addition of structured properties (ApplicationAPIModel, ApplicationAPIModelName, RunSetConfigList, SelectedRunset) enhances type safety and maintainability compared to using a comma-separated string approach.

Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/UpdateMultipleWizard/POMObjectMappingWithRunsetWizardPage.xaml.cs (13)

39-39: Import added for data binding.

The addition of the System.Windows.Data import is necessary to support the new ComboBox functionality with BindingMode.TwoWay in the grid definition.


52-53: Good architectural change: Reversed mapping direction improves data access patterns.

This change inverts the relationship mapping from RunSetConfig→ApplicationPOMModels to ApplicationPOMModel→RunSetConfigs. This is a better design as it makes it more efficient to find all run sets associated with a specific POM model.

The new ObservableList provides better change notification capabilities for UI binding.


73-75: Dictionary initialization matches the new data structure design.

The initialization correctly implements the reversed mapping approach. The addition of business flows retrieval is necessary for the relationship mapping logic.


97-102: Updated dictionary operations for the new data structure.

The code correctly handles checking for key existence and adding values to the new dictionary structure.


108-114: Updated MultiPomRunSetMapping property assignments.

The properties follow the PascalCase naming convention as noted in the retrieved learnings. The rename from a comma-separated string representation to structured properties improves code readability and maintainability.


119-155: New algorithm for intelligent RunSet selection.

This algorithm intelligently selects the most common RunSetConfig across all items while preserving unique configurations where appropriate. The empty/null collection handling is also properly implemented with appropriate status messages.


162-162: Improved error logging with string interpolation.

The error message now includes the exception details using string interpolation, which improves debugging capabilities.


186-190: Updated GridView to support new data model and added ComboBox template.

The column definitions are updated to match the new property names and the ComboBox template now includes a selection changed event handler for real-time updates. The status icon column is also properly configured.


226-228: Added wizard navigation control logic.

The back button is now properly disabled during test execution to prevent navigation while operations are in progress.


229-233: Updated RunSet execution preparation.

The code now includes a null check for mSelectedPomWithRunset before proceeding. The AutoUpdatedPOMList is properly initialized, and the parameter order in the LoadRunsetConfigToRunsetExecutor method call has been updated to match the new method signature.


239-255: Improved result processing logic.

The updated code properly handles the status updates based on execution results, with clear status messages for updated and non-updated POMs. The failure handling is also properly implemented.


273-276: Consistent UI state management.

The wizard buttons are properly re-enabled after execution completes, ensuring a consistent UI experience.


320-327: Added ComboBox selection event handler.

The new event handler properly updates both the SelectedRunset property and the RunsetName display property when the user selects an item from the ComboBox.

Comment thread Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs Outdated
@prashelke
prashelke requested a review from Maheshkale447 April 3, 2025 16:44
…mRunSetMapping.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@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 708f696 and ec9f30a.

📒 Files selected for processing (1)
  • Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs (2)
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4150
File: Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs:38-39
Timestamp: 2025-04-01T11:43:47.188Z
Learning: The property in MultiPomRunSetMapping class was renamed from 'applicationPOMModels' to 'ApplicationPOMModels' to follow C# PascalCase naming conventions for public properties.
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4150
File: Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs:28-28
Timestamp: 2025-04-01T06:48:16.412Z
Learning: The property in MultiPomRunSetMapping class was renamed from 'runSetConfig' to 'RunSetConfig' to follow C# PascalCase naming conventions for public properties.
🔇 Additional comments (2)
Ginger/GingerCoreNET/Application Models/Delta/PomDelta/MultiPomRunSetMapping.cs (2)

38-38: Property naming now follows C# conventions.

The property has been renamed from applicationPOMModels to ApplicationPOMModels following PascalCase naming conventions for public properties in C#, which is consistent with other properties in the class.


46-47: Clarify naming inconsistency between API and POM terminology.

There's a potential naming inconsistency: the property ApplicationAPIModel is of type ApplicationPOMModel, while another property is named ApplicationPOMModels. This mixing of "API" and "POM" terminology in related properties could be confusing. Consider either renaming for consistency or adding documentation to clarify the relationship between these concepts.

Can you clarify the relationship between API and POM in this context? Is ApplicationAPIModel meant to represent a specific kind of POM model related to APIs?

Comment on lines +46 to +49
public ApplicationPOMModel ApplicationAPIModel { get; set; }

public string ApplicationAPIModelName { get; set; }

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.

🧹 Nitpick (assertive)

Consider adding default initializations to prevent null references.

The ApplicationAPIModel and ApplicationAPIModelName properties lack default initializations, unlike other collection properties in the class. Consider initializing them to prevent potential null reference exceptions.

-        public ApplicationPOMModel ApplicationAPIModel { get; set; }
+        public ApplicationPOMModel ApplicationAPIModel { get; set; } = new ApplicationPOMModel();

-        public string ApplicationAPIModelName { get; set; }
+        public string ApplicationAPIModelName { get; set; } = string.Empty;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public ApplicationPOMModel ApplicationAPIModel { get; set; }
public string ApplicationAPIModelName { get; set; }
public ApplicationPOMModel ApplicationAPIModel { get; set; } = new ApplicationPOMModel();
public string ApplicationAPIModelName { get; set; } = string.Empty;

Comment on lines +46 to +53
public ApplicationPOMModel ApplicationAPIModel { get; set; }

public string ApplicationAPIModelName { get; set; }

public List<RunSetConfig> RunSetConfigList { get; set; } = new List<RunSetConfig>();

public RunSetConfig? SelectedRunset { get; set; }

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.

🧹 Nitpick (assertive)

Add XML documentation comments for the new properties.

The newly added properties lack XML documentation comments unlike other properties in the class. Adding summary comments would maintain consistency with the documentation style in the rest of the file and clarify the purpose of each property.

+        /// <summary>
+        /// The Application API Model associated with this mapping
+        /// </summary>
         public ApplicationPOMModel ApplicationAPIModel { get; set; }

+        /// <summary>
+        /// Name of the Application API Model
+        /// </summary>
         public string ApplicationAPIModelName { get; set; }

+        /// <summary>
+        /// List of RunSet configurations that can be associated with this mapping
+        /// </summary>
         public List<RunSetConfig> RunSetConfigList { get; set; } = new List<RunSetConfig>();

+        /// <summary>
+        /// The currently selected RunSet configuration from the RunSetConfigList
+        /// </summary>
         public RunSetConfig? SelectedRunset { get; set; }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public ApplicationPOMModel ApplicationAPIModel { get; set; }
public string ApplicationAPIModelName { get; set; }
public List<RunSetConfig> RunSetConfigList { get; set; } = new List<RunSetConfig>();
public RunSetConfig? SelectedRunset { get; set; }
/// <summary>
/// The Application API Model associated with this mapping
/// </summary>
public ApplicationPOMModel ApplicationAPIModel { get; set; }
/// <summary>
/// Name of the Application API Model
/// </summary>
public string ApplicationAPIModelName { get; set; }
/// <summary>
/// List of RunSet configurations that can be associated with this mapping
/// </summary>
public List<RunSetConfig> RunSetConfigList { get; set; } = new List<RunSetConfig>();
/// <summary>
/// The currently selected RunSet configuration from the RunSetConfigList
/// </summary>
public RunSetConfig? SelectedRunset { get; set; }

@Maheshkale447
Maheshkale447 merged commit 8759267 into Releases/Beta Apr 3, 2025
@Maheshkale447
Maheshkale447 deleted the BugFix/MultiPomUpdateFix branch April 3, 2025 17:35
@coderabbitai coderabbitai Bot mentioned this pull request Aug 22, 2025
15 tasks
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