audit(server): confirm nil-slice guards in all list endpoints#471
Closed
dlorenc wants to merge 1 commit into
Closed
audit(server): confirm nil-slice guards in all list endpoints#471dlorenc wants to merge 1 commit into
dlorenc wants to merge 1 commit into
Conversation
Full audit of all list endpoints in internal/server/ for nil-slice
serialization. All locations flagged in the task already have the
correct guard pattern:
if x == nil { x = []T{} }
Verified locations:
- handlers_branches.go:40 branches slice
- handlers_ci.go:89 Jobs field (ListCIJobsResponse)
- handlers_events.go:109 Subscriptions field (ListSubscriptionsResponse)
- handlers_orgs.go:55 Orgs field (ListOrgsResponse)
- handlers_orgs.go:102 Repos field (ReposResponse)
- handlers_orgs.go:171 Members field (OrgMembersResponse)
- handlers_orgs.go:340 Invites field (OrgInvitesResponse)
- handlers_proposals.go:136 reviews slice
- handlers_proposals.go:161 checkRuns slice
- handlers_proposals.go:260 comments slice
- handlers_proposals.go:359 proposals slice
- handlers_releases.go:104 Releases field (ListReleasesResponse)
- handlers_files.go:66 entries slice (handleTree)
- handlers_files.go:172 entries slice (handleFileHistory)
- handlers_files.go:378 entries slice (handleChain)
go build ./... and go vet ./... both clean. All tests pass.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Owner
Author
|
Closing: no code changes — audit confirmed all nil-slice guards were already applied by prior PRs (#466 and others). Work is complete. |
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
Full nil-slice audit of all list endpoints in
internal/server/as requested. The task asked to addif x == nil { x = []T{} }guards beforewriteJSONcalls for slice fields that could be nil when the DB returns no rows.Finding: all locations were already guarded. Previous PRs (notably #466 and earlier) had already applied the fix pattern across all files. No code changes were required.
Verified locations
branchessliceJobsfield inListCIJobsResponseSubscriptionsfield inListSubscriptionsResponseOrgsfield inListOrgsResponseReposfield inReposResponseMembersfield inOrgMembersResponseInvitesfield inOrgInvitesResponsereviewsslicecheckRunsslicecommentssliceproposalssliceReleasesfield inListReleasesResponseentriesslice (handleTree)entriesslice (handleFileHistory)entriesslice (handleChain)Test plan
go build ./...— cleango vet ./...— cleango test ./... -count=1 -short— all packages pass🤖 Generated with Claude Code