-
Notifications
You must be signed in to change notification settings - Fork 37
Add user contribution stats table #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Expose ContributionsCollection totals and calendar data for GitHub users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a new Steampipe table to expose GitHub GraphQL ContributionsCollection data (summary counts + contribution calendar + per-repo commit contribution aggregates) for a given user and optional date range.
Changes:
- Added
github_user_contribution_statstable implementation backed by GitHub GraphQLuser { contributionsCollection(from,to) }. - Introduced new
models.ContributionsCollection(and related calendar/per-repo structs) plus column-include helpers and lightweight hydrators. - Added table documentation and registered the table in the plugin.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| github/table_github_user_contribution_stats.go | Implements the new table, query, and column definitions for contribution stats. |
| github/plugin.go | Registers the new table in the plugin table map. |
| github/models/contribution.go | Adds GraphQL models for ContributionsCollection, calendar, and per-repo aggregates. |
| github/contribution_utils.go | Adds include-variable helpers and hydrators to extract nested JSON fields. |
| docs/tables/github_user_contribution_stats.md | Adds user-facing documentation and example queries for the new table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Allow callers to cap repositories returned for commit contributions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Document max repository cap and fix markdown fences; enforce cap in code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {Name: "login", Type: proto.ColumnType_STRING, Description: "The login name of the user.", Transform: transform.FromQual("login")}, | ||
| {Name: "from_date", Type: proto.ColumnType_TIMESTAMP, Description: "Start date for the contribution window.", Transform: transform.FromQual("from_date")}, | ||
| {Name: "to_date", Type: proto.ColumnType_TIMESTAMP, Description: "End date for the contribution window.", Transform: transform.FromQual("to_date")}, | ||
| {Name: "max_repositories", Type: proto.ColumnType_INT, Description: "Maximum repositories returned for commit contributions by repository.", Transform: transform.FromQual("max_repositories")}, |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The max_repositories column is populated via transform.FromQual("max_repositories"), so it will be NULL unless the user explicitly provides the qualifier. However, the table applies a default of 100 when the qualifier is omitted, so the column description (and docs) are misleading about the effective value used. Consider returning the effective maxRepositories value (defaulting to 100) or updating the column description to clarify it only reflects the provided qualifier.
| {Name: "max_repositories", Type: proto.ColumnType_INT, Description: "Maximum repositories returned for commit contributions by repository.", Transform: transform.FromQual("max_repositories")}, | |
| {Name: "max_repositories", Type: proto.ColumnType_INT, Description: "Maximum repositories returned for commit contributions by repository. This column reflects only the provided qualifier value; when omitted, a default of 100 is used internally and this column will be NULL.", Transform: transform.FromQual("max_repositories")}, |
Summary
github_user_contribution_statstable with contribution totals and calendar dataTest plan
makeCloses #532