Skip to content

Characterization tests for alta_open_lambda webhook handler#100

Merged
camdroid merged 3 commits into
asmbly-makerspace:mainfrom
camdroid:tests_for_edit_and_update
Jun 14, 2026
Merged

Characterization tests for alta_open_lambda webhook handler#100
camdroid merged 3 commits into
asmbly-makerspace:mainfrom
camdroid:tests_for_edit_and_update

Conversation

@camdroid

@camdroid camdroid commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This is in preparation for deprecating the legacy Neon webhooks. This diff will capture the behavior of the lambda function when using the old Neon webhook payload structure, and a future diff will add tests that use the new payload structure, then update the lambda function so that it can account for both.

Rough order of operations:

  • Capture behavior with the legacy webhooks
  • Write tests, update lambda, and prove behavior parity with the new webhooks
  • Disable the old webhooks, monitor to ensure that action is still being reflect in Neon
  • Remove code referencing the old webhook structure

Three focused commits: harness + guard clauses; editAccount/updateMembership + legacy-flag; real-log-based cases (createMembership joins + Mailjet, mergedAccount, updateEventRegistration, createAccount).

camdroid added 3 commits June 10, 2026 22:48
With the upcoming Neon webhook deprecation, we need for the
alta-open-update lambda to be able to handle both the legacy and the new
webhook format. Roughly, this is what the deprecation strategy looks
like:
* Enable new Neon webhooks (already done)
* Update lambda to work on both styles of payload (new or legacy)
* Monitor results, ensure that there are no errors and that the new
  webhooks have the correct behavior.
* Disable legacy webhooks (one at a time) in Neon.
* Monitor results, ensure that operations are happening as expected
  (accounts are actually being created, etc.)
* Update lambda to throw an error for legacy webhook calls, without
  updating Alta.
* (Eventually) Remove code for handling legacy Neon webhooks.

To help with the first step of updating the lambda, I want to write a
test suite to capture the current behavior. The point of this isn't to
catch any new bugs, just to verify what's already happening in the
lambda.

Once we can show what behavior is currently happening under the legacy
webhooks, we can start adding in the new webhook formats and ensuring
that the tests work with those, too, using the `legacy` flag if needed.
Adding some basic automated tests for the editAccount and
updateMembership (legacy) Neon webhooks.

These tests just create an event in the correct format and verify that
Alta Open was called with the correct account ID. I may expand these out
later, but the webhook changes are mostly around the way data is
structured or named, so rough smoke tests should be sufficient to show
that we can parse the new format.
This diff adds test cases based on real logs found from the
alta-open-update lambda.

Two interestings things to point out:
* We have a case for createMembership, but not createAccount. I wonder
  if that might cause problems when someone tries to register a new Neon
  account?
* deleteMembership hasn't been called in over a year. Not sure if that's
  expected (do we ever want to delete someone's account, even if they're
  no longer an active member?), but just found it interesting.

Co-written with Claude AI.
@camdroid camdroid merged commit 457cdbd into asmbly-makerspace:main Jun 14, 2026
1 check passed
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