Skip to content

D40223 After triggering Execution from OTOMA - #3695

Merged
Maheshkale447 merged 6 commits into
Releases/Official-Releasefrom
BugFix/D40223_OtomaRqmpublishExecutionFix
May 10, 2024
Merged

D40223 After triggering Execution from OTOMA - #3695
Maheshkale447 merged 6 commits into
Releases/Official-Releasefrom
BugFix/D40223_OtomaRqmpublishExecutionFix

Conversation

@prashelke

@prashelke prashelke commented May 10, 2024

Copy link
Copy Markdown
Contributor

Every time new Test Case is getting generated & Execution details are not getting published into RQM

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

…se is getting generated & Execution details are not getting published into RQM
@coderabbitai

coderabbitai Bot commented May 10, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

The recent updates across various Ginger modules focus on enhancing error and log message clarity, refining conditions for exporting business flows, and ensuring consistency in status settings for nested objects. These changes improve the reliability and user feedback during ALM integration processes, making the system more intuitive and robust.

Changes

File Path Change Summary
.../RQM/ExportToRQM.cs & .../ALMLib/Generic/ALMCore.cs Updated error and log messages for test case and execution record identification. Added condition based on ALMTestSetLevel during business flow export.
.../Run/RunSetActions/... & .../RunLib/DynamicExecutionLib/... Enhanced logic for status settings and added new assignments for ALM entity search consistency.

Poem

🐰✨
In the land of code where the ginger rabbits hop,
Changes abound, making ALM integration top-notch.
Logs clearer, conditions refined,
Ensuring every test case is perfectly aligned.
Celebrate, dear devs, for the improvements are here,
With each update, our goals draw near!


<!-- walkthrough_end --><!-- This is an auto-generated comment: raw summary by coderabbit.ai -->
<!--


Ginger/GingerCore/ALM/RQM/ExportToRQM.cs: ### Summary

In the file `Ginger/GingerCore/ALM/RQM/ExportToRQM.cs`, the changes involve updating error messages and log statements related to test case and execution record identification. The modifications include adjusting the error messages to reference the test plan and its external ID, as well as refining the log messages for clarity.

### Alterations to the declarations of exported or public entities

- `private ExecutionResult GetExeResultforActivityGroup(BusinessFlow businessFlow, ...)` in class `ExportToRQM` in `Ginger/GingerCore/ALM/RQM/ExportToRQM.cs`
  - Updated error and log messages related to test case identification and execution record ID handling.

---

Ginger/GingerCoreNET/ALMLib/Generic/ALMCore.cs: ## Short Summary

In the `ALMCore.cs` file, the logic for exporting business flows to ALM has been updated to include a condition based on the `ALMTestSetLevel` property of `BizFlow`.

## Alterations to the declarations of exported or public entities

- `public bool ExportBusinessFlowsResultToALM(ObservableList<BusinessFlow> BusinessFlows, PublishToALMConfig publishToALMConfig)` in class `ALMCore` in `Ginger/GingerCoreNET/ALMLib/Generic/ALMCore.cs`

---

Ginger/GingerCoreNET/Run/RunSetActions/RunSetActionPublishToQCOperations.cs: ## Updated Summary
- Added import for `GingerCore.Actions`.
- Modified the logic to set the status of nested `Act` objects within copied activities.

---

Ginger/GingerCoreNET/RunLib/DynamicExecutionLib/DynamicExecutionManager.cs: ## Short Summary

In the `DynamicExecutionManager.cs` file, a new assignment `publishToQCRunSetOperation.SearchALMEntityByName = publishToALMOperationExecConfig.SearchByName;` has been added within a conditional block.

## Alterations to the declarations of exported or public entities

- `public static RunSetConfig LoadRunsetFromExecutionConfig(GingerExecConfig gingerExecConfig)` in class `DynamicExecutionManager` in `Ginger/GingerCoreNET/RunLib/DynamicExecutionLib/DynamicExecutionManager.cs`
    - Added assignment: `publishToQCRunSetOperation.SearchALMEntityByName = publishToALMOperationExecConfig.SearchByName;`

