Repository navigation
Conversation
The -f/--full-history flag set the start year to the account's join year without bounding it to GitHub's launch year (2008). For accounts created before 2008 (e.g. mojombo), this requested contribution data for a pre-launch year, which the API rejects with a validation error. Clamp the computed start year to the launch year so full-history skylines work for pre-2008 accounts.
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.
Fixes #136.
Problem
gh skyline -f(full history) sets the start year to the account's join year without bounding it to GitHub's launch year (2008). For accounts created before 2008 (e.g.mojombo, created 2006), this requests contribution data for a pre-launch year, which the API rejects:Fix
Clamp the computed full-history start year to the launch year in
GenerateSkyline, so pre-2008 accounts render from 2008 onward (no contribution data exists earlier). The launch-year constant ininternal/utilsis exported (GitHubLaunchYear) so the clamp and the existing range validation share one source of truth.Tests
Added a
full range for account created before GitHub's launchcase (join year 2006) toTestGenerateSkyline. To make the test meaningful,MockGitHubClient.FetchContributionsnow enforces the sameyear >= 2008contract the real client does — previously the mock accepted any year, which masked this bug.Validation
Go 1.26.3 on Linux:
go test ./...— all packages pass.failed to fetch contributions: [VALIDATION] year cannot be before GitHub's launch (2008)); with the clamp in place it passes.go vet ./...— clean.golangci-lint runon the touched packages —0 issues.