Revision cbd5f433f3ff478fb26e9c09b9e3b5c74512e28d authored by Jonas Otten on 13 December 2023, 10:29:49 UTC, committed by GitHub on 13 December 2023, 10:29:49 UTC
It is not possible to attach a GCS cloud storage bucket whose name contains a dot. As stated [here](https://cloud.google.com/storage/docs/buckets#naming), GCS bucket names allow dots. This is a major problem for us, and this PR fixes this issue. --------- Co-authored-by: Jonas Otten <jootten@uos.de> Co-authored-by: Boris Sekachev <sekachev.bs@gmail.com> Co-authored-by: Maria Khrustaleva <maria@cvat.ai>
1 parent 2aae952
check_changelog_fragments.py
#!/usr/bin/env python3
import configparser
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
def main():
scriv_config = configparser.ConfigParser()
scriv_config.read(REPO_ROOT / 'changelog.d/scriv.ini')
scriv_section = scriv_config['scriv']
assert scriv_section['format'] == 'md'
md_header_level = int(scriv_section['md_header_level'])
md_header_prefix = '#' * md_header_level + '# '
categories = {s.strip() for s in scriv_section['categories'].split(',')}
success = True
def complain(message):
nonlocal success
success = False
print(f"{fragment_path.relative_to(REPO_ROOT)}:{line_index+1}: {message}", file=sys.stderr)
for fragment_path in REPO_ROOT.glob('changelog.d/*.md'):
with open(fragment_path) as fragment_file:
for line_index, line in enumerate(fragment_file):
if not line.startswith(md_header_prefix):
# The first line should be a header, and all headers should be of appropriate level.
if line_index == 0 or line.startswith('#'):
complain(f"line should start with {md_header_prefix!r}")
continue
category = line.removeprefix(md_header_prefix).strip()
if category not in categories:
complain(f"unknown category: {category}")
sys.exit(0 if success else 1)
main()
Computing file changes ...