feat(data-migration): FTRS-1627 Add CREATE and DELETE version history…#962
Closed
sylwialuczakNHS wants to merge 11 commits intomainfrom
Closed
feat(data-migration): FTRS-1627 Add CREATE and DELETE version history…#962sylwialuczakNHS wants to merge 11 commits intomainfrom
sylwialuczakNHS wants to merge 11 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds LocalStack-based service-automation coverage for version history CREATE/DELETE events by extending the stream-event test helper and introducing new BDD steps/scenarios.
Changes:
- Refactors
VersionHistoryHelperto reuse common processing logic and adds helpers to build/process INSERT and REMOVE document stream events. - Adds new pytest-bdd step definitions to create/delete an Organisation document and trigger version history processing.
- Extends the
version_history_tracking.featureto cover CREATE and DELETE scenarios.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tests/service_automation/tests/utilities/data_migration/version_history_helper.py |
Adds INSERT/REMOVE document stream event support and refactors common audit info + stream processing. |
tests/service_automation/tests/step_definitions/data_migration_steps/test_version_history_tracking_steps.py |
Adds new step definitions/helpers for document create/delete flows that invoke the version-history handler. |
tests/service_automation/tests/features/data_migration_features/version_history_tracking.feature |
Adds BDD scenarios asserting version history records for CREATE and DELETE operations. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
prjh2-nhs
approved these changes
Apr 15, 2026
| logger.debug(f"Processing document DELETE event for {table_name} id={entity_id}") | ||
| self._process_stream_event(stream_event) | ||
|
|
||
| def _get_default_audit_info(self, last_updated_by: Dict[str, str] | None) -> Dict[str, str]: |
There was a problem hiding this comment.
The _get_default_audit_info function signature exceeds the configured 88-character line length (tests/service_automation/pyproject.toml). This is likely to fail formatting/lint checks; please wrap the signature across multiple lines (or run the repo formatter) to keep within the configured line length.
Suggested change
| def _get_default_audit_info(self, last_updated_by: Dict[str, str] | None) -> Dict[str, str]: | |
| def _get_default_audit_info( | |
| self, last_updated_by: Dict[str, str] | None | |
| ) -> Dict[str, str]: |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
… tests
Description
Context
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.