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
18 changes: 16 additions & 2 deletions scripts/adoption_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ def render(history):
[
f"Baseline **{baseline['date']}** (UTC). "
f"Milestone snapshot **{milestone['date']}** (UTC), "
f"the first capture on or after **{MILESTONE_DATE}**. "
"Rolling download windows may differ.",
f"the first capture on or after **{MILESTONE_DATE}**.",
"",
"| Metric | Baseline | Milestone | Change |",
"| --- | ---: | ---: | ---: |",
Expand All @@ -254,6 +253,21 @@ def render(history):
old, new = baseline[key], milestone[key]
change = "—" if old is None or new is None else f"{new - old:+,}"
lines.append(f"| {label} | {format_count(old)} | {format_count(new)} | {change} |")
for label, snapshot in (("baseline", baseline), ("milestone", milestone)):
missing = [name for key, name in METRICS.items() if snapshot[key] is None]
if missing:
lines.extend(
["", f"The {label} capture lacks these metrics. {', '.join(missing)}."]
)
lines.extend(
[
"",
"The npm download windows are "
f"{baseline.get('npm_window') or 'unavailable'} for the baseline and "
f"{milestone.get('npm_window') or 'unavailable'} for the milestone. "
"PyPI reports a rolling month, and NuGet reports lifetime downloads.",
]
)
lines.extend(
[
"",
Expand Down
27 changes: 27 additions & 0 deletions tests/test_adoption_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,30 @@ def test_new_adoption_capture_counts_verified_integration_evidence(
assert "| Verified integrations | 2 |" in dashboard
assert "[LangChain](https://github.com/jmmana/sqlguardllm/issues/169)" in dashboard
assert "[Provider catalog](" + script["LANGCHAIN_CATALOG"] + ")" in dashboard


def test_partial_milestone_reports_which_capture_lacks_each_metric() -> None:
script = runpy.run_path(str(SCRIPT))
baseline = script["BASELINE"]
milestone = {
**baseline,
"date": script["MILESTONE_DATE"],
"stars": None,
"pypi": None,
"nuget": 92,
"integrations": 2,
"npm_window": "2027-01-28 to 2027-02-26",
}
later = {**milestone, "date": "2027-03-01", "stars": 20, "pypi": 2000}

dashboard = script["render"]([baseline, milestone, later])
assert (
"The baseline capture lacks these metrics. NuGet downloads, Verified integrations."
in dashboard
)
assert "The milestone capture lacks these metrics. Stars, PyPI downloads." in dashboard
assert "| Stars | 9 | — | — |" in dashboard
assert (
"2026-10-30 to 2026-11-28 for the baseline and 2027-01-28 to 2027-02-26 for the milestone."
in dashboard
)
Loading