Open
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.
This is more than I'd normally put in a single PR. It would probably be easier to review (and course correct early) if I just implemented one or two endpoints per PR, including tests.
In brief, this PR makes the following changes:
handler.go(addresses TODOs there)store.go(addresses TODOs there)DocumentStoreand create a mock to represent the db layergo mod tidy(most of the changes to go.mod)Testing at the
DocumentStorelayer is probably the most effective for these changes. By using a mock we don't need to run Postgres. Normally I'd put more work into trying to define some smaller, more "business logic" centric tests. The tests that Copilot created are at least useful for basic code coverage.It would also be good to define automated tests against the web API itself, by running the server and issuing POSTs and GETs with validation against the responses. I did manual verification using curl and Insomnia (like Postman.) Normally something like that would run in the CI pipeline to check for errors before deploying and/or run tests after deploying to a QA environment. No such tests are defined here.