-
Notifications
You must be signed in to change notification settings - Fork 102
Clean up repo analysis, refactor, and add more tools #6963
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
88bdd63
Merge local changes
ZainRizvi 24b9b1d
Update analysis
ZainRizvi 0258597
cleanup
ZainRizvi 2a232b8
Move more cache functions over
ZainRizvi 65e877e
Fix refactoring
ZainRizvi 50bc9bb
lint fixes
ZainRizvi 782b327
changes so far, with pytorch-labs remover and gh code search
ZainRizvi 81c59ad
Use CodeSearch to find files that should be updated in org
ZainRizvi 344bbc4
lint fixes
ZainRizvi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Stores cached data for GitHub API responses | ||
cache/ | ||
|
||
# Gets temporarily created by the script | ||
scale-config.yml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Organization Analytics Tools | ||
|
||
This directory contains a collection of scripts designed to analyze GitHub Actions runner usage and other organizational metrics across a GitHub organization's repositories. | ||
|
||
## Overview | ||
|
||
The tools in this directory help us understand how GitHub Actions runners are being utilized across our repositories. | ||
|
||
## Scripts | ||
|
||
### `analyze_runner_usage.py` | ||
|
||
**Purpose**: Analyzes GitHub Actions runner label usage across all repositories in a specified GitHub organization. | ||
|
||
**Key Features**: | ||
- Fetches all non-archived repositories in a GitHub organization | ||
- Extracts runner labels used in workflow jobs from recent workflow runs | ||
- Aggregates runner usage statistics across repositories | ||
- Compares runner labels against those defined in `scale-config.yml` and standard GitHub-hosted runners | ||
- Identifies unused or undefined runners | ||
- Generates comprehensive usage reports | ||
|
||
**Output**: Creates `runner_labels_summary.yml` with detailed analytics including: | ||
- Runner usage by repository | ||
- Repository usage by runner type | ||
- Repositories with zero workflow runs | ||
- Runners not defined in scale-config or standard GitHub runners | ||
- Usage patterns and trends | ||
|
||
### `cache_manager.py` | ||
|
||
**Purpose**: Helper script. Provides efficient caching functionality for GitHub API responses to optimize performance and avoid rate limiting. | ||
|
||
**Features**: | ||
- URL-based cache key generation | ||
- Intelligent cache invalidation | ||
- Rate limit optimization | ||
- Reduces redundant API calls during analysis |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.