summaryrefslogtreecommitdiffstats
path: root/.github/actions/validate_pr_description/pr_template.py
blob: b21ff43bec689f623a7aaa2746cff203b96f8300 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""
PR template and categories definitions for YDB project.
Used by both validate_pr_description.py and cherry_pick.py to ensure consistency.
"""

# Issue reference patterns for validation
ISSUE_PATTERNS = [
    r"https://github.com/ydb-platform/[a-z\-]+/issues/\d+",
    r"https://st.yandex-team.ru/[a-zA-Z]+-\d+",
    r"#\d+",
    r"[a-zA-Z]+-\d+"
]

# Full PR template
PULL_REQUEST_TEMPLATE = """### Changelog entry <!-- a user-readable short description of the changes that goes to CHANGELOG.md and Release Notes -->

...

### Changelog category <!-- remove all except one -->

* New feature
* Experimental feature
* Improvement
* Performance improvement
* User Interface
* Bugfix
* Backward incompatible change
* Documentation (changelog entry is not required)
* Not for changelog (changelog entry is not required)"""

# Categories that require changelog entry
FOR_CHANGELOG_CATEGORIES = [
    "New feature",
    "Experimental feature",
    "User Interface",
    "Improvement",
    "Performance improvement",
    "Bugfix",
    "Backward incompatible change"
]

# Categories that don't require changelog entry
NOT_FOR_CHANGELOG_CATEGORIES = [
    "Documentation (changelog entry is not required)",
    "Not for changelog (changelog entry is not required)"
]

# All valid categories
ALL_CATEGORIES = FOR_CHANGELOG_CATEGORIES + NOT_FOR_CHANGELOG_CATEGORIES


def get_category_section_template() -> str:
    """Get the category section template as a string (for cherry_pick.py)"""
    return "\n".join([f"* {cat}" for cat in ALL_CATEGORIES])