Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
752e454
feat: Add Issue Dependencies API support
tommaso-moro Apr 2, 2026
9aba995
chore: Regenerate accessors and iterators
tommaso-moro Apr 2, 2026
f57a237
chore: trigger CI
tommaso-moro Apr 2, 2026
76cfab3
remove omitempty for required param
tommaso-moro Apr 3, 2026
4550de5
pass by value instead of reference as param is required
tommaso-moro Apr 3, 2026
13f260e
add missing fields to Issue struct
tommaso-moro Apr 8, 2026
14b279b
Merge branch 'master' into tommy/issue-dependencies-support
tommaso-moro Apr 8, 2026
6fd4bfd
use any instead of interface{}
tommaso-moro Apr 9, 2026
171deba
Use int64 instead of *int64 for IssueID
tommaso-moro Apr 9, 2026
c5e05bf
Update number param to issueNumber for consistency, in github/issues_…
tommaso-moro Apr 9, 2026
1d84d92
Update number param to issueNumber in github/issues_dependencies.go
tommaso-moro Apr 9, 2026
a3c6983
update number param to issueNumber
tommaso-moro Apr 9, 2026
45fb09c
fix tests now that IssueID is of type int64
tommaso-moro Apr 9, 2026
1e86822
update number param to issueNumber
tommaso-moro Apr 9, 2026
0000b64
Use int64 for issueNumber parameter
tommaso-moro Apr 9, 2026
d261d4f
clean up test
tommaso-moro Apr 9, 2026
f4e9158
Merge branch 'master' into tommy/issue-dependencies-support
tommaso-moro Apr 9, 2026
394a89c
Merge branch 'master' into tommy/issue-dependencies-support
tommaso-moro Apr 20, 2026
23de54e
fix types
tommaso-moro Apr 20, 2026
8f1e865
use shorthand or types
tommaso-moro Apr 20, 2026
f4515f7
go generate
tommaso-moro Apr 20, 2026
f207870
go generate
tommaso-moro Apr 20, 2026
ed9d275
fix tests
tommaso-moro Apr 24, 2026
7f3990f
Merge branch 'master' into tommy/issue-dependencies-support
tommaso-moro Apr 24, 2026
dfd8467
Merge branch 'master' into tommy/issue-dependencies-support
tommaso-moro Apr 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
18 changes: 17 additions & 1 deletion github/gen-stringify-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,29 @@ var (
"RateLimits": true,
}

// namedStructZeroStr maps named struct type names to their Stringify output
// when zero-valued, for structs whose zero value is not simply "{}".
// Stringify always prints non-pointer value fields (ints, strings, etc.) but
// skips nil pointers/slices/maps, so only structs containing non-pointer
// value fields need an entry here.
namedStructZeroStr = map[string]string{
Copy link
Copy Markdown
Author

@tommaso-moro tommaso-moro Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This map must be kept in sync with the struct definitions manually, not sure if fine for now but open to suggestions for a better approach!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you revert all the changes made to gen-stringify-test.go, what exactly breaks?

If it is simply the formatting in a unit test, then I would say that I would rather update those broken unit tests than to make a new map of special special cases in gen-strigify-test.go.

"IssueDependenciesSummary": `github.IssueDependenciesSummary{BlockedBy:0, Blocking:0, TotalBlockedBy:0, TotalBlocking:0}`,
"SubIssuesSummary": `github.SubIssuesSummary{Total:0, Completed:0, PercentCompleted:0}`,
}

funcMap = template.FuncMap{
"isNotLast": func(index int, slice []*structField) string {
if index+1 < len(slice) {
return ", "
}
return ""
},
"namedStructStr": func(pkg, fieldType string) string {
if s, ok := namedStructZeroStr[fieldType]; ok {
return s
}
return fmt.Sprintf("%s.%s{}", pkg, fieldType)
},
"processZeroValue": func(v string) string {
switch v {
case "Ptr(false)":
Expand Down Expand Up @@ -435,7 +451,7 @@ func Test{{ $key }}_String(t *testing.T) {
{{ .FieldName }}: {{.ZeroValue}},{{end}}{{end}}
}
want := ` + "`" + `{{ $package }}.{{ $key }}{{ $slice := . }}{
{{- range $ind, $val := .}}{{if .NamedStruct}}{{ .FieldName }}:{{ $package }}.{{ .FieldType }}{}{{else}}{{ .FieldName }}:{{ processZeroValue .ZeroValue }}{{end}}{{ isNotLast $ind $slice }}{{end}}}` + "`" + `
{{- range $ind, $val := .}}{{if .NamedStruct}}{{ .FieldName }}:{{ namedStructStr $package .FieldType }}{{else}}{{ .FieldName }}:{{ processZeroValue .ZeroValue }}{{end}}{{ isNotLast $ind $slice }}{{end}}}` + "`" + `
if got := v.String(); got != want {
t.Errorf("{{ $key }}.String = %v, want %v", got, want)
}
Expand Down
168 changes: 168 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading