Skip to content

Conversation

@salekseev
Copy link

Summary

  • add ContributionsCollection models and column include helpers
  • add github_user_contribution_stats table with contribution totals and calendar data
  • add table documentation and register the table

Test plan

  • make

Closes #532

Expose ContributionsCollection totals and calendar data for GitHub users.
Copy link

Copilot AI left a 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_stats table implementation backed by GitHub GraphQL user { 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.
Copy link

Copilot AI left a 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.
Copy link

Copilot AI left a 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")},
Copy link

Copilot AI Jan 30, 2026

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.

Suggested change
{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")},

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add github_user_contribution_stats table for ContributionsCollection

1 participant