generated from coulomb/repo-seed
REUSE-WP-0015: dedup owner entries, add report gaps (T02/T03/T05)
Some checks failed
ci / validate-registry (push) Has been cancelled
Some checks failed
ci / validate-registry (push) Has been cancelled
Remove 17 owner-migrated capabilities from reuse-surface index (keep activity-core stub). Add report gaps CLI, roster stats + gaps CI steps. T01 remains operator-blocked on Gitea publish.
This commit is contained in:
@@ -3,10 +3,14 @@ from __future__ import annotations
|
||||
import argparse
|
||||
import json
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from reuse_surface.reports import (
|
||||
cohort_filters_from_args,
|
||||
collect_gap_report,
|
||||
format_cohort_json,
|
||||
format_cohort_markdown,
|
||||
format_gap_markdown,
|
||||
select_cohort,
|
||||
)
|
||||
|
||||
@@ -88,6 +92,38 @@ def test_format_cohort_json_payload():
|
||||
assert payload["filters"]["discovery_min"] == "D5"
|
||||
|
||||
|
||||
def test_collect_gap_report_from_roster():
|
||||
root = Path(__file__).resolve().parent.parent
|
||||
roster = root / "registry/federation/local-repo-roster.yaml"
|
||||
report = collect_gap_report(roster)
|
||||
assert report["summary"]["total"] == 60
|
||||
assert len(report["publish_fail"]) == 13
|
||||
assert report["empty_scaffold_count"] >= 40
|
||||
|
||||
|
||||
def test_format_gap_markdown_lists_publish_fail():
|
||||
report = {
|
||||
"roster_path": "/tmp/roster.yaml",
|
||||
"summary": {"total": 60, "established": 60, "publish_pass": 47},
|
||||
"publish_fail": [{"slug": "hub-core", "publish_note": "missing repo"}],
|
||||
"empty_scaffold_count": 1,
|
||||
"empty_scaffolds": ["ops-bridge"],
|
||||
"seeded_repos": [],
|
||||
"dedup_pending_local_owners": [],
|
||||
"local_capability_count": 3,
|
||||
}
|
||||
text = format_gap_markdown(report)
|
||||
assert "hub-core" in text
|
||||
assert "ops-bridge" in text
|
||||
|
||||
|
||||
def test_cmd_report_gaps_json(monkeypatch):
|
||||
from reuse_surface.cli import main
|
||||
|
||||
exit_code = main(["report", "gaps", "--format", "json"])
|
||||
assert exit_code == 0
|
||||
|
||||
|
||||
def test_cmd_report_cohorts_markdown(monkeypatch):
|
||||
from reuse_surface.cli import main
|
||||
|
||||
|
||||
Reference in New Issue
Block a user