Skip to content

Runner name added in Source Path#4340

Merged
Maheshkale447 merged 1 commit into
Releases/Official-Releasefrom
BugFix/ExecutionLoggerFix
Oct 17, 2025
Merged

Runner name added in Source Path#4340
Maheshkale447 merged 1 commit into
Releases/Official-Releasefrom
BugFix/ExecutionLoggerFix

Conversation

@prashelke

@prashelke prashelke commented Oct 17, 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

  • Bug Fixes
    • Enhanced execution logging with improved context tracking. Logs now display detailed execution hierarchy information and parent activity identification, providing better diagnostic visibility for troubleshooting execution flow.

@coderabbitai

coderabbitai Bot commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

ExecutionLoggerManager.cs modified to enhance ActionEnd logging with expanded context. SourcePath construction changed from ">" separators to "->" separators while incorporating GingerRunner name. ParentActivityID field added to log output. Log call now properly formats and passes the enhanced SourcePath.

Changes

Cohort / File(s) Summary
Logging Enhancement
Ginger/GingerCoreNET/Run/RunListenerLib/ExecutionLoggerManager.cs
ActionEnd logging SourcePath now includes RunSetConfig.Name, GingerRunner.Name, BusinessFlow.Name, ActivityName, and Action identifier separated by "->". ParentActivityID field added to formatted action summary. ExecutionProgressReporterListener.AddExecutionDetailsToLog call updated to pass enhanced SourcePath.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Ginger-Automation/Ginger#4332: Modified ExecutionProgressReporterListener.AddExecutionDetailsToLog to accept a sourcePath parameter, which this PR now leverages.

Suggested reviewers

  • Maheshkale447

Poem

🐰 With arrows pointing through the way,
The logs now tell a richer tale,
GingerRunner's name joins the display,
ParentID trails don't ever fail!
Context flows where runners play,

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description provided by the author is identical to the description template and contains only an unchecked checklist of contributor requirements. It lacks any substantive description of the actual changes made to the codebase. The first item in the checklist itself requires that the "PR description and commit message should describe the changes done in this PR," but no such description has been provided—only the template remains. This means the description does not fulfill its primary purpose of explaining what was changed and why. The author should replace or augment the template checklist with an actual description of the changes, including what was modified in ExecutionLoggerManager.cs (the SourcePath logging enhancement), why this change was made, and the impact of including the GingerRunner name in the logging context. This description should be added above or alongside the verification checklist to provide reviewers with clear context about the PR's purpose and scope.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "Runner name added in Source Path" directly and accurately describes the main change in the changeset. According to the raw summary, the primary modification was to augment the ActionEnd logging source path to include the GingerRunner name, which is exactly what the title conveys. The title is concise, specific, and clear enough for a teammate to understand the primary change when scanning history.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BugFix/ExecutionLoggerFix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6c64e1a and 289ebb5.

📒 Files selected for processing (1)
  • Ginger/GingerCoreNET/Run/RunListenerLib/ExecutionLoggerManager.cs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
Ginger/GingerCoreNET/Run/RunListenerLib/ExecutionLoggerManager.cs (2)
Ginger/GingerCoreNET/WorkSpaceLib/WorkSpace.cs (1)
  • WorkSpace (61-1006)
Ginger/GingerCoreCommon/Run/GingerRunner.cs (1)
  • GingerRunner (53-317)

Comment on lines +604 to 605
string SourcePath = $"{WorkSpace.Instance?.RunsetExecutor?.RunSetConfig?.Name ?? "N/A"} -> {((GingerExecutionEngine)mContext?.Runner).GingerRunner.Name ?? "N/A"} -> {mContext?.BusinessFlow?.Name ?? "N/A"} -> {mCurrentActivity?.ActivityName ?? "N/A"} -> {(action?.ItemName ?? action?.Description ?? "N/A")}";
ExecutionProgressReporterListener.AddExecutionDetailsToLog(ExecutionProgressReporterListener.eExecutionPhase.End, "Action", string.Format("{0} (ID:{1}, ParentID:{2}, ParentActivityID: {3})", action.Description, action.Guid, action.ExecutionParentGuid, mCurrentActivity?.Guid), AR,SourcePath);

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.

⚠️ Potential issue | 🔴 Critical

Fix null-safety issue in SourcePath construction to prevent NullReferenceException.

The SourcePath construction has a critical null-safety flaw. When mContext?.Runner is null, the expression ((GingerExecutionEngine)mContext?.Runner).GingerRunner.Name attempts to access .GingerRunner.Name on a null reference, which will throw a NullReferenceException. Additionally, the cast to GingerExecutionEngine could throw an InvalidCastException if the Runner is not of that type.

Apply this diff to fix the null-safety issue:

-                    string SourcePath = $"{WorkSpace.Instance?.RunsetExecutor?.RunSetConfig?.Name ?? "N/A"} -> {((GingerExecutionEngine)mContext?.Runner).GingerRunner.Name ?? "N/A"} -> {mContext?.BusinessFlow?.Name ?? "N/A"} -> {mCurrentActivity?.ActivityName ?? "N/A"} -> {(action?.ItemName ?? action?.Description ?? "N/A")}";
+                    string SourcePath = $"{WorkSpace.Instance?.RunsetExecutor?.RunSetConfig?.Name ?? "N/A"} -> {((GingerExecutionEngine)mContext?.Runner)?.GingerRunner?.Name ?? "N/A"} -> {mContext?.BusinessFlow?.Name ?? "N/A"} -> {mCurrentActivity?.ActivityName ?? "N/A"} -> {(action?.ItemName ?? action?.Description ?? "N/A")}";

Alternatively, for better readability and safer type handling, consider extracting the GingerRunner name:

