Skip to content

vectordotdev/github-tools

Repository files navigation

github-tools

Note

This repo is actively developed. Main branch may be rewritten.

Tools for extracting data from GitHub, storing it in a local SQLite database, querying it, and visualizing trends.

Directory Layout

src/             # Rust source (single binary: github-tools)
scripts/util/    # Python: plot.py (charts), json_to_csv.py (utility)
data/            # Committed snapshots: JSON inputs and PNG charts
  images/        # Committed PNG charts (promoted from out/images/)
out/             # Gitignored — all generated and local-only files
  historical/    # Raw JSON fetched from GitHub API
  db/            # SQLite databases
  summaries/     # Generated CSVs
  images/        # Generated PNG charts (promote to data/images/ to commit)
  purge/         # Purge audit logs (local only)

Build

cargo build --release
# Binary: target/release/github-tools

Configuration

Most commands take an --env-file pointing to a .env file:

GITHUB_TOKEN=...
REPO_OWNER=vectordotdev
REPO_NAME=vector
DOCKER_USERNAME=...   # purge commands only
DOCKER_PASSWORD=...   # purge commands only

Commands

github-tools <COMMAND>

Fetch:
  fetch-all          Fetch issues + discussions for all repos (workflow)
  fetch-issues       Fetch all issues/PRs for a repository
  fetch-discussions  Fetch all discussions for a repository
  fetch-labels       Fetch all labels for a repository

Pipeline:
  generate-all       Build DB + summaries for all repos (workflow)
  build-db           Load issues JSON into SQLite database
  generate-summaries Generate CSV summaries from SQLite database

Purge:
  purge-all          Run all purge operations (workflow)
  purge nightly      Purge old nightly images from GitHub and Docker Hub
  purge untagged     Purge untagged GitHub container images
  purge vector-dev   Purge old vector-dev images from Docker Hub

Maintenance:
  close-old-prs          Close PRs with 'meta: awaiting author' older than 6 months
  delete-stale-branches  Delete branches with no commits in 4 years
  remove-legacy-label    Remove legacy type labels from issues/PRs

Run github-tools <COMMAND> --help for full argument details.

Workflow

1. (Optional) Fetch fresh data from GitHub

github-tools fetch-all --env-file vector.env --env-file vrl.env

Writes to out/historical/. Promote to data/ to commit as a snapshot:

cp out/historical/issues/vectordotdev_vector_issues.json data/
cp out/historical/issues/vectordotdev_vrl_issues.json data/
cp out/historical/discussions/vectordotdev_vector_discussions.json data/
cp out/historical/discussions/vectordotdev_vrl_discussions.json data/

2. Generate DB, summaries, and charts

github-tools generate-all \
  --env-file vector.env --env-file vrl.env \
  --exclude-labels "no-changelog,meta: awaiting author"

# Charts (still Python):
python scripts/util/plot.py --env-file vector.env --input-dir out/summaries \
  --start $(date -d "$(date +%Y-%m-01) -12 months" +%Y-%m) \
  --exclude-labels "no-changelog,meta: awaiting author"

Promote charts to commit:

cp out/images/*.png data/images/

3. (Optional) Purge stale container images

github-tools purge-all --env-file vector.env --dry-run
github-tools purge-all --env-file vector.env  # omit --dry-run to execute

Audit logs written to out/purge/ (local only).

Trends

Vector

Issues

Monthly Issues


Top Issue Labels


Issue Label Counts


Top 5 Integration Issue Labels


Top Integration Issue By Label Total Count

Pull Requests

Monthly PRs


Top PR Labels


PR Label Counts


Top 5 Integration PR Labels


Top Integration PRs By Label Total Count

Discussions

TODO!


VRL

Issues

Monthly Issues


Top Issue Labels


Issue Label Counts

Pull Requests

Monthly PRs


Top PR Labels


PR Label Counts

About

GitHub management tools and insights (Experimental - LLM generated)

Topics

Resources

License

Stars

Watchers

Forks

Contributors