CI: add category to changelog.py

This commit is contained in:
Max K 2024-05-28 12:53:52 +02:00
parent 324bec78ff
commit edf8d92cf0
4 changed files with 7 additions and 6 deletions

View File

@ -11,7 +11,7 @@ tests/ci/cancel_and_rerun_workflow_lambda/app.py
- Backward Incompatible Change
- Build/Testing/Packaging Improvement
- Documentation (changelog entry is not required)
- Critical Bug Fix (critical issues in non-experimental features, auto backport)
- Critical Bug Fix (crash, LOGICAL_ERROR, data loss, RBAC)
- Bug Fix (user-visible misbehavior in an official stable release)
- CI Fix or Improvement (changelog entry is not required)
- Not for changelog (changelog entry is not required)

View File

@ -285,9 +285,9 @@ close it.
)
self.backport_pr.add_to_labels(Labels.PR_BACKPORT)
if Labels.PR_CRITICAL_BUGFIX in [label.name for label in self.pr.labels]:
self.cherrypick_pr.add_to_labels(Labels.PR_CRITICAL_BUGFIX)
self.backport_pr.add_to_labels(Labels.PR_CRITICAL_BUGFIX)
elif Labels.PR_BUGFIX in [label.name for label in self.pr.labels]:
self.cherrypick_pr.add_to_labels(Labels.PR_BUGFIX)
self.backport_pr.add_to_labels(Labels.PR_BUGFIX)
self._assign_new_pr(self.backport_pr)
def ping_cherry_pick_assignees(self, dry_run: bool) -> None:

View File

@ -87,7 +87,7 @@ LABEL_CATEGORIES = {
"Bug Fix (user-visible misbehavior in official stable or prestable release)",
],
"pr-critical-bugfix": [
"Critical Bug Fix (critical issues in non-experimental features, auto backport)"
"Critical Bug Fix (crash, LOGICAL_ERROR, data loss, RBAC)"
],
"pr-build": [
"Build/Testing/Packaging Improvement",

View File

@ -25,6 +25,7 @@ categories_preferred_order = (
"New Feature",
"Performance Improvement",
"Improvement",
"Critical Bug Fix",
"Bug Fix",
"Build/Testing/Packaging Improvement",
"Other",
@ -112,7 +113,7 @@ def get_descriptions(prs: PullRequests) -> Dict[str, List[Description]]:
in_changelog = merge_commit in SHA_IN_CHANGELOG
if in_changelog:
desc = generate_description(pr, repos[repo_name])
if desc is not None:
if desc:
if desc.category not in descriptions:
descriptions[desc.category] = []
descriptions[desc.category].append(desc)
@ -187,7 +188,7 @@ def parse_args() -> argparse.Namespace:
# This function mirrors the PR description checks in ClickhousePullRequestTrigger.
# Returns False if the PR should not be mentioned changelog.
# Returns None if the PR should not be mentioned in changelog.
def generate_description(item: PullRequest, repo: Repository) -> Optional[Description]:
backport_number = item.number
if item.head.ref.startswith("backport/"):