This is an automated email from the ASF dual-hosted git repository. imbajin pushed a commit to branch feat/oink-community-content in repository https://gitbox.apache.org/repos/asf/hugegraph-doc.git
commit b6e651ceba99d41f562ccea0c73c0ff5baaacac8 Author: dark <[email protected]> AuthorDate: Fri Sep 4 21:08:58 2026 +0800 fix(community): enforce role section order - record parsed Community role sections in document order - require exactly one PMC section before Committers - reject reordered HTML and Print artifacts before publication --- scripts/community_roster.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/community_roster.py b/scripts/community_roster.py index ba4d7cf38..89389c084 100644 --- a/scripts/community_roster.py +++ b/scripts/community_roster.py @@ -481,12 +481,15 @@ class _CommunityLinkParser(html.parser.HTMLParser): def __init__(self): super().__init__(convert_charrefs=True) self.role_stack: list[str | None] = [] + self.section_order: list[str] = [] self.links = {"pmc": [], "committers": []} def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: attributes = dict(attrs) if tag == "section": role = attributes.get("data-community-role") + if role in self.links: + self.section_order.append(role) self.role_stack.append(role if role in self.links else None) elif tag == "a" and self.role_stack and self.role_stack[-1]: href = attributes.get("href") @@ -502,6 +505,8 @@ def _rendered_role_links(rendered: str, html_output: bool) -> dict[str, list[str if html_output: parser = _CommunityLinkParser() parser.feed(rendered) + if parser.section_order != ["pmc", "committers"]: + return {"pmc": [], "committers": []} return parser.links starts = {} for role, heading in (("pmc", "PMC"), ("committers", "Committers")):
