feat(launch): friendly GitHub-limit message on Generate; document the score formula

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shay
2026-11-30 06:12:22 -08:00
co-authored by Claude Opus 5.5
parent b737a0171e
commit d907815f19
7 changed files with 78 additions and 1 deletions
+12
View File
@@ -203,3 +203,15 @@ def test_rate_limit_body_is_not_classified_as_valid_user_data():
assert apimod._is_github_not_found({"user": {"login": "alice"}}) is False
assert apimod._is_github_not_found({"user": {"message": "Not Found"}}) is True
assert apimod._is_github_not_found({"user": None}) is True
def test_data_miss_rate_limited_returns_503(client, monkeypatch):
# A spent GitHub quota is transient: the fetcher says so (503), so the
# generator can tell the user the card will build after the reset.
def fake_fetch(*_a, **_kw):
raise apimod.github.GitHubTransientError("REST rate limit exhausted")
monkeypatch.setattr(apimod.github, "fetch_github_data", fake_fetch)
r = client.get("/data/alice", headers={"X-Internal-Token": "secret"})
assert r.status_code == 503
assert r.get_json() == {"error": "github_rate_limited"}
assert dbmod.get_user("alice") is None