+                    string runnerName = "N/A";
+                    if (mContext?.Runner is GingerExecutionEngine gingerEngine)
+                    {
+                        runnerName = gingerEngine.GingerRunner?.Name ?? "N/A";
+                    }
-                    string SourcePath = $"{WorkSpace.Instance?.RunsetExecutor?.RunSetConfig?.Name ?? "N/A"} -> {((GingerExecutionEngine)mContext?.Runner).GingerRunner.Name ?? "N/A"} -> {mContext?.BusinessFlow?.Name ?? "N/A"} -> {mCurrentActivity?.ActivityName ?? "N/A"} -> {(action?.ItemName ?? action?.Description ?? "N/A")}";
+                    string SourcePath = $"{WorkSpace.Instance?.RunsetExecutor?.RunSetConfig?.Name ?? "N/A"} -> {runnerName} -> {mContext?.BusinessFlow?.Name ?? "N/A"} -> {mCurrentActivity?.ActivityName ?? "N/A"} -> {(action?.ItemName ?? action?.Description ?? "N/A")}";
                     ExecutionProgressReporterListener.AddExecutionDetailsToLog(ExecutionProgressReporterListener.eExecutionPhase.End, "Action", string.Format("{0} (ID:{1}, ParentID:{2}, ParentActivityID: {3})", action.Description, action.Guid, action.ExecutionParentGuid, mCurrentActivity?.Guid), AR, SourcePath);
📝 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
string SourcePath = $"{WorkSpace.Instance?.RunsetExecutor?.RunSetConfig?.Name ?? "N/A"} -> {((GingerExecutionEngine)mContext?.Runner).GingerRunner.Name ?? "N/A"} -> {mContext?.BusinessFlow?.Name ?? "N/A"} -> {mCurrentActivity?.ActivityName ?? "N/A"} -> {(action?.ItemName ?? action?.Description ?? "N/A")}";
ExecutionProgressReporterListener.AddExecutionDetailsToLog(ExecutionProgressReporterListener.eExecutionPhase.End, "Action", string.Format("{0} (ID:{1}, ParentID:{2}, ParentActivityID: {3})", action.Description, action.Guid, action.ExecutionParentGuid, mCurrentActivity?.Guid), AR,SourcePath);
string SourcePath = $"{WorkSpace.Instance?.RunsetExecutor?.RunSetConfig?.Name ?? "N/A"} -> {((GingerExecutionEngine)mContext?.Runner)?.GingerRunner?.Name ?? "N/A"} -> {mContext?.BusinessFlow?.Name ?? "N/A"} -> {mCurrentActivity?.ActivityName ?? "N/A"} -> {(action?.ItemName ?? action?.Description ?? "N/A")}";
ExecutionProgressReporterListener.AddExecutionDetailsToLog(ExecutionProgressReporterListener.eExecutionPhase.End, "Action", string.Format("{0} (ID:{1}, ParentID:{2}, ParentActivityID: {3})", action.Description, action.Guid, action.ExecutionParentGuid, mCurrentActivity?.Guid), AR,SourcePath);
Suggested change
string SourcePath = $"{WorkSpace.Instance?.RunsetExecutor?.RunSetConfig?.Name ?? "N/A"} -> {((GingerExecutionEngine)mContext?.Runner).GingerRunner.Name ?? "N/A"} -> {mContext?.BusinessFlow?.Name ?? "N/A"} -> {mCurrentActivity?.ActivityName ?? "N/A"} -> {(action?.ItemName ?? action?.Description ?? "N/A")}";
ExecutionProgressReporterListener.AddExecutionDetailsToLog(ExecutionProgressReporterListener.eExecutionPhase.End, "Action", string.Format("{0} (ID:{1}, ParentID:{2}, ParentActivityID: {3})", action.Description, action.Guid, action.ExecutionParentGuid, mCurrentActivity?.Guid), AR,SourcePath);
string runnerName = "N/A";
if (mContext?.Runner is GingerExecutionEngine gingerEngine)
{
runnerName = gingerEngine.GingerRunner?.Name ?? "N/A";
}
string SourcePath = $"{WorkSpace.Instance?.RunsetExecutor?.RunSetConfig?.Name ?? "N/A"} -> {runnerName} -> {mContext?.BusinessFlow?.Name ?? "N/A"} -> {mCurrentActivity?.ActivityName ?? "N/A"} -> {(action?.ItemName ?? action?.Description ?? "N/A")}";
ExecutionProgressReporterListener.AddExecutionDetailsToLog(ExecutionProgressReporterListener.eExecutionPhase.End, "Action", string.Format("{0} (ID:{1}, ParentID:{2}, ParentActivityID: {3})", action.Description, action.Guid, action.ExecutionParentGuid, mCurrentActivity?.Guid), AR, SourcePath);
🤖 Prompt for AI Agents
In Ginger/GingerCoreNET/Run/RunListenerLib/ExecutionLoggerManager.cs around
lines 604-605, the SourcePath construction can throw NullReferenceException or
InvalidCastException when mContext?.Runner is null or not a
GingerExecutionEngine; fix by using a safe cast and null propagation: assign a
local variable like var engine = mContext?.Runner as GingerExecutionEngine; then
get the runnerName = engine?.GingerRunner?.Name ?? "N/A"; finally build
SourcePath substituting this runnerName and using null-coalescing (?? "N/A") for
other parts so no member access occurs on null values.

@Maheshkale447
Maheshkale447 merged commit cc944e8 into Releases/Official-Release Oct 17, 2025
7 of 10 checks passed
@Maheshkale447
Maheshkale447 deleted the BugFix/ExecutionLoggerFix branch October 17, 2025 13:17
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