Repository navigation
feat(render): chart GitHub stars added per day (7-day rolling avg) - #4
Conversation
…verage Cumulative stars hide whether one week grew 2x or 1/3 of the previous one. Add charts/stars_growth.svg: daily net additions (last 365 days) with a 7-day rolling average, mirroring the diff + 7D rolling mean that ActivityWatch/stats uses for download growth. The per-day series combines stars.csv (by starred_at) with the daily stargazers_count snapshots once stars.csv stops, interpolating missing snapshot days so collection gaps don't show up as spikes. Also fix 'Stars gained, last 30 days': it counted stars.csv rows only, which have not updated since 2026-09-14 (no STATS_GH_TOKEN), so it showed 1 instead of 36. It now uses the same combined series, and the table gains last-7 / previous-7 day rows.
|
@TimeToBuildBob review |
🤖 AI code reviewThis shard changes the star-collection workflow to use only the built-in GITHUB_TOKEN (removing STATS_GH_TOKEN), updates collect.py's token handling and docs, and adds a new growth chart in render.py. render.py gains star_totals() to build a daily star-count series from stars.csv and daily.csv snapshots, render_star_growth() to plot the 7-day rolling average of day-over-day changes, and build_summary() now computes stars_last_7d, stars_prev_7d, and stars_last_30d from that series. README.md adds the growth chart link and new summary rows plus caveats. This shard adds a new SVG chart file, charts/stars_growth.svg, which plots GitHub stars added per day with a 7-day rolling average. The chart includes a symlog y-axis, a fill between the daily values and the rolling average, a legend, and annotations for the busiest week and recent 7-day totals. The file is a generated matplotlib SVG output with embedded font definitions and path data. This shard adds the generated SVG chart Safe to merge — no P0/P1 findingsConfidence 5/5
✅ No thread-worthy findings. Advisory notes follow; they are retained without opening review threads. 1 advisory finding (summary-only, not scored)These P2 guard, heuristic, trade-off, or documentation claims are retained for judgment without opening review threads.
The summary JSON adds How this was verified: Checked the JSON file and the PR description. The fields are added as described. Files changed (6) — the diff as I read it
Previous review passes
Reviewed Maintainer commands
|
…rent Use daily.csv snapshots from the first snapshot on and stars.csv only before it (offset to meet the first snapshot), so the growth series stays net of unstars after the stargazer token is restored. Skip the growth chart when there is less than two days of history.
|
@TimeToBuildBob review |
…HUB_TOKEN only - stars_growth.svg now covers the full history on a symlog y-axis, so the October 2024 launch week (1,393 stars) and today's ~1/day both stay readable, and the busiest week is labelled. - Drop the optional STATS_GH_TOKEN secret. The workflow uses the built-in GITHUB_TOKEN only. GitHub refuses stargazer listings to it (403, REST and GraphQL alike) and to anonymous requests (401), so stars.csv only grows on local runs with a user token; every chart and summary number continues from the daily stargazers_count snapshots, so nothing goes stale. - Remove the temporary token probe workflow.
|
@TimeToBuildBob review |
Adds a /stats/ page to the site/next landing site: GitHub stars, PyPI and release downloads, and repository numbers from gptme/stats summary.json, with the charts gptme/stats publishes under charts/. Numbers are fetched at build time (with the existing committed fallback), charts are embedded from raw.githubusercontent.com, and charts gptme/stats doesn't publish yet (stars_growth.svg, gptme/stats#4) are left out until they exist. docs.yml now also rebuilds gptme.org daily after the stats collection run, so the page stays current without committing data here. The Stats nav link now points at the page, and it is added to the footer.
TimeToBuildBob
left a comment
There was a problem hiding this comment.
LGTM. Reviewed the actual logic:
star_totals(): offset stitching at the first snapshot is correct — cumulative pre-snapshot stars shifted so the two series meet. Linear interpolation for collection gaps is the right call over showing one-day spikes.build_summary(): parameterizedstars_gained(days, offset)is a clean refactor. One note: it returnsNonewhen the date isn't intotals— caller handles that fine (I checked the surrounding code).render_star_growth(): symlog withlinthresh=1correctly places zero and negative days;fill_betweenstep plot keeps SVG diffs small (good call). FixedLocator ticks cover the range well.- collect.py:
STATS_GH_TOKENremoval is correct — it was unused in CI and the chart path never needed per-star timestamps.
Safe to merge.
* feat(site): add gptme.org/stats/ page from gptme/stats Adds a /stats/ page to the site/next landing site: GitHub stars, PyPI and release downloads, and repository numbers from gptme/stats summary.json, with the charts gptme/stats publishes under charts/. Numbers are fetched at build time (with the existing committed fallback), charts are embedded from raw.githubusercontent.com, and charts gptme/stats doesn't publish yet (stars_growth.svg, gptme/stats#4) are left out until they exist. docs.yml now also rebuilds gptme.org daily after the stats collection run, so the page stays current without committing data here. The Stats nav link now points at the page, and it is added to the footer. * fix(site): order scheduled docs deploys with master pushes; don't require charts on /stats/
The cumulative star chart hides whether one week grew 2x or 1/3 of the previous one. This adds a growth chart next to it, using the same method as ActivityWatch/stats' download growth (day-over-day diff, 7-day rolling mean). It also makes star collection work with the built-in
GITHUB_TOKENonly.Growth chart (
render_star_growth)Series (
star_totals)daily.csvsnapshot (2026-09-14) on, it uses the snapshotstargazers_count, net of unstars, whether or notstars.csvis current.stars.csvbystarred_at, shifted to meet the first snapshot.Summary fix
"Stars gained, last 30 days" showed 1 because it counted rows in the stale
stars.csv. It now uses the same series (36), and the table gains "last 7 days" / "previous 7 days" rows (3 vs 8).No STATS_GH_TOKEN
GITHUB_TOKEN, and the optionalSTATS_GH_TOKENis removed.GITHUB_TOKENgets 403 "Resource not accessible by integration" from REST/stargazers(with and withoutstar+json) and from GraphQLrepository.stargazers.stargazers_countetc.) works fine withGITHUB_TOKEN.stars.csvstays as is, at a cost of one failed request per run. Every chart and summary number continues from the daily snapshots, so nothing goes stale.stars.csvcan still be filled in by running locally withGITHUB_TOKEN=$(gh auth token) uv run collect.py. The existing incremental tail-page fetch applies. Unstars since the last sync force a full resync (45 requests at 4.4k stars), which is trivial with a user token.stars.svg,pypi.svganddownloads.svgrender byte-identical.