Skip to content

Increase folder name limit to 255 chars in report configs#4486

Merged
ravirk91 merged 1 commit into
masterfrom
bugfix/64225_folder-path-long-error-handling
Apr 23, 2026
Merged

Increase folder name limit to 255 chars in report configs#4486
ravirk91 merged 1 commit into
masterfrom
bugfix/64225_folder-path-long-error-handling

Conversation

@tanushahande2003
Copy link
Copy Markdown
Contributor

@tanushahande2003 tanushahande2003 commented Apr 22, 2026

Raised the maximum allowed folder name length from 100 to 255 characters in all report-related configuration pages. Updated validation logic and user messages to reflect the new limit.

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

  • Bug Fixes
    • Increased maximum allowed length for HTML report attachment folder paths from 100 to 255 characters.
    • Updated validation error message to more accurately reflect folder path length constraints.

Raised the maximum allowed folder name length from 100 to 255 characters in all report-related configuration pages. Updated validation logic and user messages to reflect the new limit.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

Walkthrough

The changes increase the maximum folder path length validation from 100 to 255 characters and introduce a new user message key FolderPathsAreTooLong to provide more specific validation feedback when users exceed the folder path length limit.

Changes

Cohort / File(s) Summary
HTML Report Configuration Validation
Ginger/Ginger/Reports/HTMLReportAttachmentConfigurationPage.xaml.cs
Increased max length check for extraInformationCalculated from 100 to 255 when alternative HTML report folder is enabled; updated validation message key from FolderNamesAreTooLong to FolderPathsAreTooLong.
User Message Dictionary
Ginger/GingerCoreCommon/ReporterLib/UserMsgsPool.cs
Added new enum member FolderPathsAreTooLong to eUserMsgKey and corresponding message entry in LoadUserMsgsPool() dictionary with validation text for 255-character limit.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • ravirk91
  • MeniKadosh1

Poem

🐰 A path now stretches long and wide,
From one-to-five, with room to ride!
New messages spring forth with cheer,
Validation whispers, crystal clear!
Hop along, the validation's bright!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lacks critical detail and only contains a header line; the main description section is empty and most checklist items are unchecked without explanation. Fill in the Description section with detailed explanation of changes, check applicable Type of Change box, and verify checklist items or explain why they don't apply.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: increasing the folder name limit to 255 characters in report configuration files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/64225_folder-path-long-error-handling

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Ginger/Ginger/Reports/HTMLReportAttachmentConfigurationPage.xaml.cs`:
- Around line 148-150: Update the remaining report configuration validators so
they match the 255-char limit and error key used in
HTMLReportAttachmentConfigurationPage: find the length checks in
HTMLReportsConfigurationPage.xaml.cs and ExecutionResultsConfiguration.xaml.cs
that currently enforce >100 and call
Reporter.ToUser(eUserMsgKey.FolderNamesAreTooLong); change the numeric check to
>255 and update the Reporter.ToUser call to use
eUserMsgKey.FolderPathsAreTooLong so users aren’t blocked by the old 100-char
limit or shown the wrong message.

In `@Ginger/GingerCoreCommon/ReporterLib/UserMsgsPool.cs`:
- Line 619: Update the validation message for eUserMsgKey.FolderPathsAreTooLong
so it matches the actual check (allows exactly 255 chars): change the text
passed to the UserMsg constructor from "Please change them to be less than 255
characters" to phrasing like "Please change them to be at most 255 characters"
or "255 characters or fewer" so the wording is not off-by-one; locate the entry
with eUserMsgKey.FolderPathsAreTooLong and modify its detail string accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8dd11bbf-107d-4b57-b1d7-dffe38268774

📥 Commits

Reviewing files that changed from the base of the PR and between 8556808 and a6d52bc.

📒 Files selected for processing (2)
  • Ginger/Ginger/Reports/HTMLReportAttachmentConfigurationPage.xaml.cs
  • Ginger/GingerCoreCommon/ReporterLib/UserMsgsPool.cs

Comment on lines +148 to +150
else if (extraInformationCalculated.Length > 255)
{
Reporter.ToUser(eUserMsgKey.FolderNamesAreTooLong);
Reporter.ToUser(eUserMsgKey.FolderPathsAreTooLong);
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

Finish updating the other report configuration validators.

This page now allows 255 characters, but Ginger/Ginger/Reports/HTMLReportsConfigurationPage.xaml.cs:172-180 and Ginger/Ginger/Reports/ExecutionResultsConfiguration.xaml.cs:150-158 still reject values over 100 and show FolderNamesAreTooLong. Users will still hit the old limit in those report config pages.

🐛 Proposed fix for the remaining report pages
- if (HTMLReportFolderTextBox.Text.Length > 100)
+ if (HTMLReportFolderTextBox.Text.Length > 255)
  {
-     Reporter.ToUser(eUserMsgKey.FolderNamesAreTooLong);
+     Reporter.ToUser(eUserMsgKey.FolderPathsAreTooLong);
      return;
  }
- if (FolderTextBox.Text.Length > 100)
+ if (FolderTextBox.Text.Length > 255)
  {
-     Reporter.ToUser(eUserMsgKey.FolderNamesAreTooLong);
+     Reporter.ToUser(eUserMsgKey.FolderPathsAreTooLong);
      return;
  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Ginger/Ginger/Reports/HTMLReportAttachmentConfigurationPage.xaml.cs` around
