Handled the file name length while api model configuration, and added…#4390
Conversation
… length to subfolder creation
WalkthroughTwo localized changes: API model name generation now uses Operation.Summary converted to string and truncated to 50 characters with a fallback to OperationId; and a textbox in an input dialog gains a MaxLength="30" constraint to limit user input. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
✨ Finishing touches
🧪 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
📜 Review details
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
Ginger/GingerAutoPilot/APIModelLib/SwaggerApi/OpenApiBase.csGinger/GingerCore/GeneralLib/InputBoxWindow.xaml
🧰 Additional context used
📓 Path-based instructions (1)
**/*.cs
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use
Reporter.ToLog(eLogLevel.ERROR, message)for logging errors
Files:
Ginger/GingerAutoPilot/APIModelLib/SwaggerApi/OpenApiBase.cs
🧠 Learnings (3)
📚 Learning: 2025-12-18T05:29:42.896Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4385
File: Ginger/GingerCoreNET/Run/Excels/ExcelNPOIOperations.cs:468-475
Timestamp: 2025-12-18T05:29:42.896Z
Learning: In the Ginger codebase, assume file extensions are lowercase (e.g., .xlsx, .xls). Do not perform case-insensitive extension checks (such as StringComparison.OrdinalIgnoreCase) when using EndsWith() or similar methods to verify file extensions; rely on lowercase comparisons or convert to lowercase first. This ensures consistency and avoids unnecessary case-insensitive comparisons across C# source files.
Applied to files:
Ginger/GingerAutoPilot/APIModelLib/SwaggerApi/OpenApiBase.cs
📚 Learning: 2025-08-26T07:40:08.345Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4285
File: Ginger/Ginger/Actions/ActionEditPages/ActSecurityTestingEditPage.xaml:23-23
Timestamp: 2025-08-26T07:40:08.345Z
Learning: In the Ginger codebase ActSecurityTestingEditPage.xaml file, the large bottom margin of 530 on the "Acceptable Alerts" label (Margin="10,10,0,530") is intentional design choice, not an error.
Applied to files:
Ginger/GingerCore/GeneralLib/InputBoxWindow.xaml
📚 Learning: 2025-12-18T05:19:56.687Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4385
File: Ginger/Ginger/Actions/ActionEditPages/ActExcelEditPage.xaml:0-0
Timestamp: 2025-12-18T05:19:56.687Z
Learning: In XAML DataTriggers, enum properties can be compared to string values because WPF automatically converts enums to strings during evaluation. This pattern is valid for XAML files like ActExcelEditPage.xaml where eExcelActionType is compared to string literals such as "ReadCellByIndex" or "GetSheetDetails". Apply this guideline broadly to XAML files that bind to enum properties; verify that such comparisons behave as expected in the specific UI components and avoid relying on string literals if the enum values change.
Applied to files:
Ginger/GingerCore/GeneralLib/InputBoxWindow.xaml
🔇 Additional comments (1)
Ginger/GingerAutoPilot/APIModelLib/SwaggerApi/OpenApiBase.cs (1)
116-121: Add duplicate name detection and logging when collision risk is detected.Truncating
Operation.Summaryto 50 characters can cause naming collisions when multiple operations share the same first 50 characters and content type. While the code appends suffixes like-JSON,-XML, and-UrlEncodedfor different body types, operations with identical first 50 characters and the same request body type would produce duplicateAAM.Namevalues.Additionally, the
avoidDuplicatesNodesparameter exists in theParseDocumentmethod signature but is not passed toSwaggerVer2.SwaggerTwo()orOpenApiVer3.OpenApiThree(), making duplicate detection unavailable for Swagger parsing. Consider implementing collision detection and logging when duplicate names are encountered usingReporter.ToLog(eLogLevel.ERROR, message).
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
Ginger/GingerAutoPilot/APIModelLib/SwaggerApi/OpenApiBase.cs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.cs
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use
Reporter.ToLog(eLogLevel.ERROR, message)for logging errors
Files:
Ginger/GingerAutoPilot/APIModelLib/SwaggerApi/OpenApiBase.cs
🧠 Learnings (1)
📚 Learning: 2025-12-18T05:29:42.896Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4385
File: Ginger/GingerCoreNET/Run/Excels/ExcelNPOIOperations.cs:468-475
Timestamp: 2025-12-18T05:29:42.896Z
Learning: In the Ginger codebase, assume file extensions are lowercase (e.g., .xlsx, .xls). Do not perform case-insensitive extension checks (such as StringComparison.OrdinalIgnoreCase) when using EndsWith() or similar methods to verify file extensions; rely on lowercase comparisons or convert to lowercase first. This ensures consistency and avoids unnecessary case-insensitive comparisons across C# source files.
Applied to files:
Ginger/GingerAutoPilot/APIModelLib/SwaggerApi/OpenApiBase.cs
🧬 Code graph analysis (1)
Ginger/GingerAutoPilot/APIModelLib/SwaggerApi/OpenApiBase.cs (3)
Ginger/Ginger/ApplicationModelsLib/APIModels/APIModelPage.xaml.cs (1)
Convert(1077-1085)Ginger/GingerCoreCommon/Repository/ApplicationModelLib/ApplicationModelBase.cs (1)
ToString(53-56)Ginger/GingerCoreCommon/Repository/RepositoryFolder.cs (1)
ToString(87-90)
🔇 Additional comments (2)
Ginger/GingerAutoPilot/APIModelLib/SwaggerApi/OpenApiBase.cs (2)
116-117: LGTM! Past review feedback addressed correctly.The redundant
Convert.ToStringcalls have been properly eliminated by storing the result in a variable. The implementation correctly truncates the operation summary to 50 characters and maintains the fallback toOperationIdwhen the name is empty or whitespace.
117-117: Reconsider the 50-character truncation limit to account for subsequent suffix appending.The 50-character limit applied at line 117 does not account for suffixes like "-JSON", "-UrlEncoded", or "-XML" that are appended afterward in
OpenApiVer3.csandSwaggerVer2.cs. This results in filenames exceeding the intended length, particularly sinceAAM.Nameis used for repository file naming. Consider reducing the initial truncation to approximately 40-45 characters to accommodate the longest suffix ("-UrlEncoded", 11 chars) while maintaining a reasonable maximum filename length.
d60113c
into
Releases/Official-Release
… length to subfolder creation
Description
Type of Change
Checklist
[IsSerializedForLocalRepository]where neededReporter.ToLog()patternSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.