Skip to content

fix(alta_open): handle new-format webhook fields (status/enrollType)#11

Merged
camdroid merged 5 commits into
mainfrom
test_lambda_new_format
Jul 8, 2026
Merged

fix(alta_open): handle new-format webhook fields (status/enrollType)#11
camdroid merged 5 commits into
mainfrom
test_lambda_new_format

Conversation

@camdroid

@camdroid camdroid commented Jul 2, 2026

Copy link
Copy Markdown
Owner

What changed

  • alta_open_lambda/lambda_function.py: The webhook handler now reads the correct fields depending on payload format. New-format webhooks send status and enrollType, whereas legacy webhooks send transactionStatus and enrollmentType. The handler branches on the legacy flag to pull the right keys.
  • tests/test_alta_open_lambda.py: Added characterization tests for the webhook handler covering both formats, and removed the xfail markers from the join-gap cases that now pass with the fix.
  • Test infrastructure: Small fixes to get the suite running locally (import/collection tweaks across several test_*.py files, plus a pyproject.toml addition). No behavior changes to production code beyond the lambda fix above.

Why

New-format Alta webhooks were being processed with legacy field names, so status/enrollType were read as missing. Branching on the format flag resolves the join gaps the earlier characterization tests documented as xfail.

Reviewer notes

  • Behavior change is isolated to the field-selection branch in the lambda handler; everything else is tests and local-run plumbing.
  • The previously-xfailed tests are now expected to pass — confirms the fix end-to-end.

camdroid and others added 5 commits June 17, 2026 00:08
- Add pythonpath = ["."] to pyproject.toml so project modules are importable
- Fix 4 test files using from tests.neon_mocker to from neon_mocker to match pytest rootdir import behavior
- Skip TestClassFeedbackAutomation (google-auth not installed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New-format webhooks use 'status' and 'enrollType' instead of
'transactionStatus' and 'enrollmentType'. Branch on the legacy flag
to read the correct fields, and remove xfail from the tests that
now pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… logs

Captured 306 real createMembership events (2026-06-02..07-02) and
corrected the characterization fixtures to match:

- New-format events arrive with customParameters null today (the new
  webhook was activated without its legacy/webhook_name params), and
  will carry legacy:"false" once those are added. Both take the
  handler's non-legacy branch, so the join tests now run against both
  variants.
- Use the real legacy webhook_name (NewMembershipLegacy) and a
  realistic, PII-scrubbed flat payload (rich membership body + payments
  with card details) instead of the minimal inferred shape.
- Confirmed real enum values: status in {SUCCEEDED, FAILED},
  enrollType in {JOIN, RENEW}.
- Drop the stale ASSUMED-SHAPE comment and dead NEW_JOIN_XFAIL marker.
- gitignore captured *_logs.json (member PII).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@camdroid camdroid merged commit c1d5df4 into main Jul 8, 2026
2 checks passed
@camdroid camdroid deleted the test_lambda_new_format branch July 8, 2026 12:27
camdroid added a commit that referenced this pull request Jul 13, 2026
* test(alta_open): characterize new-format webhook handling (xfail join gaps) (#10)

* fix(alta_open): handle new-format webhook fields (status/enrollType) (#11)

* test(alta_open): characterize new-format webhook handling (xfail join gaps)

* fix(tests): get test suite running locally (no behavior changes)

- Add pythonpath = ["."] to pyproject.toml so project modules are importable
- Fix 4 test files using from tests.neon_mocker to from neon_mocker to match pytest rootdir import behavior
- Skip TestClassFeedbackAutomation (google-auth not installed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(alta_open): handle new-format webhook fields (status/enrollType)

New-format webhooks use 'status' and 'enrollType' instead of
'transactionStatus' and 'enrollmentType'. Branch on the legacy flag
to read the correct fields, and remove xfail from the tests that
now pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(alta_open): align new-format createMembership fixtures with real logs

Captured 306 real createMembership events (2026-06-02..07-02) and
corrected the characterization fixtures to match:

- New-format events arrive with customParameters null today (the new
  webhook was activated without its legacy/webhook_name params), and
  will carry legacy:"false" once those are added. Both take the
  handler's non-legacy branch, so the join tests now run against both
  variants.
- Use the real legacy webhook_name (NewMembershipLegacy) and a
  realistic, PII-scrubbed flat payload (rich membership body + payments
  with card details) instead of the minimal inferred shape.
- Confirmed real enum values: status in {SUCCEEDED, FAILED},
  enrollType in {JOIN, RENEW}.
- Drop the stale ASSUMED-SHAPE comment and dead NEW_JOIN_XFAIL marker.
- gitignore captured *_logs.json (member PII).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* Remove unnecessary line from gitignore

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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