lines 148 - 150, Update the remaining report configuration validators so they
match the 255-char limit and error key used in
HTMLReportAttachmentConfigurationPage: find the length checks in
HTMLReportsConfigurationPage.xaml.cs and ExecutionResultsConfiguration.xaml.cs
that currently enforce >100 and call
Reporter.ToUser(eUserMsgKey.FolderNamesAreTooLong); change the numeric check to
>255 and update the Reporter.ToUser call to use
eUserMsgKey.FolderPathsAreTooLong so users aren’t blocked by the old 100-char
limit or shown the wrong message.

{ eUserMsgKey.ReportTemplateNotFound, new UserMsg(eUserMsgType.ERROR, "Report Template", "Report Template '{0}' not found", eUserMsgOption.OK, eUserMsgSelection.None) },
{ eUserMsgKey.AutomationTabExecResultsNotExists, new UserMsg(eUserMsgType.WARN, "Execution Results are not existing", "Results from last execution are not existing (yet). Nothing to report, please wait for execution finish and click on report creation.", eUserMsgOption.OK, eUserMsgSelection.None) },
{ eUserMsgKey.FolderNamesAreTooLong, new UserMsg(eUserMsgType.WARN, "Folders Names Are Too Long", "Provided folders names are too long. Please change them to be less than 100 characters", eUserMsgOption.OK, eUserMsgSelection.None) },
{ eUserMsgKey.FolderPathsAreTooLong, new UserMsg(eUserMsgType.WARN, "Folder Paths Are Too Long", "Provided folder paths are too long. Please change them to be less than 255 characters", eUserMsgOption.OK, eUserMsgSelection.None) },
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

Fix the off-by-one wording in the validation message.

The code allows exactly 255 characters, but the message says “less than 255 characters.” Use wording that matches the validation.

✏️ Proposed wording fix
- { eUserMsgKey.FolderPathsAreTooLong, new UserMsg(eUserMsgType.WARN, "Folder Paths Are Too Long", "Provided folder paths are too long. Please change them to be less than 255 characters", eUserMsgOption.OK, eUserMsgSelection.None) },
+ { eUserMsgKey.FolderPathsAreTooLong, new UserMsg(eUserMsgType.WARN, "Folder Paths Are Too Long", "Provided folder paths are too long. Please change them to be 255 characters or fewer.", eUserMsgOption.OK, eUserMsgSelection.None) },
📝 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
{ eUserMsgKey.FolderPathsAreTooLong, new UserMsg(eUserMsgType.WARN, "Folder Paths Are Too Long", "Provided folder paths are too long. Please change them to be less than 255 characters", eUserMsgOption.OK, eUserMsgSelection.None) },
{ eUserMsgKey.FolderPathsAreTooLong, new UserMsg(eUserMsgType.WARN, "Folder Paths Are Too Long", "Provided folder paths are too long. Please change them to be 255 characters or fewer.", eUserMsgOption.OK, eUserMsgSelection.None) },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Ginger/GingerCoreCommon/ReporterLib/UserMsgsPool.cs` at line 619, Update the
validation message for eUserMsgKey.FolderPathsAreTooLong so it matches the
actual check (allows exactly 255 chars): change the text passed to the UserMsg
constructor from "Please change them to be less than 255 characters" to phrasing
like "Please change them to be at most 255 characters" or "255 characters or
fewer" so the wording is not off-by-one; locate the entry with
eUserMsgKey.FolderPathsAreTooLong and modify its detail string accordingly.

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes. Give us feedback

@ravirk91 ravirk91 merged commit 2cc0107 into master Apr 23, 2026
14 checks passed
@ravirk91 ravirk91 deleted the bugfix/64225_folder-path-long-error-handling branch April 23, 2026 11:38
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