Skip to content

CN-195 Verify CASE_UPDATE region after sample loading - #31

Merged
sumeetons merged 1 commit into
mainfrom
CN-195-initial-character-region-for-case-update
Sep 21, 2026
Merged

sumeetons merged 1 commit into
mainfrom
CN-195-initial-character-region-for-case-update

Conversation

@sumeetons

Copy link
Copy Markdown
Contributor

Motivation and Context

Integrated Census services expect the region in outbound CASE_UPDATE payloads
to be a single country character even when RM receives and stores a more
specific region code such as E12000009.

What has changed

Sample-load feature

  • Added an observable assertion for the CASE_UPDATE payloads produced while
    loading the existing England sample.
  • Verify every captured event against its source sample row, including case and
    address fields.
  • Verify that each emitted region is exactly one character and equals the
    leading character of the full sample region.

Step definitions and context

  • Reuse the events already captured by sample loading, avoiding a second Pub/Sub
    pull and preserving queue cleanup.
  • Extracted source-row matching for reuse by setup and detailed assertions.
  • Registered sample_rows in the Behave context index.

How to test?

With the local RM topology and Pub/Sub emulator running:

cd census31-rm-acceptance-tests
make lint
PUBSUB_EMULATOR_HOST=localhost:8538 \
  pipenv run behave acceptance_tests/features/load_sample.feature

Results: lint passed; 1 feature, 1 scenario, and 2 steps passed.

Links

Screenshots (if appropriate):

N/A

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sumeetons
sumeetons requested a review from a team as a code owner September 18, 2026 14:21
@sumeetons sumeetons added the patch A non-feature change, e.g. bug or issue fix label Sep 18, 2026
@github-actions

Copy link
Copy Markdown

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ BASH shellcheck 1 0 0 0.19s
✅ MARKDOWN markdownlint 2 0 0 0.42s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

All reviewed changes are covered by validation with no unresolved blocking issues.

Review effort: Lite
Findings: None

What changed in this PR

Adds acceptance validation for CASE_UPDATE payloads produced during sample loading, including source-row matching and single-character region formatting.

Changes:

  • Stores sample rows in Behave context.
  • Reuses captured events for detailed payload assertions.
  • Documents the sample_rows context attribute.
File Description
CODE_GUIDE.md Documents sample_rows.
acceptance_tests/​features/​steps/​sample_loading.py Matches emitted cases to sample rows and validates payload fields and regions.
acceptance_tests/​features/​load_sample.feature Executes the new CASE_UPDATE validation step.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@AdamHawtin AdamHawtin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@ravindra-tummuru ravindra-tummuru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have removed my comment in favour of future improvement to this scenario as needed. For now I approve it as it is.

@sumeetons
sumeetons merged commit 6140293 into main Sep 21, 2026
6 checks passed
@sumeetons
sumeetons deleted the CN-195-initial-character-region-for-case-update branch September 21, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A non-feature change, e.g. bug or issue fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants