Submitters only saw a stale 5-point summary on the catalog page (it even listed a 'Released' requirement nothing enforces), while reviewers applied ten README rules plus criteria written nowhere public (credentials, approvals, disclosure, compatibility metadata, forks of bundled plugins). - plugin-catalog/README.md: rules 11-15 write down those review criteria; the rule list sits between admission-rules markers. - New developer-guide page 'Submitting to the plugin catalog': before you submit, the PR flow, the full rule block (verbatim mirror), pin updates, delisting vs removal, asking for a hook. - The /plugins 'Submit' links and the user-guide section point at it. - tests/website/test_catalog_rules_mirror.py fails when the two rule blocks differ; classify_changes makes a README-only edit run it. - AGENTS.md, plugins/AGENTS.md and CONTRIBUTING.md reference both files.
29 lines
1.2 KiB
Python
29 lines
1.2 KiB
Python
"""The catalog submission guide mirrors the canonical admission rules word for word.
|
|
|
|
``plugin-catalog/README.md`` is where reviewers and the CI gates point; the docs page is where
|
|
submitters read. A rule edited in one and not the other tells authors a different policy than
|
|
the one their PR is reviewed against.
|
|
"""
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
_BLOCK = re.compile(r"<!-- admission-rules:start[^>]*-->(.*?)<!-- admission-rules:end -->", re.S)
|
|
|
|
|
|
def _rules(path: Path) -> str:
|
|
match = _BLOCK.search(path.read_text(encoding="utf-8"))
|
|
assert match, f"{path.relative_to(ROOT)} lost its admission-rules markers"
|
|
return " ".join(match.group(1).split())
|
|
|
|
|
|
def test_docs_page_mirrors_readme_admission_rules():
|
|
readme = _rules(ROOT / "plugin-catalog" / "README.md")
|
|
docs = _rules(ROOT / "website" / "docs" / "developer-guide" / "plugins" / "catalog-submission.md")
|
|
assert re.search(r"\b1\. \*\*", readme)
|
|
assert docs == readme, (
|
|
"website/docs/developer-guide/plugins/catalog-submission.md must carry the exact rule block "
|
|
"from plugin-catalog/README.md (copy everything between the admission-rules markers)"
|
|
)
|