This is an automated email from the ASF dual-hosted git repository. janhoy pushed a commit to branch branch_10x in repository https://gitbox.apache.org/repos/asf/solr.git
commit 5d19d802f6196da9c6d39bf88b4dea02f301e5ec Author: Jan Høydahl <[email protected]> AuthorDate: Tue May 12 09:14:51 2026 +0200 Fix bugs in validate-changelog-yaml.py (#4414) (cherry picked from commit 17747f3a3153202a334b6f2592d1b2915fd82e8b) --- dev-tools/scripts/validate-changelog-yaml.py | 37 ++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/dev-tools/scripts/validate-changelog-yaml.py b/dev-tools/scripts/validate-changelog-yaml.py index afc768e2cb7..0076a41184e 100644 --- a/dev-tools/scripts/validate-changelog-yaml.py +++ b/dev-tools/scripts/validate-changelog-yaml.py @@ -33,7 +33,8 @@ Checks: - Contains required 'authors' field with at least one author - Each author has a 'name' field (non-empty string) - Contains either 'links' or 'issues' field (or both) -- If 'issues' is present, it must be an integer not exceeding 17000 +- If 'issues' is present, it must be a list of integers not exceeding 17000 +- If 'links' is present, each entry must be a mapping with 'name' and 'url' fields (not a plain string) - Comment block is removed """ @@ -114,12 +115,38 @@ def validate_changelog_yaml(file_path): # Validate 'issues' field if present if 'issues' in data: - if not isinstance(data['issues'], int): - print(f"::error file={file_path}::Field 'issues' must be an integer") + if not isinstance(data['issues'], list): + print(f"::error file={file_path}::Field 'issues' must be a list of integers") return False - if data['issues'] > 17000: - print(f"::error file={file_path}::Field 'issues' value {data['issues']} points to a non-existing github PR. Did you intend to reference a JIRA issue, please use 'links'.") + for i, issue in enumerate(data['issues']): + if not isinstance(issue, int): + print(f"::error file={file_path}::Field 'issues' entry {i} must be an integer") + return False + if issue > 17000: + print(f"::error file={file_path}::Field 'issues' value {issue} points to a non-existing github PR. Did you intend to reference a JIRA issue, please use 'links'.") + return False + + # Validate 'links' field if present + if 'links' in data: + if not isinstance(data['links'], list): + print(f"::error file={file_path}::Field 'links' must be a list") return False + for i, link in enumerate(data['links']): + if not isinstance(link, dict): + print(f"::error file={file_path}::Link {i} must be a mapping with 'name' and 'url' fields, not a plain string") + return False + if 'name' not in link or not link['name']: + print(f"::error file={file_path}::Link {i} missing or empty 'name' field") + return False + if not isinstance(link['name'], str) or not link['name'].strip(): + print(f"::error file={file_path}::Link {i} 'name' must be a non-empty string") + return False + if 'url' not in link or not link['url']: + print(f"::error file={file_path}::Link {i} missing or empty 'url' field") + return False + if not isinstance(link['url'], str) or not link['url'].strip(): + print(f"::error file={file_path}::Link {i} 'url' must be a non-empty string") + return False # Validate that comments are removed for not_allowed in not_allowed_text:
