Characterization tests for alta_open_lambda webhook handler#100
Merged
camdroid merged 3 commits intoJun 14, 2026
Conversation
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.
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.
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:
Three focused commits: harness + guard clauses; editAccount/updateMembership + legacy-flag; real-log-based cases (createMembership joins + Mailjet, mergedAccount, updateEventRegistration, createAccount).