-
Notifications
You must be signed in to change notification settings - Fork 2.3k
docs: Add Community Stars recipe script and txt file #5776
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
Conversation
Include Discord alongside pull requests and GitHub discussions as a platform where technical and process decisions are made through consensus.
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
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.
d7e4f2c to
9c9fdd9
Compare
Co-authored-by: Copilot <[email protected]>
- 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
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 2 out of 2 changed files in this pull request and generated no new comments.
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 2 out of 2 changed files in this pull request and generated 1 comment.
blackgirlbytes
left a comment
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.
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
|
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
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 2 out of 2 changed files in this pull request and generated 3 comments.
| 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) |
Copilot
AI
Nov 18, 2025
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.
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.
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.
I agree with this feedback to add line.lower()
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.
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.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
- 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
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 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: |
Copilot
AI
Nov 18, 2025
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.
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:
| with open(github_data_file, 'r') as f: | |
| with open(github_data_file, 'r', encoding='utf-8') as f: |
- Remove requirement for personal access token - Keep simple curl command without authentication - Makes the script easier to use for most cases
Co-authored-by: Copilot <[email protected]>
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 2 out of 2 changed files in this pull request and generated 4 comments.
| # Add username to appropriate set (lowercase for case-insensitive matching) | ||
| # This handles bot names like "dependabot[bot]" -> "dependabot[bot]" |
Copilot
AI
Nov 18, 2025
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 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.
| # 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]" |
| # Skip if author is None (deleted users) | ||
| if contributor.get('author') is None: | ||
| continue | ||
|
|
||
| username = contributor['author']['login'] |
Copilot
AI
Nov 18, 2025
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.
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.
| # 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'] |
| 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") |
Copilot
AI
Nov 18, 2025
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.
[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' ...
| 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.") |
| 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'] |
Copilot
AI
Nov 18, 2025
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.
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'].
- 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
blackgirlbytes
left a comment
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.
LGTM. No more comments, Copilot!
This reverts commit 9f31616.
* '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) ...
* 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)
* 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) ...
Co-authored-by: Tania Chakraborty <[email protected]> Co-authored-by: Copilot <[email protected]> Signed-off-by: Blair Allan <[email protected]>
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
community_stars_teams.txt Categories:
How the recipe works:
Example Output