Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ is ok, the app is not installed on the repo: install it from
https://github.com/apps/glama-ai/installations/new (only `pathiel`), then
Sync on Glama's admin page. Signing in to Glama with GitHub authorizes
the app but does not install it.
The two Dependabot lines stay "unavailable" even then: the Glama AI
app does not request GitHub's Dependabot alerts permission
(`vulnerability_alerts`), so it cannot read them on any repo. The script
prints the app's permissions; only Glama can change that.

The website (GitHub Pages) is the `gh-pages` branch: the landing page in
`site/` and the scoreboard in `docs/scoreboard/`, nothing else. After a
Expand Down
25 changes: 22 additions & 3 deletions scripts/glama_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@

PATHIEL = "Julian-dev28/pathiel"
INSTALL_URL = "https://github.com/apps/glama-ai/installations/new"
APP_URL = "https://api.github.com/apps/glama-ai"
# GitHub App permission -> the Glama lines it feeds. An app reads only what
# it requests; Glama AI did not request vulnerability_alerts on 2026-11-20,
# so its two Dependabot lines read "unavailable" on every repo.
APP_NEEDS = {"vulnerability_alerts": "Dependabot", "security_events": "code scanning"}
API = "https://api.github.com"

# Check-run conclusions that mean red; cancelled, skipped, neutral and stale do not.
Expand Down Expand Up @@ -134,6 +139,8 @@ def github_side(repo: str, get: Getter) -> dict:
except ValueError:
meta = {}
out["glama_maintainers"] = meta.get("maintainers") or []
_, app = get(APP_URL)
out["glama_app_permissions"] = (_json(app) or {}).get("permissions")
return out


Expand Down Expand Up @@ -180,10 +187,22 @@ def report(repo: str, glama: Optional[dict], gh: dict) -> Tuple[bool, str]:
+ (" (stale)" if iss.get("stale") else ""))
lines.append(f" releases: {sum(int(r.get('releaseCount') or 0) for r in rel)} "
f"({', '.join(r.get('month', '?') for r in rel) or 'none'})")
perms = gh.get("glama_app_permissions")
missing = [] if perms is None else [p for p in APP_NEEDS if p not in perms]
lines.append("Glama AI app (what it may read on any repo):")
if perms is None:
lines.append(" permissions not readable")
for p, feeds in APP_NEEDS.items():
if perms is not None:
lines.append(f" {'ok ' if p in perms else 'NO '} {feeds:<28} "
+ (f"{p}: {perms[p]}" if p in perms else
f"{p} not requested: Glama's {feeds} lines read \"unavailable\" on every repo "
"until Glama adds it to its app; nothing in this repo changes that"))
if green:
lines.append("GitHub has every signal on. If Glama still says Dependabot, code scanning or CI "
f"\"unavailable\", the Glama AI app is not installed on {repo}: install it at "
f"{INSTALL_URL} (Only select repositories: {repo.split('/')[1]}), then Sync on Glama's admin page.")
clear = [v for p, v in APP_NEEDS.items() if p not in missing] + ["CI"]
lines.append(f"GitHub has every signal on. If Glama still says {', '.join(clear)} \"unavailable\", "
f"the Glama AI app is not installed on {repo}: install it at {INSTALL_URL} "
f"(Only select repositories: {repo.split('/')[1]}), then Sync on Glama's admin page.")
else:
lines.append("Fix the FIX rows on GitHub first; Glama cannot report a signal GitHub does not have.")
return green, "\n".join(lines)
Expand Down
21 changes: 20 additions & 1 deletion tests/test_glama_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ def test_a_page_without_the_data_is_none_not_a_crash():
assert G.maintenance("<script>enqueue(\"not json\");</script>") is None


def fake_github(*, admin=True, alerts=204, setup="configured", runs=None, glama=("me",), dependabot=True):
GLAMA_APP = {"contents": "read", "metadata": "read", "repository_advisories": "read", "security_events": "read"}


def fake_github(*, admin=True, alerts=204, setup="configured", runs=None, glama=("me",), dependabot=True,
app=GLAMA_APP):
runs = [{"name": "Tests", "status": "completed", "conclusion": "success"}] if runs is None else runs
glama_json = base64.b64encode(json.dumps({"maintainers": list(glama)}).encode()).decode()
table = {
Expand All @@ -66,6 +70,7 @@ def fake_github(*, admin=True, alerts=204, setup="configured", runs=None, glama=
f"{API}/commits/main": (200, json.dumps({"sha": "abc1234def"}).encode()),
f"{API}/commits/abc1234def/check-runs?per_page=100": (200, json.dumps({"check_runs": runs}).encode()),
f"{API}/contents/glama.json": (200, json.dumps({"content": glama_json}).encode()),
G.APP_URL: (200, json.dumps({"permissions": app}).encode()),
}
return lambda url: table.get(url, (404, None))

Expand Down Expand Up @@ -111,3 +116,17 @@ def test_only_real_failures_turn_ci_red():
def test_the_token_only_goes_to_the_github_api():
assert G.C.sends_token(f"{API}/vulnerability-alerts")
assert not G.C.sends_token("https://glama.ai/mcp/servers/me/srv")


def test_the_app_not_requesting_dependabot_is_named_as_glamas_gap():
"""2026-11-20: after the install, code scanning and CI cleared on Glama and
both Dependabot lines stayed: the app never requests vulnerability_alerts."""
green, text = G.report(REPO, None, G.github_side(REPO, fake_github()))
assert green
assert "NO Dependabot" in text and "vulnerability_alerts not requested" in text
assert "ok code scanning" in text
assert 'still says code scanning, CI "unavailable"' in text # Dependabot is not blamed on the install
_, text = G.report(REPO, None, G.github_side(REPO, fake_github(app={**GLAMA_APP, "vulnerability_alerts": "read"})))
assert "NO " not in text and 'still says Dependabot, code scanning, CI "unavailable"' in text
_, text = G.report(REPO, None, G.github_side(REPO, fake_github(app=None)))
assert "permissions not readable" in text