Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9ef46dd
add response optimisation pkg
kerobbi Feb 16, 2026
f5291c4
add tests
kerobbi Feb 16, 2026
5d28623
write remaining list tools, make flatten recursive with per-tool dept…
kerobbi Feb 17, 2026
7859111
wire list_branches
kerobbi Feb 17, 2026
07b71f1
Merge branch 'main' into kerobbi/response-optimisation
kerobbi Feb 17, 2026
70deafb
unwire list_branches and list_issue_types
kerobbi Feb 18, 2026
77695c7
add prerelease and requested_teams to configs
kerobbi Feb 18, 2026
92e6f44
rewire list_branches
kerobbi Feb 18, 2026
14dd881
Merge branch 'main' into kerobbi/response-optimisation
kerobbi Feb 18, 2026
3a1d18d
improve comment
kerobbi Feb 18, 2026
c960f49
simplify isUrlKey
kerobbi Feb 18, 2026
b651887
refactor MarshalItems with generics and per-tool config
kerobbi Feb 19, 2026
c75ab7d
fix tests
kerobbi Feb 19, 2026
2791676
Merge branch 'main' into kerobbi/response-optimisation
kerobbi Feb 19, 2026
afd1eba
refactor WithPreservedFields
kerobbi Feb 20, 2026
de12f8f
Merge branch 'main' into kerobbi/response-optimisation
kerobbi Feb 23, 2026
86a41c2
Merge branch 'main' into kerobbi/response-optimisation
kerobbi Feb 23, 2026
aa635d6
wire minimal types into list tools, remove collection handling from p…
kerobbi Feb 23, 2026
67699f0
Merge branch 'main' into kerobbi/response-optimisation
kerobbi Feb 24, 2026
c29fcb5
fix nil check, make WithPreservedFields accumulate
kerobbi Feb 24, 2026
f21b014
Merge branch 'main' into kerobbi/response-optimisation
kerobbi Feb 24, 2026
a20e80a
Add more tests
JoannaaKL Feb 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix nil check, make WithPreservedFields accumulate
  • Loading branch information
kerobbi committed Feb 24, 2026
commit c29fcb5938f63f2cfbcdfd0b558289c99d518eb9
9 changes: 7 additions & 2 deletions pkg/github/minimal_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,15 @@ func convertToMinimalRelease(release *github.RepositoryRelease) MinimalRelease {
}

func convertToMinimalTag(tag *github.RepositoryTag) MinimalTag {
return MinimalTag{
m := MinimalTag{
Name: tag.GetName(),
SHA: tag.GetCommit().GetSHA(),
}

if commit := tag.GetCommit(); commit != nil {
m.SHA = commit.GetSHA()
}

return m
}

func convertToMinimalReviewThreadsResponse(query reviewThreadsQuery) MinimalReviewThreadsResponse {
Expand Down
10 changes: 6 additions & 4 deletions pkg/response/optimize.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ func WithMaxDepth(d int) OptimizeListOption {
}
}

// WithPreservedFields sets keys that are exempt from all destructive strategies except whitespace normalization.
// Keys are matched against post-flatten map keys, so for nested fields like "user.html_url", the dotted key must be
// added explicitly. Empty collections are still dropped. Wins over collectionExtractors.
// WithPreservedFields adds keys that are exempt from all destructive strategies except whitespace normalization.
// Keys are matched against post-flatten map keys, so for nested fields like "user.html_url", the dotted key must
// be added explicitly.
func WithPreservedFields(fields ...string) OptimizeListOption {
return func(c *OptimizeListConfig) {
c.preservedFields = make(map[string]bool, len(fields))
if c.preservedFields == nil {
c.preservedFields = make(map[string]bool, len(fields))
}
for _, f := range fields {
c.preservedFields[f] = true
}
Expand Down