-
Notifications
You must be signed in to change notification settings - Fork 6
Adding scan criticality #678
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: main
Are you sure you want to change the base?
Adding scan criticality #678
Conversation
|
Until CAP-Java don't deliver automatic data-source search. This has to wait. |
4ac9ffa to
3420855
Compare
… that weren't scanned in the last 3 days
|
Couldn't wait so we will deliver with a temporary solution using CdsProperties |
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.
The review has been concluded!
PR Bot Information
Version: 1.16.33
- Correlation ID:
51d38940-dc1f-11f0-81c9-da6f65e75dd1 - Event Trigger:
issue_comment.created - LLM:
anthropic--claude-4.5-sonnet
...re-attachments/src/main/java/com/sap/cds/feature/attachments/configuration/Registration.java
Outdated
Show resolved
Hide resolved
...re-attachments/src/main/java/com/sap/cds/feature/attachments/configuration/Registration.java
Outdated
Show resolved
Hide resolved
.../java/com/sap/cds/feature/attachments/handler/applicationservice/ReadAttachmentsHandler.java
Outdated
Show resolved
Hide resolved
...c/main/resources/cds/com.sap.cds/cds-feature-attachments/data/sap.attachments-ScanStates.csv
Outdated
Show resolved
Hide resolved
.../resources/cds/com.sap.cds/cds-feature-attachments/data/sap.attachments-ScanStates_texts.csv
Outdated
Show resolved
Hide resolved
| <counter>INSTRUCTION</counter> | ||
| <value>COVEREDRATIO</value> | ||
| <minimum>0.95</minimum> | ||
| <minimum>0.90</minimum> |
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.
Why not add some additional tests to full-fill this requirement ?
...re-attachments-oss/src/test/java/com/sap/cds/feature/attachments/oss/client/AWSClientIT.java
Outdated
Show resolved
Hide resolved
| ? new ArrayList<>(existingPaths) | ||
| : new ArrayList<>(); | ||
|
|
||
| updatedPaths.add("../target/cds/com.sap.cds/cds-feature-attachments/**"); |
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.
The target folder is only available during build time with Maven. How will this work with an application using the attachments plugin during productive usage?
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.
Oh, I didn't know that. I thought it has the same structures in prod as we have it on our machine.
Then we will have to reconsider our strategy.
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.
For production this is not relevant, as CSV data is never deployed by CAP Java in production, but via the HANA build task, which should already correctly pick up the CSV data anyway.
When running locally you might want to check the working directory to figure out the correct path to the target folder. Depending where the app is started (e.g. root directory or srv directory) the path might need to be adjusted.
Add ScanStates Entity with Criticality for Enhanced Status Display
New Features
✨ Introduced a new
ScanStatesentity to provide localized status names and criticality levels for attachment scan statuses, improving the visual representation of scan results in the UI.Changes
attachments.cds: Added newScanStatesentity extendingCodeListwithcode,name, andcriticalityfields. UpdatedMediaDataaspect to includestatusNavassociation toScanStatesand set default status to 'Unscanned'.attachments-annotations.cds: Enhanced status display withCommon.TextandCommon.TextArrangementannotations, added criticality visualization in LineItem, and removed unused$Typeannotation from HeaderInfo.sap.attachments-ScanStates.csv&sap.attachments-ScanStates_texts.csv: Added CSV data files defining scan states (Unscanned, Scanning, Infected, Clean, Failed) with their corresponding criticality levels (1=Critical, 2=Warning, 3=Success) and localized descriptions.ReadAttachmentsHandler.java: Updated scan trigger logic to re-scan attachments that are Clean or Failed for more than 3 days, added timestamp imports, and improved scan condition handling for better security posture.Registration.java: Added environment configuration to dynamically append CSV paths for loading scan state data, with proper null-safety checks and logging.application.yaml: Added new configuration file to define default CSV data source paths.ReadAttachmentsHandlerTest.java: Enhanced test coverage by addingscannedAtfield initialization to attachment test objects.Build & CI Changes
ci.yml: Changed GitHub token from customGH_TOKENto standardGITHUB_TOKENand updated pull request trigger frompull_requesttopull_request_target.pom.xml: Bumped project version from 1.2.4 to 1.2.5-SNAPSHOT and reduced JaCoCo coverage thresholds from 95% to 90% for instruction, branch, and complexity metrics.samples/bookshop/pom.xml: Updated cds-feature-attachments dependency version to 1.2.5-SNAPSHOT.Test Improvements
AWSClientIT.java,AzureClientIT.java,GoogleClientIT.java): AddedassumeTruechecks to skip tests gracefully when cloud storage credentials are not available in the environment.Configuration
translation_v2.json: Added newattachments_datacollection configuration to include CSV translation files in the TEW translation delivery process..gitignore: Added.cdsrc-private.jsonto ignored files list.