-
Notifications
You must be signed in to change notification settings - Fork 1
S28-5068 Soft-delete original VF recordings where a re-encoded version exists #1516
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
Merged
lydiaralphgov
merged 12 commits into
master
from
S28-5068/delete-original-vf-recordings
Jul 23, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d438a79
Soft-delete original VF recordings where a re-encoded version exists
lydiaralphgov 354cce0
Checkstyle
lydiaralphgov e839570
Don't sign in if flag is true
lydiaralphgov faabcad
Add flag to mark original recordings that were deleted
lydiaralphgov 9826ad3
Integration test
lydiaralphgov 1525b16
Set duration
lydiaralphgov 582e1ac
Refactored test for clarity
lydiaralphgov e40d5a0
Auth for deleting or undeleting originals
lydiaralphgov 5884723
Fix test by adding auth
lydiaralphgov 4aabe06
Delete unused method
lydiaralphgov fa36360
Merge branch 'master' into S28-5068/delete-original-vf-recordings
lydiaralphgov 6fd5d0a
Renumber delta to avoid conflict with master
lydiaralphgov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/java/uk/gov/hmcts/reform/preapi/tasks/UpdateRecordingsVisibility.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| package uk.gov.hmcts.reform.preapi.tasks; | ||
|
|
||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.stereotype.Component; | ||
| import uk.gov.hmcts.reform.preapi.security.service.UserAuthenticationService; | ||
| import uk.gov.hmcts.reform.preapi.services.RecordingService; | ||
| import uk.gov.hmcts.reform.preapi.services.UserService; | ||
|
|
||
| /** | ||
| * Decides whether to make *VF original recordings* visible, depending on HIDE_REENCODED_RECORDINGS flag | ||
| * Needs to be run after flag has been updated to hide/display VF recordings | ||
| * Re-encoded recordings' visibility is controlled directly by the flag in application code | ||
| * This approach uses the existing logic around deleted recordings to control visibility instead. | ||
| * It is intended as a temporary measure while we monitor re-encoded recordings for any issues. | ||
| * If all is well, VF originals can remain deleted, and we can delete this task. | ||
| */ | ||
| @Slf4j | ||
| @Component | ||
| public class UpdateRecordingsVisibility extends RobotUserTask { | ||
|
|
||
| private final boolean hideReencodedRecordings; | ||
| private final RecordingService recordingService; | ||
|
|
||
| @Autowired | ||
| public UpdateRecordingsVisibility(RecordingService recordingService, | ||
| UserService userService, | ||
| UserAuthenticationService userAuthenticationService, | ||
| @Value("${cron-user-email}") String cronUserEmail, | ||
| @Value("${HIDE_REENCODED_RECORDINGS:}") String hideReencodedRecordings) { | ||
| super(userService, userAuthenticationService, cronUserEmail); | ||
| this.recordingService = recordingService; | ||
| this.hideReencodedRecordings = Boolean.parseBoolean(hideReencodedRecordings); | ||
| } | ||
|
|
||
| @Override | ||
| public void run() { | ||
| signInRobotUser(); | ||
|
|
||
| if (hideReencodedRecordings) { | ||
| log.info("Re-encoded recordings are hidden. Undeleting originals..."); | ||
| recordingService.undeleteOriginalWhereReencodedVersionExists(); | ||
| } else { | ||
| recordingService.deleteOriginalWhereReencodedVersionExists(); | ||
| } | ||
| } | ||
|
|
||
| } |
2 changes: 2 additions & 0 deletions
2
src/main/resources/db/migration/V055__AddVfOriginalReencodedFlagToRecordings.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ALTER TABLE recordings | ||
| ADD COLUMN vf_original_reencoded BOOLEAN NOT NULL DEFAULT FALSE; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.