Skip to content

Revert#4401

Merged
ravirk91 merged 1 commit into
Releases/Official-Releasefrom
Revert-Report-Template-removal
Dec 24, 2025
Merged

Revert#4401
ravirk91 merged 1 commit into
Releases/Official-Releasefrom
Revert-Report-Template-removal

Conversation

@rathimayur

@rathimayur rathimayur commented Dec 23, 2025

Copy link
Copy Markdown
Contributor

Description

Type of Change

  • Bug fix - [ ] New feature - [ ] Breaking change - [ ] Plugin update

Checklist

  • PR description clearly describes the changes
  • Target branch is correct (master for features, Releases/* for fixes)
  • Latest code from target branch merged
  • No commented/junk code included
  • No new build warnings or errors
  • All existing unit tests pass
  • New unit tests added for new functionality
  • Cross-platform compatibility verified (Windows/Linux/macOS)
  • CI/CD pipeline passes
  • Code follows project conventions (Act{Platform}{Type}, {Platform}Driver)
  • Repository objects use [IsSerializedForLocalRepository] where needed
  • Error handling uses Reporter.ToLog() pattern
  • Documentation updated for user-facing changes
  • Self-review completed and code review comments addressed

Summary by CodeRabbit

  • New Features
    • Added comprehensive execution report pages displaying run sets, runners, business flows, activities, and action details.
    • Introduced donut/pie charts for visualizing execution statistics and pass/fail metrics.
    • Added responsive styling and icon support for professional-looking reports.
    • Enabled modal image viewer for displaying screenshots and visual artifacts.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 23, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR introduces a comprehensive set of HTML templates, CSS stylesheets, and JavaScript assets for Ginger Execution Reports. It adds structured report templates for multiple execution levels (Run Set, Ginger Runner, Business Flow, Activity Group, and Action), along with supporting styling and interactive components including chart rendering, modal viewers, and collapsible sections.

Changes

Cohort / File(s) Summary
Report HTML Templates
Ginger/Ginger/Reports/GingerExecutionReport/{RunSetReport.html, GingerRunnerReport.html, BusinessFlowReport.html, ActivityGroupReport.html, ActivityReport.html, ActionReport.html, GingerExecutionReport.html}
Adds seven new static HTML templates for rendering execution reports at different hierarchy levels. Each template uses placeholder syntax (e.g., {placeholder_name}) for dynamic content injection, includes breadcrumb navigation, collapsible detail panels, inline chart rendering via JSX scripts, and modal components for image viewing.
CSS Styling
Ginger/Ginger/Reports/GingerExecutionReport/assets/css/{styles.css, font-awesome.css}
Introduces comprehensive CSS foundation including global typography, responsive layout scaffolding, DataTable styling, modal and image interactions, status color indicators (Passed/Failed/Blocked/Stopped), utility classes, and FontAwesome 4.2.0 icon definitions.
JavaScript Libraries & Chart Rendering
Ginger/Ginger/Reports/GingerExecutionReport/assets/js/{jquery.js, bootstrap.js, circlechart.js, donutchart.js}
Adds jQuery and Bootstrap libraries as client-side dependencies, plus two CreateChart() functions that render donut/pie charts using Recharts and React for visualizing pass/fail/stopped statistics with colored segments and centered labels.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • Maheshkale447

Poem

🐰 Hop, hop—new reports are here to stay,
Templates bloom in every way!
Charts spin round with colors bright,
From Ginger runs to Actions' flight,
Bootstrap dancing, jQuery's cheer—
Execution reports, crystal clear!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is empty with only the template structure present; no actual description of changes, rationale, or type of change is provided. Complete the description section with a clear explanation of what was reverted and why, select the appropriate type of change, and mark relevant checklist items as completed.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Revert' is too vague and does not clearly indicate what is being reverted or why. Provide a more descriptive title indicating what is being reverted, such as 'Revert: Remove Report Templates' or similar to clarify the scope of the change.
✨ 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 Revert-Report-Template-removal

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: 27

📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a02ce13 and 485a1c7.

⛔ Files ignored due to path filters (16)
  • Ginger/Ginger/Reports/GingerExecutionReport/Images/GingerLogo.png is excluded by !**/*.png, !**/*.png
  • Ginger/Ginger/Reports/GingerExecutionReport/PreviewDummyReport/RunSet.zip is excluded by !**/*.zip, !**/*.zip
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/fonts/SourceSansPro-Regular.ttf is excluded by !**/*.ttf, !**/*.ttf
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/fonts/fontawesome-webfont.eot is excluded by !**/*.eot, !**/*.eot
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/fonts/fontawesome-webfont.ttf is excluded by !**/*.ttf, !**/*.ttf
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/img/@BeatLogo - Copy.png is excluded by !**/*.png, !**/*.png
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/img/@BeatLogo.png is excluded by !**/*.png, !**/*.png
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/img/@Ginger - Copy.png is excluded by !**/*.png, !**/*.png
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/img/@Ginger.png is excluded by !**/*.png, !**/*.png
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/img/@item_next.png is excluded by !**/*.png, !**/*.png
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/img/@item_prev.png is excluded by !**/*.png, !**/*.png
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/img/comments-icon.jpg is excluded by !**/*.jpg, !**/*.jpg
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/js/Recharts.min.js is excluded by !**/*.min.js, !**/*.min.js
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/js/prop-types.min.js is excluded by !**/*.min.js, !**/*.min.js
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/js/react-dom.min.js is excluded by !**/*.min.js, !**/*.min.js
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/js/react-with-addons.min.js is excluded by !**/*.min.js, !**/*.min.js
📒 Files selected for processing (15)
  • Ginger/Ginger/Reports/GingerExecutionReport/ActionReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/ActivityGroupReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/ActivityReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/BusinessFlowReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/GingerExecutionReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/GingerRunnerReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/RunSetReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/css/bootstrap.css
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/css/font-awesome.css
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/css/styles.css
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/js/babel.js
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/js/bootstrap.js
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/js/circlechart.js
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/js/donutchart.js
  • Ginger/Ginger/Reports/GingerExecutionReport/assets/js/jquery.js
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-09-16T16:34:20.667Z
Learnt from: GokulBothe99
Repo: Ginger-Automation/Ginger PR: 3909
File: Ginger/Ginger/RunSetPageLib/NewRunSetPage.xaml.cs:2328-2346
Timestamp: 2024-09-16T16:34:20.667Z
Learning: In `NewRunSetPage.xaml.cs`, the methods `GenerateHTMLReportFromRemote()` and `GenerateHTMLReportFromLocal()` are kept separate because the application first tries to load remote data, and if not found, it falls back to loading local data.

Applied to files:

  • Ginger/Ginger/Reports/GingerExecutionReport/BusinessFlowReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/ActionReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/ActivityReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/GingerRunnerReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/GingerExecutionReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/ActivityGroupReport.html
  • Ginger/Ginger/Reports/GingerExecutionReport/RunSetReport.html
📚 Learning: 2025-11-28T05:32:43.529Z
Learnt from: CR
Repo: Ginger-Automation/Ginger PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T05:32:43.529Z
Learning: Applies to **/{GingerCore,GingerCoreNET,GingerCoreCommon}/Actions/Act*.cs : Name actions following the pattern: `Act{PlatformType}{ActionType}` (e.g., `ActBrowserElement`, `ActConsoleCommand`)

Applied to files:

  • Ginger/Ginger/Reports/GingerExecutionReport/ActionReport.html
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: prashelke
Repo: Ginger-Automation/Ginger PR: 0
File: :0-0
Timestamp: 2024-07-26T22:04:12.930Z
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.

Applied to files:

  • Ginger/Ginger/Reports/GingerExecutionReport/ActivityGroupReport.html
🧬 Code graph analysis (1)
Ginger/Ginger/Reports/GingerExecutionReport/assets/js/circlechart.js (1)
Ginger/Ginger/Reports/GingerExecutionReport/assets/js/donutchart.js (3)
  • inputData (2-2)
  • Recharts (10-10)
  • DonutChart (59-76)
🪛 Biome (2.1.2)
Ginger/Ginger/Reports/GingerExecutionReport/assets/css/font-awesome.css

[error] 4-4: Unexpected value or character.

Expected one of:

(parse)


[error] 4-4: Unexpected value or character.

Expected one of:

(parse)


[error] 4-4: Unexpected value or character.

Expected one of:

(parse)


[error] 4-4: Unexpected value or character.

Expected one of:

(parse)


[error] 4-4: Unexpected value or character.

Expected one of:

(parse)


[error] 4-4: Generic font family missing.

Consider adding a generic font family as a fallback.
For examples and more information, see the MDN Web Docs

(lint/a11y/useGenericFontNames)

Ginger/Ginger/Reports/GingerExecutionReport/assets/js/jquery.js

[error] 1-1: Comparing to itself is potentially pointless.

(lint/suspicious/noSelfCompare)


[error] 1-1: Do not add then to an object.

(lint/suspicious/noThenProperty)


[error] 1-1: Comparing to itself is potentially pointless.

(lint/suspicious/noSelfCompare)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: Do not reassign a function declaration.

Reassigned here.

Reassigned here.

Reassigned here.

Use a local variable instead.

(lint/suspicious/noFunctionAssign)


[error] 1-1: eval() exposes to security risks and performance issues.

See the MDN web docs for more details.
Refactor the code so that it doesn't need to call eval().

(lint/security/noGlobalEval)

Ginger/Ginger/Reports/GingerExecutionReport/assets/css/styles.css

[error] 1-1: Unexpected value or character.

Expected one of:

(parse)


[error] 1-1: Unexpected value or character.

Expected one of:

(parse)


[error] 1-1: Unknown type selector is not allowed.

See MDN web docs for more details.
Consider replacing the unknown type selector with valid one.

(lint/correctness/noUnknownTypeSelector)


[error] 1-1: Generic font family missing.

Consider adding a generic font family as a fallback.
For examples and more information, see the MDN Web Docs

(lint/a11y/useGenericFontNames)


[error] 1-1: Generic font family missing.

Consider adding a generic font family as a fallback.
For examples and more information, see the MDN Web Docs

(lint/a11y/useGenericFontNames)


[error] 1-1: Generic font family missing.

Consider adding a generic font family as a fallback.
For examples and more information, see the MDN Web Docs

(lint/a11y/useGenericFontNames)


[error] 1-1: Generic font family missing.

Consider adding a generic font family as a fallback.
For examples and more information, see the MDN Web Docs

(lint/a11y/useGenericFontNames)


[error] 1-1: Duplicate properties can lead to unexpected behavior and may override previous declarations unintentionally.

background-color is already defined here.

Remove or rename the duplicate property to ensure consistent styling.

(lint/suspicious/noDuplicateProperties)

🔇 Additional comments (3)
Ginger/Ginger/Reports/GingerExecutionReport/RunSetReport.html (1)

157-159: Verify template placeholder syntax consistency.

The { js_to_place } has spaces around the braces, unlike other placeholders like {css_path}. Ensure this matches the template engine's expected format.

Ginger/Ginger/Reports/GingerExecutionReport/assets/js/donutchart.js (1)

11-44: Deprecated React API: React.createClass was removed in React 16.

React.createClass and global PropTypes are deprecated patterns. This code will fail with modern React versions without the create-react-class and prop-types npm packages.

Ginger/Ginger/Reports/GingerExecutionReport/GingerRunnerReport.html (1)

1-244: Template structure looks good overall.

The HTML structure is valid, uses proper DOCTYPE, and follows the established pattern of other report templates. The collapsible sections, breadcrumbs, and chart integration are consistent with the suite of report templates.

Comment on lines +39 to +49
<a href=".\..\..\..\..\GingerExecutionReport.html">{Parent_RunSetReport_Name_Link}</a>
<small>
{Parent_RunSetReport_delimiter}
<a href=".\..\..\..\GingerRunnerReport.html">{Parent_GingerRunner_Name_Link}</a>
{Parent_GingerRunner_delimiter}
<a href=".\..\..\BusinessFlowReport.html">{Parent_BusinessFlow_Name_Link}</a>
{Parent_BusinessFlow_delimiter}
<!--ActivitiesGroupLink-->
<a href=".\..\ActivityReport.html">{Parent_Activity_Name_Link}</a>
{Parent_Activity_delimiter}
<a href=".\ActionReport.html">{Parent_Action_Name}</a>

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 | 🔵 Trivial

Windows-specific path separators in href attributes.

The relative paths use backslashes (e.g., .\..\..\..\..\GingerExecutionReport.html) which are Windows-specific. While most browsers handle this, using forward slashes is the standard for URLs and ensures cross-platform compatibility.

🔎 Proposed fix for breadcrumb paths
-                                    <a href=".\..\..\..\..\GingerExecutionReport.html">{Parent_RunSetReport_Name_Link}</a>
+                                    <a href="./../../../../GingerExecutionReport.html">{Parent_RunSetReport_Name_Link}</a>
                                     <small>
                                         {Parent_RunSetReport_delimiter}
-                                        <a href=".\..\..\..\GingerRunnerReport.html">{Parent_GingerRunner_Name_Link}</a>
+                                        <a href="./../../../GingerRunnerReport.html">{Parent_GingerRunner_Name_Link}</a>
                                         {Parent_GingerRunner_delimiter}
-                                        <a href=".\..\..\BusinessFlowReport.html">{Parent_BusinessFlow_Name_Link}</a>
+                                        <a href="./../../BusinessFlowReport.html">{Parent_BusinessFlow_Name_Link}</a>
                                         {Parent_BusinessFlow_delimiter}
                                         <!--ActivitiesGroupLink-->
-                                        <a href=".\..\ActivityReport.html">{Parent_Activity_Name_Link}</a>
+                                        <a href="./../ActivityReport.html">{Parent_Activity_Name_Link}</a>
                                         {Parent_Activity_delimiter}
-                                        <a href=".\ActionReport.html">{Parent_Action_Name}</a>
+                                        <a href="./ActionReport.html">{Parent_Action_Name}</a>
                                     </small>
📝 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
<a href=".\..\..\..\..\GingerExecutionReport.html">{Parent_RunSetReport_Name_Link}</a>
<small>
{Parent_RunSetReport_delimiter}
<a href=".\..\..\..\GingerRunnerReport.html">{Parent_GingerRunner_Name_Link}</a>
{Parent_GingerRunner_delimiter}
<a href=".\..\..\BusinessFlowReport.html">{Parent_BusinessFlow_Name_Link}</a>
{Parent_BusinessFlow_delimiter}
<!--ActivitiesGroupLink-->
<a href=".\..\ActivityReport.html">{Parent_Activity_Name_Link}</a>
{Parent_Activity_delimiter}
<a href=".\ActionReport.html">{Parent_Action_Name}</a>
<a href="./../../../../GingerExecutionReport.html">{Parent_RunSetReport_Name_Link}</a>
<small>
{Parent_RunSetReport_delimiter}
<a href="./../../../GingerRunnerReport.html">{Parent_GingerRunner_Name_Link}</a>
{Parent_GingerRunner_delimiter}
<a href="./../../BusinessFlowReport.html">{Parent_BusinessFlow_Name_Link}</a>
{Parent_BusinessFlow_delimiter}
<!--ActivitiesGroupLink-->
<a href="./../ActivityReport.html">{Parent_Activity_Name_Link}</a>
{Parent_Activity_delimiter}
<a href="./ActionReport.html">{Parent_Action_Name}</a>
🤖 Prompt for AI Agents
In Ginger/Ginger/Reports/GingerExecutionReport/ActionReport.html around lines 39
to 49, the breadcrumb href attributes use Windows backslashes (e.g.,
.\..\..\..\..\GingerExecutionReport.html); update all of these hrefs to use
standard URL forward slashes (e.g., ./../../../../GingerExecutionReport.html) so
the links are cross-platform and conform to URL conventions, making the change
for every anchor in that block.

<div id="myModal" class="modal">
<span class="close">&times;</span>
<img class="modal-content" id="current_image_in_modal">
<div id="caption">sdafasd asdfasdf</div>

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 | 🟡 Minor

Remove debug/placeholder text from modal caption.

The caption contains what appears to be debug text "sdafasd asdfasdf". This should be replaced with an empty string or meaningful placeholder since the actual caption is set dynamically via JavaScript.

🔎 Proposed fix
-                <div id="caption">sdafasd asdfasdf</div>
+                <div id="caption"></div>
📝 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
<div id="caption">sdafasd asdfasdf</div>
<div id="caption"></div>
🤖 Prompt for AI Agents
In Ginger/Ginger/Reports/GingerExecutionReport/ActionReport.html around line
190, replace the debug placeholder text in the caption div so it no longer
contains "sdafasd asdfasdf"; set the div content to an empty string or a neutral
placeholder (e.g., "") since the real caption is populated dynamically by
JavaScript, and ensure no leftover debug text remains.

Comment on lines +222 to +224
if ((folderName == null) || (Name == null) || (ActivitiesGroupCalledAsRoot == null) || (folderName == '') || (Name == '')) {
return null;
}

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 | 🔵 Trivial

Unnecessary return null statement.

Returning a value from window.onload has no effect. Consider using an early return; without a value, or restructure the logic to avoid the early exit.

🔎 Proposed fix
                     if ((folderName == null) || (Name == null) || (ActivitiesGroupCalledAsRoot == null) || (folderName == '') || (Name == '')) {
-                        return null;
+                        return;
                     }
📝 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
if ((folderName == null) || (Name == null) || (ActivitiesGroupCalledAsRoot == null) || (folderName == '') || (Name == '')) {
return null;
}
if ((folderName == null) || (Name == null) || (ActivitiesGroupCalledAsRoot == null) || (folderName == '') || (Name == '')) {
return;
}
🤖 Prompt for AI Agents
In Ginger/Ginger/Reports/GingerExecutionReport/ActionReport.html around lines
222 to 224, the window.onload handler contains an unnecessary "return null;"
which has no effect; replace it with an early "return;" (no value) or remove the
return entirely and restructure the conditional so the function exits early
without returning a value, ensuring any cleanup or post-check logic after this
block still runs as intended.

Comment on lines +226 to +231
document.body.innerHTML = document.body.innerHTML.replace("<!--activitiesgroupquerystring-->", "?Parent_ActivitiesGroup_Folder_Name=" + folderName + "&Parent_ActivitiesGroup_Name=" + Name);
if (ActivitiesGroupCalledAsRoot == 'true') {
document.body.innerHTML = document.body.innerHTML.replace("<!--ActivitiesGroupLink-->", "<a href='.\/..\/ActivityGroupReport.html'>" + Name + " </a><i class='ace-icon fa fa-angle-double-right clsc1'></i>");
}
else {
document.body.innerHTML = document.body.innerHTML.replace("<!--ActivitiesGroupLink-->", "<a href='.\/..\/ActivityGroups\/" + folderName + "\/ActivityGroupReport.html'>" + Name + " </a><i class='ace-icon fa fa-angle-double-right clsc1'></i>");

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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, locate the file
find . -name "ActionReport.html" -type f 2>/dev/null | head -20

Repository: Ginger-Automation/Ginger

Length of output: 131


🏁 Script executed:

# Check the file exists and view the relevant lines
if [ -f "Ginger/Ginger/Reports/GingerExecutionReport/ActionReport.html" ]; then
  wc -l "Ginger/Ginger/Reports/GingerExecutionReport/ActionReport.html"
  sed -n '220,235p' "Ginger/Ginger/Reports/GingerExecutionReport/ActionReport.html"
fi

Repository: Ginger-Automation/Ginger

Length of output: 1475


🏁 Script executed:

# Search for sanitization functions and parameter handling
rg -n "Parent_ActivitiesGroup|folderName|ActivitiesGroup" --type html -A 3 -B 3

Repository: Ginger-Automation/Ginger

Length of output: 8030


🏁 Script executed:

# Search for sanitization/encoding in C# code related to report generation
rg -n "ActivitiesGroup|folderName|encodeURI|HttpUtility\.HtmlEncode|SecurityUtility|XmlEncode|sanitize" --type cs -C 2 | head -100

Repository: Ginger-Automation/Ginger

Length of output: 8054


🏁 Script executed:

# Look for where these template variables are being set
rg -n "activitiesgroupquerystring|ActivitiesGroupLink" --type cs -C 3

Repository: Ginger-Automation/Ginger

Length of output: 3085


🏁 Script executed:

# Search for getQueryStringParameterByName function definition
rg -n "getQueryStringParameterByName" --type html -B 2 -A 5

Repository: Ginger-Automation/Ginger

Length of output: 4589


🏁 Script executed:

# Search for where these URLs are generated in C# - look for query parameter building
rg -n "Parent_ActivitiesGroup_Folder_Name|Parent_ActivitiesGroup_Name|ActivitiesGroupCalledAsRoot" --type cs -B 3 -A 3 | head -150

Repository: Ginger-Automation/Ginger

Length of output: 3766


🏁 Script executed:

# Find folderNameNormalazing method definition
rg -n "folderNameNormalazing" --type cs -B 2 -A 10 | head -60

Repository: Ginger-Automation/Ginger

Length of output: 7483


🏁 Script executed:

# Find OverrideHTMLRelatedCharacters method definition
rg -n "OverrideHTMLRelatedCharacters" --type cs -B 2 -A 15 | head -80

Repository: Ginger-Automation/Ginger

Length of output: 12178


Confirmed XSS vulnerability with innerHTML replacement.

Using document.body.innerHTML replacement with string concatenation directly inserts unsanitized query parameters into the DOM. The backend's folderNameNormalazing() only removes filesystem-invalid characters but does not HTML-encode dangerous characters like quotes and angle brackets. The OverrideHTMLRelatedCharacters() function provides only partial encoding (missing quote escaping) and is applied only to display text, not URL parameters. Since folderName and Name parameters come from query strings and reach the client-side unencoded, an attacker can craft malicious folder or activity group names containing HTML/JavaScript payloads (e.g., "><script>alert('XSS')</script>) that execute when the report is rendered.

Use DOM manipulation with textContent for user values, or properly HTML-encode all parameters before inserting via innerHTML. Alternatively, use encodeURIComponent() for URL parameters and ensure complete HTML entity encoding (including quotes) for all user-controlled content.

🤖 Prompt for AI Agents
In Ginger/Ginger/Reports/GingerExecutionReport/ActionReport.html around lines
226-231, the code uses document.body.innerHTML.replace with concatenated
folderName and Name, creating an XSS vector; replace this pattern by building
DOM nodes and attributes safely: compute URL query parts with
encodeURIComponent(folderName) and encodeURIComponent(Name) for hrefs, create an
<a> element with its href set via element.setAttribute or element.href and set
the link text via element.textContent (not innerHTML), and insert the element
into the DOM (or replace the placeholder node) instead of using innerHTML;
similarly ensure any visible text is assigned via textContent and any attributes
receive URL-encoded values to fully neutralize special characters (including
quotes).

@@ -0,0 +1,198 @@
<html lang="en">

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 | 🟡 Minor

Missing DOCTYPE declaration.

The file is missing the <!DOCTYPE html> declaration, which can cause browsers to render the page in quirks mode.

🔎 Proposed fix
+<!DOCTYPE html>
 <html lang="en">
📝 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
<html lang="en">
<!DOCTYPE html>
<html lang="en">
🤖 Prompt for AI Agents
In Ginger/Ginger/Reports/GingerExecutionReport/ActivityGroupReport.html around
lines 1 to 1, the document is missing the required DOCTYPE declaration; add
<!DOCTYPE html> as the very first line of the file (before the <html> tag) so
browsers render in standards mode.

Comment on lines +15 to +16
{js_path}
{js_path}

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 | 🟠 Major

Duplicate {js_path} placeholder.

The {js_path} placeholder appears twice on consecutive lines, which would result in JavaScript files being included twice. This can cause duplicate variable declarations, re-execution of initialization code, and increased page load time.

🔎 Proposed fix
     {canvas_path}
     {js_path}
-    {js_path}
     <script type="text/javascript">
📝 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
{js_path}
{js_path}
{js_path}
🤖 Prompt for AI Agents
In Ginger/Ginger/Reports/GingerExecutionReport/GingerExecutionReport.html around
lines 15-16, the `{js_path}` placeholder is duplicated causing the same script
to be injected twice; remove the duplicate so each JS path is emitted only once
(either delete the second `{js_path}` line or modify the template logic to
deduplicate/iterate unique script paths before rendering) and validate the
source that supplies `{js_path}` to ensure it doesn't return duplicates.

<div class="col-xs-12">
<div class="row">
<div class="col-xs-12">
<!--TEMP!!!-->

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 | 🟡 Minor

Remove TODO/debug comment.

The <!--TEMP!!!--> comment suggests temporary code that should be addressed before release.

🔎 Proposed fix
-                                        <!--TEMP!!!-->
                                         <div class="panel-heading">
📝 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
<!--TEMP!!!-->
<div class="panel-heading">
🤖 Prompt for AI Agents
In Ginger/Ginger/Reports/GingerExecutionReport/GingerExecutionReport.html around
line 110, remove the temporary debug HTML comment "<!--TEMP!!!-->" since it is
leftover debug/TODO markup; either delete the comment or replace it with the
intended final content or a meaningful TODO with JIRA/issue reference if work
remains, and run/build to verify no visual or functional regressions.

<div id="myModal" class="modal">
<span class="close">&times;</span>
<img class="modal-content" id="current_image_in_modal">
<div id="caption">sdafasd asdfasdf</div>

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 | 🟡 Minor

Remove debug/placeholder text from modal caption.

The caption contains debug text "sdafasd asdfasdf". This should be cleaned up.

🔎 Proposed fix
-            <div id="caption">sdafasd asdfasdf</div>
+            <div id="caption"></div>
📝 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
<div id="caption">sdafasd asdfasdf</div>
<div id="caption"></div>
🤖 Prompt for AI Agents
In Ginger/Ginger/Reports/GingerExecutionReport/GingerExecutionReport.html around
line 297, the modal caption contains debug placeholder text "sdafasd asdfasdf";
remove this placeholder and replace it with the intended caption (e.g., a
meaningful label like "Execution Report" or the dynamic/report title variable
used elsewhere), or if no caption is required remove the <div id="caption">
element entirely; ensure the markup remains valid and any CSS/JS that expects
#caption still works by updating references if you remove or rename it.

<div id="myModal" class="modal">
<span class="close">&times;</span>
<img class="modal-content" id="current_image_in_modal">
<div id="caption">sdafasd asdfasdf</div>

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 | 🟡 Minor

Remove debug/placeholder text from modal caption.

The caption contains debug text "sdafasd asdfasdf". This should be cleaned up.

🔎 Proposed fix
-            <div id="caption">sdafasd asdfasdf</div>
+            <div id="caption"></div>
📝 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
<div id="caption">sdafasd asdfasdf</div>
<div id="caption"></div>
🤖 Prompt for AI Agents
In Ginger/Ginger/Reports/GingerExecutionReport/GingerRunnerReport.html around
line 216, the modal caption currently contains placeholder debug text "sdafasd
asdfasdf"; remove that debug text and replace it with the correct caption
(either the intended static text, an empty string if caption is not used, or the
appropriate localized/templated value), ensuring the element id="caption"
contains meaningful content or is omitted if unnecessary.

<div id="myModal" class="modal">
<span class="close">&times;</span>
<img class="modal-content" id="current_image_in_modal">
<div id="caption">sdafasd asdfasdf</div>

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 | 🟡 Minor

Remove placeholder debug text from modal caption.

Same issue as in ActivityReport.html — the caption contains debug/placeholder text "sdafasd asdfasdf".

🔎 Proposed fix
-            <div id="caption">sdafasd asdfasdf</div>
+            <div id="caption"></div>
📝 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
<div id="caption">sdafasd asdfasdf</div>
<div id="caption"></div>
🤖 Prompt for AI Agents
In Ginger/Ginger/Reports/GingerExecutionReport/RunSetReport.html around line
164, the modal caption contains placeholder debug text "sdafasd asdfasdf";
remove this placeholder and replace it with the intended caption text or bind it
to the proper localized/property value (e.g., use the modal's real title
variable or a meaningful static label like "Run Set Details") so the UI shows
the correct caption instead of debug text.

@ravirk91
ravirk91 merged commit a3141fc into Releases/Official-Release Dec 24, 2025
16 of 19 checks passed
@ravirk91
ravirk91 deleted the Revert-Report-Template-removal branch December 24, 2025 06:56
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