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:
ErrAlreadyExistsfor 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 usesListReleasesIterrelease.ListReleaseAssets()now usesListReleaseAssetsItertag.ListTags()now usesListTagsIterchecks.ListCheckRuns()now usesListCheckRunsForRefIterchecks.ListCheckSuites()now usesListCheckSuitesForRefIter
This simplifies the code and delegates pagination handling to the upstream library.
Documentation¶
- Added usage example to
Batchtype showing the Write/Delete/Commit workflow - Clarified that
search.Issue.MustAuthorUsername()andMustAuthorUserID()return default values on error (empty string and -1 respectively), unlike typical Go "Must" functions that panic - Added
TASKS.mdfor tracking refactoring opportunities
Tests¶
New test files added:
repo/constants_test.go- Tests for Git reference and file mode constantsrepo/errors_test.go- Tests forCommitError,BranchError,ForkError,BatchErrortag/constants_test.go- Tests for tag-related constantsauth/app_test.go- Added test forJWTExpiryconstant
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: