[PR #2972] [MERGED] ci: consolidate star fetch into deploy workflow with Actions cache #11304

Closed
opened 2026-04-24 06:05:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/vinta/awesome-python/pull/2972
Author: @vinta
Created: 3/18/2026
Status: Merged
Merged: 3/18/2026
Merged by: @vinta

Base: masterHead: feature/fetch-stats-workflow


📝 Commits (10+)

  • ab18c7e refactor: reformat build.py to Black style and add llms.txt output
  • b6d1bf9 ci: use uv dependency groups and Makefile target for deploy workflow
  • d65c6cc refactor: rename fetch_stats target and remove cache age gating
  • bbe145c ci: add workflow to fetch and commit GitHub stars daily
  • bfed6a5 ci: trigger deploy after fetch-github-stars workflow succeeds
  • 3c3f371 fix: use canonical GitHub Actions bot email with numeric ID
  • 0d9dfb2 ci: consolidate star fetch into deploy workflow using Actions cache
  • 4845157 gitignore website/data
  • 6148c13 feat: skip fetching repos whose cache entry is still fresh
  • 957d685 ci: run fetch-stars step on every workflow trigger

📊 Changes

7 files changed (+296 additions, -3227 deletions)

View changed files

📝 .github/workflows/deploy-website.yml (+34 -2)
📝 .gitignore (+1 -0)
📝 Makefile (+1 -1)
📝 website/build.py (+165 -75)
website/data/github_stars.json (+0 -3146)
📝 website/fetch_github_stars.py (+3 -3)
📝 website/tests/test_fetch_github_stars.py (+92 -0)

📄 Description

Summary

  • Merge the standalone fetch-github-stars workflow into deploy-website, using actions/cache to persist website/data/github_stars.json between runs
  • Remove bot commits from git history — star data no longer tracked in git
  • Add CACHE_MAX_AGE_HOURS = 12 staleness check so fresh data isn't re-fetched unnecessarily
  • Fetch runs on every trigger (push and schedule) but the script skips repos cached within 12 hours
  • If no star data is available (no cache + fetch failed), the build fails with a clear error

Changes

  • .github/workflows/deploy-website.yml — removed workflow_run, added schedule cron, cache restore/save/verify steps
  • .github/workflows/fetch-github-stars.yml — deleted
  • website/fetch_github_stars.py — added CACHE_MAX_AGE_HOURS = 12 with total_seconds()/3600 (avoids .days rounding bug)
  • website/data/github_stars.json — untracked + gitignored
  • Tests cover both fresh-cache-skip and stale-cache-fetch behaviors

Test plan

  • uv run pytest website/tests/ -v — all 96 tests pass
  • Verify scheduled run fetches stars and caches data
  • Verify push-triggered run restores cached stars and builds

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/vinta/awesome-python/pull/2972 **Author:** [@vinta](https://github.com/vinta) **Created:** 3/18/2026 **Status:** ✅ Merged **Merged:** 3/18/2026 **Merged by:** [@vinta](https://github.com/vinta) **Base:** `master` ← **Head:** `feature/fetch-stats-workflow` --- ### 📝 Commits (10+) - [`ab18c7e`](https://github.com/vinta/awesome-python/commit/ab18c7e54c216753ed9eb61dd59a6acdd221ad0e) refactor: reformat build.py to Black style and add llms.txt output - [`b6d1bf9`](https://github.com/vinta/awesome-python/commit/b6d1bf930700657c559350a9dc4214024312d35d) ci: use uv dependency groups and Makefile target for deploy workflow - [`d65c6cc`](https://github.com/vinta/awesome-python/commit/d65c6ccd6413253cc15643af42e00ee7bf03a4b9) refactor: rename fetch_stats target and remove cache age gating - [`bbe145c`](https://github.com/vinta/awesome-python/commit/bbe145cb3659fb1a709aa854197496c9eae6f7d5) ci: add workflow to fetch and commit GitHub stars daily - [`bfed6a5`](https://github.com/vinta/awesome-python/commit/bfed6a5c81ec0f3f9a1f54631a42f16c92c18696) ci: trigger deploy after fetch-github-stars workflow succeeds - [`3c3f371`](https://github.com/vinta/awesome-python/commit/3c3f371791586f7dc2e299a9f02c4af797abfa2d) fix: use canonical GitHub Actions bot email with numeric ID - [`0d9dfb2`](https://github.com/vinta/awesome-python/commit/0d9dfb27136cda016e2d4204b7483c607e897842) ci: consolidate star fetch into deploy workflow using Actions cache - [`4845157`](https://github.com/vinta/awesome-python/commit/484515775fc32470b9c337ec7d49831a1f5e4cdc) gitignore website/data - [`6148c13`](https://github.com/vinta/awesome-python/commit/6148c13c0cb9c47c2fc0a1d48f4d48b4b1648d81) feat: skip fetching repos whose cache entry is still fresh - [`957d685`](https://github.com/vinta/awesome-python/commit/957d685ff481ac25e04a82453ebd5b595828ba33) ci: run fetch-stars step on every workflow trigger ### 📊 Changes **7 files changed** (+296 additions, -3227 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/deploy-website.yml` (+34 -2) 📝 `.gitignore` (+1 -0) 📝 `Makefile` (+1 -1) 📝 `website/build.py` (+165 -75) ➖ `website/data/github_stars.json` (+0 -3146) 📝 `website/fetch_github_stars.py` (+3 -3) 📝 `website/tests/test_fetch_github_stars.py` (+92 -0) </details> ### 📄 Description ## Summary - Merge the standalone fetch-github-stars workflow into deploy-website, using `actions/cache` to persist `website/data/github_stars.json` between runs - Remove bot commits from git history — star data no longer tracked in git - Add `CACHE_MAX_AGE_HOURS = 12` staleness check so fresh data isn't re-fetched unnecessarily - Fetch runs on every trigger (`push` and `schedule`) but the script skips repos cached within 12 hours - If no star data is available (no cache + fetch failed), the build fails with a clear error ## Changes - `.github/workflows/deploy-website.yml` — removed `workflow_run`, added `schedule` cron, cache restore/save/verify steps - `.github/workflows/fetch-github-stars.yml` — deleted - `website/fetch_github_stars.py` — added `CACHE_MAX_AGE_HOURS = 12` with `total_seconds()/3600` (avoids `.days` rounding bug) - `website/data/github_stars.json` — untracked + gitignored - Tests cover both fresh-cache-skip and stale-cache-fetch behaviors ## Test plan - [x] `uv run pytest website/tests/ -v` — all 96 tests pass - [ ] Verify scheduled run fetches stars and caches data - [ ] Verify push-triggered run restores cached stars and builds 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-24 06:05:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-python#11304