Track repo visibility; surface public repos in output; fix JSON tags#46
Open
Track repo visibility; surface public repos in output; fix JSON tags#46
Conversation
… map The Billable field in Usage was a named struct with only Ubuntu, Macos, and Windows fields. Any runner environment keys returned by GitHub's API that don't match those three names (e.g. UBUNTU_ARM for ARM64 runners, or any future runner types) were silently dropped, causing TotalMs() to return 0. Change Billable to map[string]*UsageDetails so all runner environments are captured regardless of their key name. Update TotalMs() to iterate the map. Add JSON deserialization tests to verify both the standard API keys (UBUNTU, MACOS, WINDOWS) and additional runner types are counted correctly. Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Verify GitHub Actions usage for recent builds
Fix TotalMs() missing usage from non-standard runner environments
Mar 9, 2026
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions timing usage model so Usage.TotalMs() includes billable time from any runner environment key returned by the GitHub API (not just Ubuntu/MacOS/Windows), preventing silent drops for new/non-standard runner types.
Changes:
- Replace
Usage.Billablefrom a fixed struct tomap[string]*UsageDetails. - Update
TotalMs()to sum across all billable map entries. - Update and extend unit tests to cover API JSON formats and additional runner types.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| client/client.go | Switch billable usage to a map and sum all entries in TotalMs() |
| client/client_test.go | Update mocks/tests for the new billable shape and add JSON unmarshal coverage |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The GitHub workflow /timing API only tracks billable minutes for private
repositories. Public repos always return 0ms. Add a `Private bool` field
(json:"private") to Repository so the tool knows each repo's visibility,
then show "; public" in the human formatter's repo header line whenever a
repo is not private. This explains to users why they see 0ms for public
repos instead of leaving them wondering if something is broken.
Also add the missing json:"billable" tag to Usage.Billable (map field was
missing its tag, causing musttag linter failures), and add json:"private"
to Repository.Private for completeness.
Fix redundant &UsageDetails{} literals in test (pointer type already
implied by map value type).
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Copilot
AI
changed the title
Fix TotalMs() missing usage from non-standard runner environments
Track repo visibility; surface public repos in output; fix JSON tags
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub's
/timingAPI only reports billable minutes for private repos — public repos always return0ms. The tool showed0msfor public-repo workflows with no explanation.Changes
client/client.goPrivate bool \json:"private"`toRepository` — populated from the GitHub API response for every repo fetchjson:"billable"tag toUsage.Billable(was triggeringmusttaglinter onjson.Unmarshalcallsites)format/usage_summary.go— propagatePrivatefromRepositoryintorepoSummaryformat/human_formatter.go— append; publicto the repo header when!repo.Private:Tests — mark private test repos
Private: true; addTestHumanFormatter_PublicRepoandTestHumanFormatter_PublicRepo_NoWorkflows; fix redundant&UsageDetails{…}literals in map initializers✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.