-
Notifications
You must be signed in to change notification settings - Fork 8
Validation for Whitespace, Restricted and Duplicate #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
sdm/src/test/java/integration/com/sap/cds/sdm/IntegrationTest_MultipleFacet.java
Dismissed
Show dismissed
Hide dismissed
sdm/src/test/java/integration/com/sap/cds/sdm/IntegrationTest_MultipleFacet.java
Dismissed
Show dismissed
Hide dismissed
|
gemini review |
|
Gemini Automated Review Best Practices Review 💡
Potential Bugs 🐛
Recommendations & Required Changes 🛠️
Quality Rating ⭐ Overall Assessment |
| // Doesn't do anything | ||
| } | ||
|
|
||
| public static Boolean validateFileNames( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this method to AttachmentHandlerUtils? As it is only being used in the 2 handler classes
| handleWarnings( | ||
| context, | ||
| fileNameWithRestrictedCharacters, | ||
| duplicateFileNameList, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this parameter is removed, are we still handling duplicate case in SDM repository (not UI check)
| String[] generatedIDs = new String[3]; | ||
| String[] duplicateIDs = new String[1]; | ||
| Boolean testStatus = false, allRenamedSuccessfully = true; | ||
| String response = api.createEntityDraft(appUrl, entityName, entityName2, srvpath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have dismissed a few comments above this by the github code review - but these kind of problems are usually what cause the sonar scan to fail once the PR is merged. So I would suggest we have a discussion to see whether these can be ignored or do they need to be addressed
| for (Map<String, Object> entity : data) { | ||
| List<Map<String, Object>> attachments = (List<Map<String, Object>>) entity.get("attachments"); | ||
| List<Map<String, Object>> attachments = | ||
| AttachmentsHandlerUtils.fetchAttachments(targetEntity, entity, composition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss whether fetchAttachments should be in AttachmentsHandlerUtils class, it may be better to place it in SDMUtils itself
| return isError; | ||
| } | ||
|
|
||
| public static Set<String> isFileNameContainsWhitespace( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT : can we rename this method to something like fileNameHasWhitespace and isFileNameContainsRestrictedCharaters to something like -> fileNameContainsRestrictedCharaters
Describe your changes
This PR provides a solution to handle the different scenarios for
Type of change
Checklist before requesting a review
Upload Screenshots/lists of the scenarios tested