Skip to content

Clean up repo analysis results and refactor #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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tools/analytics/org/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Stores cached data for GitHub API responses
cache/

# Gets temporarily created by the script
scale-config.yml

# Stores the output of the analysis
reports/
38 changes: 38 additions & 0 deletions tools/analytics/org/README.md
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
Loading