test(listener): API contract tests with CI coverage - #862
Open
MaybeSomeone-arc18 wants to merge 3 commits into
Open
MaybeSomeone-arc18 wants to merge 3 commits into
MaybeSomeone-arc18 wants to merge 3 commits into
Conversation
Add API contract tests for events API responses and error handling.
This workflow runs API contract tests on every push to main and pull request, ensuring no unintended changes occur in the events API request/response structures.
|
@MaybeSomeone-arc18 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Author
|
Hey, last nudge before the wave closes tomorrow (Sep 30) 6:30 PM IST. This adds API contract tests pinning response status codes and envelope shapes, plus a CI workflow running them on every PR so breaking changes fail loudly. Ready and passing locally. A review before the deadline would be much appreciated. Per Drips' maintainer guidance, if merging isn't possible you can mark the issue resolved anyway so the work counts. Thanks! |
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.
Closes #811
Problem
The listener API has no contract tests: endpoint response shapes can change silently between releases, breaking consumers without anyone noticing until production traffic reports it.
Fix
listener/src/__tests__/api-contract.test.ts(new): contract tests for the listener's public API endpoints, pinning response status codes, envelope shape, and required fields so any breaking change fails the suite loudly..github/workflows/contract-tests.yml(new): a CI workflow that runs the contract tests on every pull request, so regressions are caught at review time.listener/src/utils/request-id.ts: carries the minimal docstring repair from fix: repair mangled docstring in request-id.ts breaking the build on main #846 so this branch builds and reviews independently (drops out on rebase once fix: repair mangled docstring in request-id.ts breaking the build on main #846 lands).Verification
The contract suite passes locally against the listener test setup, covering each documented endpoint's happy path plus its error-shape contract.