feat(api): add in_successful_call filter to GET /events (Resolves #211) - #455
Merged
khaylebfortune merged 2 commits intoAug 3, 2026
Merged
Conversation
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.
Summary
Resolves #211 — adds
?in_successful_call=true|falsetoGET /events(andGET /contracts/{id}/events, which shares the filter parser) to filter diagnostic events from failed calls vs successful-call events.What changed
internal/store/store.go—EventFiltergainsInSuccessfulCall *bool:nilmeans "no constraint",true/falsefilter explicitly. A pointer (not a plain bool) so "absent" stays distinguishable fromfalse.internal/store/postgres.go—QueryEventsappends the parameterized clausein_successful_call = $Nwhen the filter is set; unset filters keep the exact previous SQL.internal/api/handlers.go—filterFromQueryparsesin_successful_call(true|false); any other value is a 400. Absent (or empty) means no constraint.internal/api/api_test.go— table-drivenTestListEvents_InSuccessfulCallFilter(omitted / true / false) plusin_successful_call=maybeadded to the invalid-params suite.internal/store/postgres_test.go— integration test against a real database: successful-only, failed-only, and nil (no constraint) queries, table-driven.GET /eventsAPI reference table.Design notes
*boolsemantics match the convention the project later adopted upstream:nil= no filter, so existing requests behave byte-for-byte as before.in_successful_callcolumn already exists.Testing
go build ./...,go vet ./...,golangci-lint run, andgo test ./...all pass, including the Postgres integration suite.Closes #211