Skip to content

Release/13.3#338

Merged
rmohammed-goaco merged 10 commits into
developfrom
release/13.3
Apr 7, 2026
Merged

Release/13.3#338
rmohammed-goaco merged 10 commits into
developfrom
release/13.3

Conversation

@rmohammed-goaco
Copy link
Copy Markdown
Contributor

No description provided.

rmohammed-goaco and others added 9 commits March 13, 2026 15:27
- Introduced SubmissionAnonymisationConfigProperties for configuration settings.
- Added EXPIRED status to SubmissionStatus enum.
- Enhanced GrantAttachmentRepository and GrantMandatoryQuestionRepository with delete methods for submissions.
- Updated SubmissionRepository with methods for anonymising submissions and deleting related data.
- Implemented SubmissionAnonymisationScheduler to handle scheduled anonymisation of submissions.
- Created SubmissionAnonymisationService to manage the anonymisation process, including S3 object deletion and database cleanup.
- Added application properties for submission anonymisation configuration.
- Created database migration to document the new EXPIRED status in the submission table.
- Removed Lombok annotations: @builder, @AllArgsConstructor, and @NoArgsConstructor.
- Simplified the class by retaining only @Getter and @Setter annotations.
- Adjusted the default value for daysBeforeExpiry to 90, ensuring clarity in configuration settings.
- Updated deleteAttachment method to accept an S3 URI instead of just the object key.
- Extracted bucket name and key from the S3 URI for improved flexibility.
- Added logging to indicate which bucket and object are being deleted.
- Ensured deletion from both the specified bucket and the attachments bucket.
- Updated the S3 deletion logic to abort anonymisation if any deletion fails, ensuring the submission remains in IN_PROGRESS for retry.
- Enhanced logging to provide clearer context on failures during S3 object deletion, improving traceability and error handling.
…tion

- Introduced a new `batchSize` property in `SubmissionAnonymisationConfigProperties` with a default value of 500.
- Updated `SubmissionRepository` to include pagination support in the `findByStatusAndLastUpdatedBefore` method.
- Modified `SubmissionAnonymisationScheduler` to utilize the new pagination feature when retrieving submissions for anonymisation.
- Introduced a new property `submission-anonymisation-scheduler.batchSize` with a value of 500 in the application properties file to enhance the configuration of the submission anonymisation process.
…advert closure handling

- Modified the SubmissionRepository to add a new method that retrieves submissions based on status, last updated date, and advert closure.
- Updated the SubmissionAnonymisationScheduler to utilize the new repository method for fetching submissions due for anonymisation.

List<Submission> findByStatusAndLastUpdatedBefore(SubmissionStatus status, LocalDateTime cutoff);
@Query(value = """
SELECT gs.* FROM grant_submission gs
Copy link
Copy Markdown

@aikido-pr-checks aikido-pr-checks Bot Apr 7, 2026

Choose a reason for hiding this comment

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

findByStatusAndLastUpdatedBeforeAndAdvertClosed uses 'SELECT gs.*' which selects all columns. Replace the wildcard with an explicit list of needed columns.

Suggested change
SELECT gs.* FROM grant_submission gs
SELECT gs.id, gs.applicant_id, gs.scheme_id, gs.application_id, gs.version, gs.created, gs.created_by, gs.last_updated, gs.last_updated_by, gs.submitted_date, gs.application_name, gs.submission_name, gs.status, gs.definition, gs.gap_id, gs.last_required_checks_export FROM grant_submission gs
Details

✨ AI Reasoning
​A new repository method was added that relies on a native SQL query returning all columns via a table-level wildcard. Selecting all columns by wildcard makes the code fragile to schema changes, may expose unintended data, and can hurt performance. Replacing the wildcard with an explicit, minimal column list clarifies data dependencies and reduces risk.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

@rmohammed-goaco rmohammed-goaco merged commit f6df427 into develop Apr 7, 2026
5 checks passed
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.

1 participant