Skip to content

feat(data-migration): FTRS-1627 Add CREATE and DELETE version history…#962

Closed
sylwialuczakNHS wants to merge 11 commits intomainfrom
feat/FTRS-1627-automated-e2e-tests
Closed

feat(data-migration): FTRS-1627 Add CREATE and DELETE version history…#962
sylwialuczakNHS wants to merge 11 commits intomainfrom
feat/FTRS-1627-automated-e2e-tests

Conversation

@sylwialuczakNHS
Copy link
Copy Markdown
Contributor

@sylwialuczakNHS sylwialuczakNHS commented Feb 27, 2026

… 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.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

prjh2-nhs
prjh2-nhs previously approved these changes Feb 27, 2026
Copy link
Copy Markdown
Contributor

@prjh2-nhs prjh2-nhs left a comment

Choose a reason for hiding this comment

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

Nice additions for the create and delete flows 👍

(Note: for future work in this area, getting smoke tests running against real streams will be a solid improvement, as noted in discussion on related PR here )

Copilot AI review requested due to automatic review settings March 3, 2026 06:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 VersionHistoryHelper to 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.feature to 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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread tests/service_automation/tests/utilities/data_migration/version_history_helper.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

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]:
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

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]:

Copilot uses AI. Check for mistakes.
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.

3 participants