Skip to content

v0.12.1 Release Notes

Release Date: 2026-04-05

This patch release focuses on code quality improvements, enhanced documentation, and expanded test coverage. No new features or breaking changes.

Highlights

  • Code Quality: Constants extraction, token client deduplication, and go-github iterator adoption
  • Documentation: Usage examples and clarified method behavior
  • Testing: Expanded coverage for constants and error types

Refactored

Token Client Deduplication

The graphql package now imports NewTokenClient from the auth package instead of duplicating the OAuth2 client creation logic.

Constants Extraction

Magic strings have been extracted to named constants for better maintainability:

  • Git Reference Prefixes: RefHeadsPrefix (refs/heads/), RefTagsPrefix (refs/tags/)
  • File Modes: FileModeRegular (100644), FileModeExecutable (100755), FileModeSubmodule (160000), FileModeSymlink (120000)
  • Error Fragments: ErrAlreadyExists for consistent error matching
  • JWT Configuration: JWTExpiry (10 minutes) for GitHub App authentication

go-github Iterator Adoption

Replaced manual pagination loops with go-github v84's built-in range-over-func iterators:

  • release.ListReleases() now uses ListReleasesIter
  • release.ListReleaseAssets() now uses ListReleaseAssetsIter
  • tag.ListTags() now uses ListTagsIter
  • checks.ListCheckRuns() now uses ListCheckRunsForRefIter
  • checks.ListCheckSuites() now uses ListCheckSuitesForRefIter

This simplifies the code and delegates pagination handling to the upstream library.

Documentation

  • Added usage example to Batch type showing the Write/Delete/Commit workflow
  • Clarified that search.Issue.MustAuthorUsername() and MustAuthorUserID() return default values on error (empty string and -1 respectively), unlike typical Go "Must" functions that panic
  • Added TASKS.md for tracking refactoring opportunities

Tests

New test files added:

  • repo/constants_test.go - Tests for Git reference and file mode constants
  • repo/errors_test.go - Tests for CommitError, BranchError, ForkError, BatchError
  • tag/constants_test.go - Tests for tag-related constants
  • auth/app_test.go - Added test for JWTExpiry constant

Commits

Commit Type Description
8b3093e refactor Use auth.NewTokenClient in graphql package
e8879cf refactor Extract Git constants to centralized locations
8d5f601 refactor Extract JWT expiry duration to constant
53aa6ee docs Add TASKS.md for tracking refactoring work
1f0f739 docs Improve documentation for batch operations and search methods
9c5336c refactor Use go-github built-in iterators for pagination
6da1e28 test Add tests for constants and error types

Upgrading

This is a patch release with no breaking changes. Update your dependency:

go get github.com/grokify/gogithub@v0.12.1