-->
<!-- end of auto-generated comment: raw summary by coderabbit.ai --><!-- This is an auto-generated comment: shorter summary by coderabbit.ai -->
<!--


### AI-generated Summary of Generated Summaries

Updates across various components of the Ginger software suite aim to refine ALM system integration, error handling, and export processes. The changes encompass:

1. **ExportToRQM.cs**:
   - Enhanced error and log messages for clearer test case and execution record identification, now explicitly referencing test plans and external IDs.

2. **ALMCore.cs**:
   - Expanded export logic to consider the `ALMTestSetLevel` property for more precise control over business flow exports.

3. **RunSetActionPublishToQCOperations.cs**:
   - Included an import statement for `GingerCore.Actions` and adjusted logic for setting the status of nested `Act` objects.

4. **DynamicExecutionManager.cs**:
   - Introduced an assignment for consistent setting of `SearchALMEntityByName` across ALM operations.

These updates collectively strengthen ALM operation handling, enhancing user experience and external tool integration.

### Alterations to the Declarations of Exported or Public Entities

**ExportToRQM.cs**:
- **Before**: `private ExecutionResult GetExeResultforActivityGroup(BusinessFlow businessFlow, ...)`
- **After**: `private ExecutionResult GetExeResultforActivityGroup(BusinessFlow businessFlow, ...)`
  - Changes: Updated error and log messages related to test case identification and execution record ID handling.

**ALMCore.cs**:
- **Before**: `public bool ExportBusinessFlowsResultToALM(ObservableList<BusinessFlow> BusinessFlows, ...)`
- **After**: `public bool ExportBusinessFlowsResultToALM(ObservableList<BusinessFlow> BusinessFlows, PublishToALMConfig publishToALMConfig)`
  - Changes: Added `PublishToALMConfig publishToALMConfig` parameter for export configuration.

**RunSetActionPublishToQCOperations.cs**:
- No explicit method signature changes mentioned, but logic adjustments were made.

**DynamicExecutionManager.cs**:
- **Before**: `public static RunSetConfig LoadRunsetFromExecutionConfig(GingerExecConfig gingerExecConfig)`
- **After**: `public static RunSetConfig LoadRunsetFromExecutionConfig(GingerExecConfig gingerExecConfig)`
  - Changes: Added internal assignment: `publishToQCRunSetOperation.SearchALMEntityByName = publishToALMOperationExecConfig.SearchByName;` for consistent search behavior.

These alterations signify architectural enhancements focusing on error handling, configuration management, and operational consistency in ALM integration points.

-->
<!-- end of auto-generated comment: shorter summary by coderabbit.ai --><!-- This is an auto-generated comment: pr objectives by coderabbit.ai -->
<!--


### PR Summary

This pull request (PR), numbered 3695 and titled "D40223 After triggering Execution from OTOMA," aims to address the issue where new test cases generated fail to trigger the publication of execution details into Rational Quality Manager (RQM). The description highlights the consistent problem of execution details not being properly communicated to RQM after triggering execution from OTOMA.

The PR checklist provided outlines essential steps for the contributor to follow before submitting the PR for review:
- Ensuring a clear PR description and commit message.
- Verifying the correct branch targeting (Release, Beta, or Master).
- Merging the latest code from the relevant branch into the contributor's branch.
- Excluding unnecessary or commented code.
- Ensuring no new warnings in the build solution.
- Adding code summaries or comments to explain the code's functionality.
- Passing existing unit tests and adding new tests relevant to the changes.
- Successfully executing sanity tests for both new and existing functionalities.
- Verifying compatibility with all relevant browsers and platforms.
- Resolving conflicts post-PR creation.
- Addressing Codacy comments.
- Passing all builds and checks before PR review.
- Resolving any code review comments.
- Updating the Help Library document to reflect any feature changes.

