From 56b6653b35c4c6fea9bed3f0c620a7fe986fe85b Mon Sep 17 00:00:00 2001 From: abdulsaheel Date: Sun, 26 Jul 2026 14:05:32 +0530 Subject: [PATCH] =?UTF-8?q?fix(tool):=20chart=20only=20this=20repo=20?= =?UTF-8?q?=E2=80=94=20the=20workflow=20token=20can't=20read=20siblings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first live run of the new workflow failed, and the fail-closed behaviour added in the previous commit is the reason we found out cleanly rather than silently shipping a worse chart. A workflow's built-in GITHUB_TOKEN is scoped to its own repository, so reading OpenStrap/protocol from a job running in OpenStrap/edge returns 403 "Resource not accessible by integration". The generator listed all three repos, so the run aborted: error: gh api repos/OpenStrap/protocol/stargazers... failed: 403 — aborting rather than publishing a partial chart Which is exactly right. Had it still been the earlier warn-and-continue version, it would have quietly published an edge-only chart and committed it over the good three-series one, with nothing in the log saying so. Fix: default to charting this repo alone, which works with the built-in token. The repo list is now read from STAR_HISTORY_REPOS, so the sibling repos can be added later by supplying a PAT with read access to them — opt-in, rather than a default that 403s. Committed SVG regenerated to match, so local output and CI output are identical; otherwise the two would disagree and the workflow would commit every week, which is the churn the no-change guard exists to stop. Captions in the README and on the landing page updated to say the chart covers this repo, and how to widen it. --- README.md | 6 ++++-- docs/index.html | 2 +- docs/star-history.svg | 6 ------ tool/gen_star_history.py | 16 +++++++++++++++- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5a64c2d..50927b6 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ different band is worth a great deal — see ## Star history -Star history for edge, protocol and analytics +Star history for OpenStrap/edge That cliff in mid-July is [Hackaday](https://hackaday.com/2026/07/15/making-a-locked-down-wearable-work-without-a-subscription/) and [Adafruit](https://blog.adafruit.com/2026/07/15/openstrap-edge-makes-a-whoop-4-0-band-useful-without-a-subscription) @@ -253,7 +253,9 @@ covering it on the same day. ([workflow](.github/workflows/star-history.yml)) rather than embedded from star-history.com or starchart.cc — the first refuses these repos outright, the second rate-limits, and neither should be making a request from a page about -keeping your data to yourself. +keeping your data to yourself. Charts this repo only: a workflow's built-in token +can't read sibling repos. Set `STAR_HISTORY_REPOS` with a cross-repo PAT to add +them. ## Support the work diff --git a/docs/index.html b/docs/index.html index 831a443..29d3911 100644 --- a/docs/index.html +++ b/docs/index.html @@ -150,7 +150,7 @@

How it’s put together

Where it’s got to

- Star history for edge, protocol and analytics

The cliff in mid-July is Hackaday and Adafruit covering it on the same day. diff --git a/docs/star-history.svg b/docs/star-history.svg index c06f822..49c1a56 100644 --- a/docs/star-history.svg +++ b/docs/star-history.svg @@ -16,13 +16,7 @@ Mar 2026 Jul 2026 - - edge · 334 - -protocol · 11 - -analytics · 5 to 2026-07-25 diff --git a/tool/gen_star_history.py b/tool/gen_star_history.py index 1ece18d..c38dc3e 100644 --- a/tool/gen_star_history.py +++ b/tool/gen_star_history.py @@ -25,7 +25,21 @@ import sys from datetime import datetime, timezone -REPOS = ["OpenStrap/edge", "OpenStrap/protocol", "OpenStrap/analytics"] +# Which repos to plot. Defaults to edge alone, and that default is load-bearing: +# a workflow's built-in GITHUB_TOKEN is scoped to its OWN repository, so reading +# OpenStrap/protocol from a job running in OpenStrap/edge returns +# 403 "Resource not accessible by integration". Charting siblings needs a PAT +# with read access to them, so it's opt-in rather than a default that fails: +# +# STAR_HISTORY_REPOS="OpenStrap/edge,OpenStrap/protocol" python3 tool/gen_star_history.py +# +# Keep whatever CI uses identical to what you run locally. If the repo set +# differs between the two, the committed SVG flip-flops and the workflow commits +# a revision every week — the churn the fail-closed/no-change guards exist to +# prevent. +REPOS = [r.strip() for r in + os.environ.get("STAR_HISTORY_REPOS", "OpenStrap/edge").split(",") + if r.strip()] OUT = "docs/star-history.svg" W, H = 760, 300