Increase folder name limit to 255 chars in report configs#4486
Conversation
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.
WalkthroughThe changes increase the maximum folder path length validation from 100 to 255 characters and introduce a new user message key Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
Ginger/Ginger/Reports/HTMLReportAttachmentConfigurationPage.xaml.csGinger/GingerCoreCommon/ReporterLib/UserMsgsPool.cs
| else if (extraInformationCalculated.Length > 255) | ||
| { | ||
| Reporter.ToUser(eUserMsgKey.FolderNamesAreTooLong); | ||
| Reporter.ToUser(eUserMsgKey.FolderPathsAreTooLong); |
There was a problem hiding this comment.
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) }, |
There was a problem hiding this comment.
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.
| { 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.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
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
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
Checklist
[IsSerializedForLocalRepository]where neededReporter.ToLog()patternSummary by CodeRabbit