Skip to content

Feat/go modules migration#26

Merged
fedir merged 27 commits into
masterfrom
feat/go-modules-migration
May 24, 2026
Merged

Feat/go modules migration#26
fedir merged 27 commits into
masterfrom
feat/go-modules-migration

Conversation

@fedir

@fedir fedir commented May 24, 2026

Copy link
Copy Markdown
Owner

Complete modernization of ghstat for Go 1.26 + macOS M4, plus a major hybrid analysis feature that makes stats reliable for all repos including inactive ones.

Infrastructure

  • Migrate from GOPATH to Go modules (go.mod / go.sum)
  • Replace deprecated ioutil with io/os
  • Replace Travis CI with GitHub Actions
  • Add Makefile with all developer commands (build, test, vet, cache-clear, clone-clear, rate-limit, run-all, etc.)

Auth & configuration

  • Switch GitHub auth from basic (GH_USR/GH_PASS) to Bearer token (GH_TOKEN)
  • Auto-load .env on startup via godotenv
  • Configurable HTTP timeout (GH_HTTP_TIMEOUT), stats retry count (GH_STATS_MAX_RETRIES) and interval (GH_STATS_RETRY_INTERVAL) via .env
  • Lazy HTTP client init so .env values are respected

Hybrid analysis (main feature)

  • Every repo is now analysed from two sources merged into one record: GitHub API (stars, forks, issues, license, author, tags) + local git clone (commits, additions/deletions, commit
    size, contribution period, returning contributors)
  • On first run repos are cloned to tmp/projects/; on re-runs clones are updated (git fetch + reset --hard origin/HEAD)
  • Solves the stats/contributors 202-forever problem for old/inactive repos — local git is always authoritative for commit history

UX

  • -f output path is now required (no silent default)
  • Per-repo progress logging with timing; overall [X/N] counter
  • make cache-clear preserves clones; new make clone-clear target

Stats updated

  • All 29 CSV files refreshed with hybrid data
  • Framework lists modernized: Go (added fiber, beego new org), Rust (axum, Rocket, warp, leptos), JS (react/vue/angular/svelte/solid + express/fastify/nest/koa/hono +
    next/nuxt/remix/sveltekit/analog), PHP CMS (craftcms, statamic)

Tests

  • Coverage: main package 87% → 94%, new localstat package 53%
  • Added tests for ranking logic, CSV formatting, cache clearing, git stat functions, contributor math

fedir added 27 commits May 24, 2026 13:35
@fedir fedir merged commit c160dd2 into master May 24, 2026
2 checks passed
@fedir fedir deleted the feat/go-modules-migration branch May 24, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant