Release Notes v0.13.0¶
This release upgrades go-github from v84 to v88, adds cross-period aggregation for profile statistics, and expands test coverage for graphql and sarif packages.
Highlights¶
- go-github v88: Upgraded from v84 to v88 with updated API patterns
- Cross-Period Aggregation: New
AggregateMonthlyStatsfunction for computing quarterly/yearly statistics - Enhanced Test Coverage: Added comprehensive tests for graphql and sarif packages
Breaking Changes¶
go-github v88 API Changes¶
The go-github library v88 introduced breaking changes to client creation:
Before (v84):
After (v88):
Key changes:
NewClientnow returns(*Client, error)instead of*ClientWithAuthTokenandWithEnterpriseURLsare nowClientOptionsFuncparameters passed toNewClient, not methods onClient
If you use gogithub functions (like auth.NewGitHubClient), this change is handled internally. Direct go-github usage in your code will need updating.
New Features¶
Cross-Period Aggregation¶
Aggregate monthly statistics into quarterly or yearly summaries:
import "github.com/grokify/gogithub/profile"
// Get monthly stats for multiple months
months := []profile.MonthlyStats{...}
// Aggregate into quarterly/yearly totals
aggregated := profile.AggregateMonthlyStats(months)
fmt.Printf("Total commits: %d\n", aggregated.Commits)
fmt.Printf("Total additions: %d\n", aggregated.Additions)
fmt.Printf("Unique repositories: %d\n", len(aggregated.Repositories))
New Types¶
profile.AggregatedStats¶
type AggregatedStats struct {
Commits int
PRs int
Reviews int
Issues int
Releases int
Additions int
Deletions int
NetAdditions int
Repositories map[string]bool // Unique repos across all months
}
profile.MonthlyStats.Repositories¶
The MonthlyStats struct now includes a Repositories field tracking which repos had commits each month:
type MonthlyStats struct {
Year int
Month int
MonthName string
Commits int
// ... other fields ...
Repositories map[string]bool // Repos with commits this month
}
Tests Added¶
graphql package¶
- Tests for
Visibilityconstants (VisibilityAll,VisibilityPublic,VisibilityPrivate) - Tests for
MonthlyCommitStats.YearMonth()method - Tests for
CommitStatsandRepoCommitStatsstructs - Tests for
monthlyMapToSlicefunction including sorting - Tests for
MonthlyContribution.YearMonth()method - Tests for
ContributionStatsstruct - Tests for
mapToMonthlyContributionsfunction with invalid date handling
sarif package¶
- Tests for
gzipCompress/gzipDecompresswith empty, large, and binary data - Tests for
UploadOptions,UploadResult, andUploadStatusstructs - Tests for
ProcessingStatuscomparison
Dependencies¶
| Dependency | Previous | Current |
|---|---|---|
github.com/google/go-github |
v84.0.0 | v88.0.0 |
github.com/grokify/mogo |
v0.74.1 | v0.74.6 |
actions/checkout |
6 | 7 |
Upgrade Notes¶
- Update imports: Change
go-github/v84togo-github/v88in your import paths - Handle NewClient errors:
github.NewClient()now returns an error - Use option functions:
WithAuthTokenandWithEnterpriseURLsare now passed toNewClient
Commits¶
| Type | Description | Commit |
|---|---|---|
| feat | Add cross-period aggregation for MonthlyStats | d5b8772 |
| chore(deps) | Upgrade go-github from v84 to v88 | b6058f9 |
| test | Add tests for commit stats types | dc0b868 |
| test | Add tests for contribution stats types | b1ea423 |
| test | Add tests for gzip compression and upload types | a411084 |