These steps are crucial to ensure code quality, functionality, and compatibility across different platforms before merging the changes into the main project.

-->
<!-- end of auto-generated comment: pr objectives by coderabbit.ai --><!-- commit_ids_reviewed_start -->

<!-- 6f6ea91999d5adb64dfccbd404ac9e8f04f41aab -->
<!-- cde09347d7e961e9fb657d63aaf17f035a41ed57 -->
<!-- 155c17ff61e91048acd673d3975ac5b2c2ea6a57 -->

<!-- commit_ids_reviewed_end --><!-- tips_start -->

---

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

<details>
<summary>Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
	- `I pushed a fix in commit <commit_id>.`
	- `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 generate interesting stats about this repository and render them as a table.`
	- `@coderabbitai show all the console.log statements in this repository.`
	- `@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.`

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 as PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai help` to get help.


Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.

### CodeRabbit Configration 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@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: 0

Out of diff range and nitpick comments (4)
Ginger/GingerCore/ALM/RQM/ExportToRQM.cs (4)

Line range hint 493-527: Clarify error messages for better user understanding.

- result = $"At {GingerDicser.GetTermResValue(eTermResKey.RunSet)}: Cannot find test case with id {testCaseId} under Test Plan {businessFlow.Name} Test Plan Id: {businessFlow.ExternalID}";
+ result = $"Cannot find test case with ID {testCaseId} under the Test Plan '{businessFlow.Name}' with Test Plan ID: {businessFlow.ExternalID}. Please verify the Test Case ID and Test Plan details.";

The error messages could be more user-friendly by directly stating the problem and suggesting a verification step. This change makes the message clearer and more actionable for the user.


Line range hint 493-527: Ensure consistent error handling and user feedback.

- Reporter.ToLog(eLogLevel.ERROR, $"At {GingerDicser.GetTermResValue(eTermResKey.RunSet)}: Cannot find test case with id {testCaseId} under Test Plan {businessFlow.Name} Test Plan Id: {businessFlow.ExternalID}");
+ Reporter.ToLog(eLogLevel.ERROR, $"Cannot find test case with ID {testCaseId} under the Test Plan '{businessFlow.Name}' with Test Plan ID: {businessFlow.ExternalID}. Please verify the Test Case ID and Test Plan details.");

The logging statements should match the updated error messages for consistency. This ensures that the logs are as clear and helpful as the user-facing messages.


Line range hint 493-527: Refactor method to reduce complexity and improve readability.

Consider breaking down GetExeResultforActivityGroup into smaller, more manageable methods. This can improve readability and maintainability. For example, handling of test suite execution records and creation of execution records could be separated into distinct methods.


Line range hint 493-527: Simplify error handling in CreateExecutionRecord.

- if (resultInfo != null && !string.IsNullOrEmpty(resultInfo.ErrorDesc))
+ if (resultInfo?.ErrorDesc != null)

Simplify the condition checks by using the null-conditional operator, which makes the code cleaner and easier to understand.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 88e3cc4 and 6f6ea91.
Files ignored due to path filters (4)
  • Ginger/GingerCore/DLLs/RQMExportStd.dll is excluded by !**/*.dll, !**/*.dll
  • Ginger/GingerCore/DLLs/RQM_RepositoryStd.dll is excluded by !**/*.dll, !**/*.dll
  • Ginger/GingerCoreNET/DLLS/RQMExportStd.dll is excluded by !**/*.dll, !**/*.dll
  • Ginger/GingerCoreNET/DLLS/RQM_RepositoryStd.dll is excluded by !**/*.dll, !**/*.dll
Files selected for processing (4)
  • Ginger/GingerCore/ALM/RQM/ExportToRQM.cs (2 hunks)
  • Ginger/GingerCoreNET/ALMLib/Generic/ALMCore.cs (1 hunks)
  • Ginger/GingerCoreNET/Run/RunSetActions/RunSetActionPublishToQCOperations.cs (2 hunks)
  • Ginger/GingerCoreNET/RunLib/DynamicExecutionLib/DynamicExecutionManager.cs (1 hunks)
Additional Context Used
Learnings (1)
Ginger/GingerCore/ALM/RQM/ExportToRQM.cs (1)
User: prashelke
URL: https://github.com/Ginger-Automation/Ginger/pull/3615

Timestamp: 2024-04-15T11:20:32.902Z
Learning: The error handling for the `GetTestCaseFromActivityGroup` method in `ExportToRQM.cs` has been improved to handle cases where an activity group does not have any activities more gracefully.
Additional comments not posted (4)
Ginger/GingerCoreNET/Run/RunSetActions/RunSetActionPublishToQCOperations.cs (2)

25-25: Added import for GingerCore.Actions.

This import is necessary for the changes in the method logic that involve Act objects.


205-210: Ensure consistency in activity status during copying.

The changes correctly propagate the status from the original activities to their copies, which is crucial for accurate ALM reporting.

Ginger/GingerCoreNET/ALMLib/Generic/ALMCore.cs (1)

247-248: Added logic to create activity group reports based on the ToAttachActivitiesGroupReport flag.

This addition allows for conditional generation of reports, enhancing flexibility and control over the reporting process during ALM exports.

Ginger/GingerCoreNET/RunLib/DynamicExecutionLib/DynamicExecutionManager.cs (1)

1622-1622: Ensure the new assignment for SearchALMEntityByName aligns with expected ALM configurations.

Verification successful

The search results indicate that the SearchALMEntityByName property is used consistently across different parts of the application, both in the backend logic and the UI. The property is properly propagated and bound to UI elements, and its changes are handled to reflect in the application state. This suggests that the implementation aligns with the expected behavior for ALM configurations.

  • Ginger/GingerCoreNET/Run/RunSetActions/RunSetActionPublishToQCOperations.cs: Property used to set configuration for ALM publishing.
  • Ginger/GingerCoreNET/RunLib/DynamicExecutionLib/DynamicExecutionManager.cs: Property values transferred between different operations, ensuring consistency.
  • Ginger/GingerCoreCommon/Run/RunSetActions/RunSetActionPublishToQC.cs: Property defined with change notification.
  • Ginger/Ginger/Run/RunSetActions/ExportResultsToALMConfigPage.xaml.cs: UI bindings and visibility managed based on this property.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the `SearchALMEntityByName` setting is being used consistently across the application.

# Test: Search for the usage of `SearchALMEntityByName`. Expect: Consistent usage across different ALM operations.
rg --type cs 'SearchALMEntityByName'

Length of output: 2283

Comment thread Ginger/GingerCoreNET/ALMLib/Generic/ALMCore.cs Outdated
Comment thread Ginger/GingerCoreNET/Run/RunSetActions/RunSetActionPublishToQCOperations.cs Outdated
@prashelke
prashelke requested a review from Maheshkale447 May 10, 2024 08:42

@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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 6f6ea91 and cde0934.
Files selected for processing (2)
  • Ginger/GingerCoreNET/ALMLib/Generic/ALMCore.cs (1 hunks)
  • Ginger/GingerCoreNET/Run/RunSetActions/RunSetActionPublishToQCOperations.cs (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • Ginger/GingerCoreNET/ALMLib/Generic/ALMCore.cs
  • Ginger/GingerCoreNET/Run/RunSetActions/RunSetActionPublishToQCOperations.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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between cde0934 and 155c17f.
Files selected for processing (1)
  • Ginger/GingerCoreNET/ALMLib/Generic/ALMCore.cs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Ginger/GingerCoreNET/ALMLib/Generic/ALMCore.cs

@Maheshkale447
Maheshkale447 merged commit 5a608da into Releases/Official-Release May 10, 2024
@Maheshkale447
Maheshkale447 deleted the BugFix/D40223_OtomaRqmpublishExecutionFix branch May 10, 2024 09:30
@coderabbitai coderabbitai Bot mentioned this pull request Nov 6, 2024
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