Skip to content

Conversation

@taniandjerry
Copy link
Contributor

@taniandjerry taniandjerry commented Nov 17, 2025

This PR adds a script and a txt file to automate generating the monthly Community All-Stars rankings (https://block.github.io/goose/community) for a goose recipe! This addition also makes it so we can update who is involved in the goose project (goose devs, devPrograms, community core maintainers, etc.) easily via future PRs.

Files Added

  • scripts/community_stars.py: Python script that analyzes GitHub contributor statistics
  • scripts/community_stars_teams.txt: Team categorization lists (easy to update via PR)

community_stars_teams.txt Categories:

  • Goose maintainers (goose devs and devPrograms folks working on goose, excluded from all-stars programs)
  • Block, non-goose (anyone from across Block that are eligible for Team Stars, largely references folks who have contributed to goose already)
  • External, goose (core maintainers, excluded from all-stars)
  • External (all open source community members that are eligible for Community All-Stars, mostly here to reference past contributions so far up till now)
  • Bots (always excluded)

How the recipe works:

  1. Fetch all contributor data from GitHub API
  2. Filter to only the time period asked for via prompt (examples: Month YYYY (like November 2025); November 1, 2025 - November 17, 2025 (current date); etc.)
  3. Categorize contributors using the team list txt file
  4. Excludes bots, goose maintainers, and external goose folks
  5. Rank by score (commits + total lines changed) - same as what is done already in https://github.com/block/goose/pulse
  6. Separates the rankings into the following:
  • Top 5 Community All-Stars (aka External contributors; External only)
  • Top 5 Team Stars (aka Internal contributors; Block, non-goose only)
  • Monthly Leaderboard (all contributors for the month in order of commits + total lines changed)
  1. Output as a simple list in chat (no file outputs)

Example Output

======================================================================
COMMUNITY STARS - NOVEMBER 2024
(Period: November 01, 2024 - November 30, 2024)
======================================================================

🏆 TOP 5 COMMUNITY ALL-STARS (External Contributors)
----------------------------------------------------------------------
1. @contributor1         -  15 commits,  1,234 lines
2. @contributor2         -  10 commits,    987 lines
...

⭐ TOP 5 TEAM STARS (Block, non-goose)
----------------------------------------------------------------------
1. @teamember1           -  20 commits,  2,345 lines
2. @teamember2           -  12 commits,  1,567 lines
...

📊 MONTHLY LEADERBOARD (All Contributors)
----------------------------------------------------------------------
 1. @contributor1         -  15 commits,  1,234 lines [External]
 2. @teamember1           -  20 commits,  2,345 lines [Block]
...

Include Discord alongside pull requests and GitHub discussions as a platform where technical and process decisions are made through consensus.
Copilot AI review requested due to automatic review settings November 17, 2025 22:22
Copy link
Contributor

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

This PR adds tooling to generate monthly Community Stars rankings for the goose repository contributors.

  • Introduces a Python script that analyzes GitHub contributor statistics and generates rankings for external contributors and Block team members
  • Adds a team categorization file that separates contributors into maintainers, Block employees, external contributors, and bots
  • Updates governance documentation to clarify that decisions can be made through Discord in addition to GitHub

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
scripts/community_stars.py New Python script that fetches contributor data, categorizes contributors, and generates monthly rankings based on commits and lines changed
scripts/community_stars_teams.txt New team categorization file listing usernames organized by contributor type (maintainers, Block non-goose team, external contributors, bots)
GOVERNANCE.md Minor update to include Discord as a channel for decision-making alongside pull requests and GitHub discussions

This adds tooling to generate monthly Community Stars rankings for the goose repository.

Files added:
- scripts/community_stars.py: Python script that analyzes GitHub contributor stats
- scripts/community_stars_teams.txt: Team categorization lists (easy to update via PR)

Features:
- Analyzes contributions by time period (monthly or date range)
- Categorizes contributors into: Goose maintainers, Block non-goose, External, Bots
- Generates Top 5 Community All-Stars (external contributors)
- Generates Top 5 Team Stars (Block employees, non-goose)
- Outputs monthly leaderboard with all eligible contributors
- Scoring: commits + total lines changed (additions + deletions)

Usage:
  curl -s -H 'Accept: application/vnd.github.v3+json' \
    'https://api.github.com/repos/block/goose/stats/contributors' > /tmp/github_contributors.json
  python3 scripts/community_stars.py 'November 2024'

The script can load team lists from local file or GitHub URL, making it usable
both locally and in automated workflows.
@taniandjerry taniandjerry force-pushed the community-stars-script branch from d7e4f2c to 9c9fdd9 Compare November 17, 2025 22:31
Copilot AI review requested due to automatic review settings November 17, 2025 22:40
- Fix case-insensitive month parsing bug (capitalize month name)
- Add JSON decode error handling for malformed GitHub API responses
- Improve External section header matching to use startswith for safety
Copy link
Contributor

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 2 out of 2 changed files in this pull request and generated no new comments.

@block block deleted a comment from Copilot AI Nov 17, 2025
@taniandjerry taniandjerry requested a review from Copilot November 17, 2025 22:50
@taniandjerry taniandjerry changed the title Add Community Stars analysis script and team lists Add Community Stars recipe script and txt file Nov 17, 2025
Copy link
Contributor

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 2 out of 2 changed files in this pull request and generated 1 comment.

Copy link
Contributor

@blackgirlbytes blackgirlbytes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you put this scripts directory in the documentation directory instead? thanks!

- Move community_stars.py to documentation/scripts/
- Move community_stars_teams.txt to documentation/scripts/
- Better organization for documentation-related scripts
@taniandjerry taniandjerry requested a review from a team as a code owner November 18, 2025 14:24
@taniandjerry taniandjerry changed the title Add Community Stars recipe script and txt file docs: Add Community Stars recipe script and txt file Nov 18, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

PR Preview Action v1.6.0
Preview removed because the pull request was closed.
2025-11-18 15:43 UTC

@taniandjerry
Copy link
Contributor Author

can you put this scripts directory in the documentation directory instead? thanks!

Done, thank you for that!

- Remove %m/%d/%Y (US) and %d/%m/%Y (international) formats
- Keep only unambiguous formats: Month names and ISO 8601 (YYYY-MM-DD)
- Update documentation and error messages
- Addresses Copilot review comment about ambiguous date parsing
Copilot AI review requested due to automatic review settings November 18, 2025 15:03
Copy link
Contributor

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 2 out of 2 changed files in this pull request and generated 3 comments.

Comment on lines +77 to +87
username = line.lower()
if current_section == 'goose_maintainers':
goose_maintainers.add(username)
elif current_section == 'block_non_goose':
block_non_goose.add(username)
elif current_section == 'external_goose':
external_goose.add(username)
elif current_section == 'external':
external.add(username)
elif current_section == 'bots':
bots.add(username)
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bot username matching is case-sensitive but will fail for bot usernames with different casing. The brackets in bot names like dependabot[bot] should be lowercased when stored in line 87. Consider applying .lower() to the entire username including brackets to ensure consistent matching.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this feedback to add line.lower()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay cool! I undid the GitHub access token change

The suggested change from copilot for reference was
curl -s -H 'Authorization: token YOUR_TOKEN' -H 'Accept: application/vnd.github.v3+json' ...

Reverted it back to the simple version originally used
curl -s -H 'Accept: application/vnd.github.v3+json' 'https://api.github.com/repos/block/goose/stats/contributors' > /tmp/github_contributors.json

So that people using the recipe can just copy/paste the command without needing to create a GitHub token first.

Copilot AI review requested due to automatic review settings November 18, 2025 15:17
taniandjerry and others added 2 commits November 18, 2025 10:18
- Document that .lower() is applied to all usernames including bot names
- Clarify that bot names with brackets (e.g., 'dependabot[bot]') are handled
- Address Copilot review comment about consistent case handling
Copy link
Contributor

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 2 out of 2 changed files in this pull request and generated 5 comments.

# Load GitHub data
github_data_file = '/tmp/github_contributors.json'
try:
with open(github_data_file, 'r') as f:
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing explicit encoding parameter when opening file. Add encoding='utf-8' to ensure consistent behavior across platforms: with open(github_data_file, 'r', encoding='utf-8') as f:

Suggested change
with open(github_data_file, 'r') as f:
with open(github_data_file, 'r', encoding='utf-8') as f:

Copilot uses AI. Check for mistakes.
Tania Chakraborty and others added 2 commits November 18, 2025 10:23
- Remove requirement for personal access token
- Keep simple curl command without authentication
- Makes the script easier to use for most cases
Copilot AI review requested due to automatic review settings November 18, 2025 15:26
Copy link
Contributor

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 2 out of 2 changed files in this pull request and generated 4 comments.

Comment on lines 76 to 77
# Add username to appropriate set (lowercase for case-insensitive matching)
# This handles bot names like "dependabot[bot]" -> "dependabot[bot]"
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment on line 77 says "This handles bot names like 'dependabot[bot]' -> 'dependabot[bot]'" but this is misleading - the code converts to lowercase, so it actually becomes "dependabot[bot]" (lowercase). The comment suggests no transformation occurs, which is incorrect.

Suggested change
# Add username to appropriate set (lowercase for case-insensitive matching)
# This handles bot names like "dependabot[bot]" -> "dependabot[bot]"
# Add username to appropriate set (convert to lowercase for case-insensitive matching)
# This handles bot names like "Dependabot[Bot]" -> "dependabot[bot]"

Copilot uses AI. Check for mistakes.
Comment on lines +171 to +175
# Skip if author is None (deleted users)
if contributor.get('author') is None:
continue

username = contributor['author']['login']
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential index error if GitHub API returns empty author data. While line 172 checks if contributor.get('author') is None, it doesn't protect against the case where the 'author' key exists but contains an empty dict or lacks the 'login' key. This would cause a KeyError on line 175.

Suggested change
# Skip if author is None (deleted users)
if contributor.get('author') is None:
continue
username = contributor['author']['login']
# Skip if author is None, not a dict, or missing 'login' (deleted or anonymized users)
author = contributor.get('author')
if not isinstance(author, dict) or 'login' not in author:
continue
username = author['login']

Copilot uses AI. Check for mistakes.
contributors_data = json.load(f)
except FileNotFoundError:
print(f"Error: GitHub contributor data not found at {github_data_file}")
print("Please run: curl -s -H 'Accept: application/vnd.github.v3+json' 'https://api.github.com/repos/block/goose/stats/contributors' > /tmp/github_contributors.json")
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The error message instructs users to fetch data with a curl command that doesn't include authentication. The GitHub API has rate limits (60 requests/hour for unauthenticated requests vs 5000 for authenticated). For a repository statistics endpoint, unauthenticated requests may fail or return incomplete data. Consider updating the instructions to recommend using a GitHub token: curl -s -H 'Authorization: token $GITHUB_TOKEN' -H 'Accept: application/vnd.github.v3+json' ...

Suggested change
print("Please run: curl -s -H 'Accept: application/vnd.github.v3+json' 'https://api.github.com/repos/block/goose/stats/contributors' > /tmp/github_contributors.json")
print("Please run: curl -s -H \"Authorization: token $GITHUB_TOKEN\" -H 'Accept: application/vnd.github.v3+json' 'https://api.github.com/repos/block/goose/stats/contributors' > /tmp/github_contributors.json")
print("Set your GitHub personal access token in the GITHUB_TOKEN environment variable to avoid rate limits and ensure complete data.")

Copilot uses AI. Check for mistakes.
Comment on lines +187 to +192
for week in contributor['weeks']:
week_timestamp = week['w']
if start_timestamp <= week_timestamp <= end_timestamp:
period_commits += week['c']
period_additions += week['a']
period_deletions += week['d']
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing validation for the GitHub API response format. If the API returns a 202 (Accepted) status with a message like "Computing statistics...", the JSON will have a different structure without the expected 'weeks' array. This would cause a KeyError on line 187 when trying to iterate over contributor['weeks'].

Copilot uses AI. Check for mistakes.
- Reference the pattern used elsewhere: 'goose' not in line.lower()
- Make it explicit that brackets are included in lowercasing
- Addresses Copilot feedback about consistent case handling
Copy link
Contributor

@blackgirlbytes blackgirlbytes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. No more comments, Copilot!

@taniandjerry taniandjerry merged commit 9f31616 into main Nov 18, 2025
18 checks passed
taniandjerry added a commit that referenced this pull request Nov 18, 2025
katzdave added a commit that referenced this pull request Nov 18, 2025
* 'main' of github.com:block/goose: (125 commits)
  Document Mistral AI provider (#5799)
  docs: Add Community Stars recipe script and txt file (#5776)
  chore: incorporate LF feedback (#5787)
  docs: quick launcher (#5779)
  Bump auto scroll threshold (#5738)
  fix: add one-time cleanup for linux hermit locking issues (#5742)
  Don't show update tray icon if GOOSE_VERSION is set (#5750)
  fix: get win node path from registry (#5731)
  Handle spaces in extension names also (#5770)
  Remove empty settings card for Scheduling Engine (#5771)
  fix windows cli build (#5768)
  fix: Implement a CredentialStore for auth (#5741)
  blog post: How to Successfully Migrate Your App with an AI Agent (#5762)
  Simplify finding `goosed` (#5739)
  More time for goosed (#5746)
  Match lower case (#5763)
  scan recipe for security when saving recipe (#5747)
  feat: trying grok for live test (#5732)
  Platform Extension MOIM (Minus One Info Message) (#5027)
  docs: remove hackathon banner (#5756)
  ...
michaelneale added a commit that referenced this pull request Nov 19, 2025
* main:
  feat/fix Re-enabled WAL with commit transaction management (Linux Verification Requested) (#5793)
  chore: remove autopilot experimental feature (#5781)
  Read paths from an interactive & login shell (#5774)
  docs: acp clients (#5800)
  Provider error proxy for simulating various types of errors (#5091)
  chore: Add links to maintainer profiles (#5788)
  Quick fix for community all stars script (#5798)
  Document Mistral AI provider (#5799)
  docs: Add Community Stars recipe script and txt file (#5776)
wpfleger96 added a commit that referenced this pull request Nov 20, 2025
* main: (33 commits)
  fix: support Gemini 3's thought signatures (#5806)
  chore: Add Adrian Cole to Maintainers (#5815)
  [MCP-UI] Proxy and Better Message Handling (#5487)
  Release 1.15.0
  Document New Window menu in macOS dock (#5811)
  Catch cron errors (#5707)
  feat/fix Re-enabled WAL with commit transaction management (Linux Verification Requested) (#5793)
  chore: remove autopilot experimental feature (#5781)
  Read paths from an interactive & login shell (#5774)
  docs: acp clients (#5800)
  Provider error proxy for simulating various types of errors (#5091)
  chore: Add links to maintainer profiles (#5788)
  Quick fix for community all stars script (#5798)
  Document Mistral AI provider (#5799)
  docs: Add Community Stars recipe script and txt file (#5776)
  chore: incorporate LF feedback (#5787)
  docs: quick launcher (#5779)
  Bump auto scroll threshold (#5738)
  fix: add one-time cleanup for linux hermit locking issues (#5742)
  Don't show update tray icon if GOOSE_VERSION is set (#5750)
  ...
BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
Co-authored-by: Tania Chakraborty <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Blair Allan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants