feat(domain): add UserStats type (GIT-33 — PR 1/8)#39
Open
hurtki wants to merge 1 commit into
Open
Conversation
Introduces api/internal/domain.UserStats — the target structure for the GraphQL stats refactor. Mirrors the GraphQL response: PR/issue counts by state, totalCommits/totalPRReviews from contributionsCollection, top-100 repos aggregates (TotalRepos/TotalStars/Languages), and a ContributionCalendar with a CurrentStreak helper. Legacy GithubUserStats/GithubUserData/GithubRepository remain in place and continue to drive the existing flow; they will be removed in PR 7 once the new banner template fully consumes UserStats.
Owner
Author
Roadmap for the GIT-33 refactor — context for reviewPosting this so you have the full map of what's coming. This PR is just step 1 of 8. GoalReplace the current REST-based GitHub fetcher (2+ requests, then we calculate stats locally from raw repos/user data) with a single GraphQL request that returns all stats directly. Also adds a new banner design that uses the richer stats. Locked decisions (already discussed with the team)
Branch flowAll 8 PRs target the long-lived base branch PR breakdown
What to focus on for this PR specifically
|
Owner
Author
|
Will continue working on this plan in future |
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.
First PR in the GIT-33 series (Linear). All PRs target the long-lived base branch
hurtki/git-33-more-statistics-on-banner; that branch merges tomasterat the end.Summary
api/internal/domain.UserStats+ContributionCalendar/ContributionWeek/ContributionDaytotalCommits/totalPRReviews/totalPRsCreated/totalIssuesCreatedfromcontributionsCollection, top-100 repo aggregates (TotalRepos/TotalStars/Languages), and the contribution calendarContributionCalendar.CurrentStreak()— counts consecutive trailing days with >0 contributions; today=0 is treated as in-progress and does not break the streakOut of scope
GithubUserStats/GithubUserData/GithubRepositorydeliberately untouched. Removed in PR 7 once the new banner template fully consumesUserStats.Test plan
go build ./...clean for the api servicego test ./internal/domain/— 8 unit tests forCurrentStreak: empty, all-zero, all-active, mid-streak break, today=0 ignored, today+yesterday=0 → 0, multi-week streak, single active dayOpenPRs/ClosedPRs/MergedPRs(lifetime, by state) coexisting withTotalPRsCreated(last-year contributions) is the right model