Add PATCH endpoints for tiers and networks - #32
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds partial-update (PATCH) support for tiers and networks, including new OpenAPI schema/types, handlers, DB queries, and integration tests to validate update semantics and authorization.
Changes:
- Add
PATCH /tiers/{id}andPATCH /networks/{id}endpoints with corresponding OpenAPITierPatch/NetworkPatchrequest bodies. - Implement transactional update handlers that lock the target row (
...FOR UPDATE) and apply validated updates via new SQLC queries. - Add integration tests + API fixtures covering success, validation failures (nulls/invalid enums), not-found, and auth enforcement.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
api/tiers.go |
Implements UpdateTier PATCH handler with validation, row locking, and DB update. |
api/networks.go |
Implements UpdateNetwork PATCH handler with validation, row locking, and DB update. |
query.sql |
Adds UpdateTier / UpdateNetwork updates and Get*ForUpdate queries for row locking. |
db/query.sql.go |
Regenerates SQLC output for new update and FOR UPDATE queries. |
api.yaml |
Defines PATCH operations and patch schemas for tiers/networks. |
api/directory.gen.go |
Regenerates server/types to include PATCH routes, request/response types, and patch models/enums. |
descriptors/ModuleDescriptor-template.json |
Registers PATCH endpoints in the module descriptor. |
test/tiers_test.go |
Adds integration cases for tier PATCH behavior and permissions. |
test/networks_test.go |
Adds integration cases for network PATCH behavior and permissions. |
test/apifixtures/*patch*.json |
Adds request/refetch fixtures used by new PATCH test cases. |
Files not reviewed (2)
- api/directory.gen.go: Generated file
- db/query.sql.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
kurtnordstrom
marked this pull request as ready for review
July 15, 2026 20:10
kurtnordstrom
requested review from
adamdickmeiss,
ihardy,
jakub-id and
skomorokh
as code owners
July 15, 2026 20:10
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.
No description provided.