Skip to content

Commit a1b7bee

Browse files
authored
chore: move changelogs to per-app and require conventional commits (#905)
* chore: use cliff for per-application changelogs * chore: add commitlint to CI to require conventional commit messages
1 parent 598bd56 commit a1b7bee

File tree

17 files changed

+885
-2
lines changed

17 files changed

+885
-2
lines changed

.github/workflows/commitlint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Conventional Commitlint
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
8+
jobs:
9+
commitlint:
10+
runs-on: ubuntu-latest
11+
name: Conventional Commitlint
12+
permissions:
13+
contents: read
14+
pull-requests: read
15+
steps:
16+
- name: Conventional Commitlint
17+
uses: opensource-nepal/commitlint@v1

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Changelog
1+
**This changelog has been split into a changelog per application found under
2+
`apps/*`. This file remains for changelogs before 2025-07-31.**
23

3-
All notable changes to this project will be documented in this file.
4+
# Changelog
45

56
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
67
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

apps/opentelemetry/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Changed
11+
- Use cliff for per-application changelogs
12+
13+
[unreleased]: https://github.com///compare/v1.4.1..HEAD
14+
15+
<!-- generated by git-cliff -->

apps/opentelemetry/cliff.toml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
# A Tera template to be rendered as the changelog's header.
6+
# See https://keats.github.io/tera/docs/#introduction
7+
header = """
8+
# Changelog\n
9+
All notable changes to this project will be documented in this file.
10+
11+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
12+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n
13+
"""
14+
# A Tera template to be rendered for each release in the changelog.
15+
# See https://keats.github.io/tera/docs/#introduction
16+
body = """
17+
{%- macro remote_url() -%}
18+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
19+
{%- endmacro -%}
20+
21+
{% if version -%}
22+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
23+
{% else -%}
24+
## [Unreleased]
25+
{% endif -%}
26+
27+
{% for group, commits in commits | group_by(attribute="group") %}
28+
### {{ group | upper_first }}
29+
{%- for commit in commits %}
30+
- {{ commit.message | split(pat="\n") | first | upper_first | trim }}\
31+
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
32+
{% if commit.remote.pr_number %} in \
33+
[#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \
34+
{%- endif -%}
35+
{% endfor %}
36+
{% endfor %}
37+
38+
{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
39+
## New Contributors
40+
{%- endif -%}
41+
42+
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
43+
* @{{ contributor.username }} made their first contribution
44+
{%- if contributor.pr_number %} in \
45+
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
46+
{%- endif %}
47+
{%- endfor %}\n
48+
"""
49+
# A Tera template to be rendered as the changelog's footer.
50+
# See https://keats.github.io/tera/docs/#introduction
51+
footer = """
52+
{%- macro remote_url() -%}
53+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
54+
{%- endmacro -%}
55+
56+
{% for release in releases -%}
57+
{% if release.version -%}
58+
{% if release.previous.version -%}
59+
[{{ release.version | trim_start_matches(pat="v") }}]: \
60+
{{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }}
61+
{% endif -%}
62+
{% else -%}
63+
{% if release.previous.version -%}
64+
[unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD
65+
{% endif -%}
66+
{% endif -%}
67+
{% endfor %}
68+
<!-- generated by git-cliff -->
69+
"""
70+
# Remove leading and trailing whitespaces from the changelog's body.
71+
trim = true
72+
73+
[git]
74+
# regex for matching git tags
75+
tag_pattern = "v[0-9].*"
76+
# Parse commits according to the conventional commits specification.
77+
# See https://www.conventionalcommits.org
78+
conventional_commits = true
79+
# Exclude commits that do not match the conventional commits specification.
80+
filter_unconventional = false
81+
# An array of regex based parsers to modify commit messages prior to further processing.
82+
commit_preprocessors = [
83+
# Remove issue numbers.
84+
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
85+
]
86+
# An array of regex based parsers for extracting data from the commit message.
87+
# Assigns commits to groups.
88+
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
89+
commit_parsers = [
90+
{ message = "^[a|A]dd", group = "Added" },
91+
{ message = "^[s|S]upport", group = "Added" },
92+
{ message = "^[r|R]emove", group = "Removed" },
93+
{ message = "^.*: add", group = "Added" },
94+
{ message = "^.*: support", group = "Added" },
95+
{ message = "^.*: remove", group = "Removed" },
96+
{ message = "^.*: delete", group = "Removed" },
97+
{ message = "^test", group = "Fixed" },
98+
{ message = "^fix", group = "Fixed" },
99+
{ message = "^.*: fix", group = "Fixed" },
100+
{ message = "^.*", group = "Changed" },
101+
]
102+
# Exclude commits that are not matched by any commit parser.
103+
filter_commits = false
104+
# Order releases topologically instead of chronologically.
105+
topo_order = false
106+
# Order of commits in each group/release within the changelog.
107+
# Allowed values: newest, oldest
108+
sort_commits = "newest"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Changed
11+
- Use cliff for per-application changelogs
12+
13+
14+
<!-- generated by git-cliff -->

apps/opentelemetry_api/cliff.toml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
# A Tera template to be rendered as the changelog's header.
6+
# See https://keats.github.io/tera/docs/#introduction
7+
header = """
8+
# Changelog\n
9+
All notable changes to this project will be documented in this file.
10+
11+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
12+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n
13+
"""
14+
# A Tera template to be rendered for each release in the changelog.
15+
# See https://keats.github.io/tera/docs/#introduction
16+
body = """
17+
{%- macro remote_url() -%}
18+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
19+
{%- endmacro -%}
20+
21+
{% if version -%}
22+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
23+
{% else -%}
24+
## [Unreleased]
25+
{% endif -%}
26+
27+
{% for group, commits in commits | group_by(attribute="group") %}
28+
### {{ group | upper_first }}
29+
{%- for commit in commits %}
30+
- {{ commit.message | split(pat="\n") | first | upper_first | trim }}\
31+
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
32+
{% if commit.remote.pr_number %} in \
33+
[#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \
34+
{%- endif -%}
35+
{% endfor %}
36+
{% endfor %}
37+
38+
{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
39+
## New Contributors
40+
{%- endif -%}
41+
42+
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
43+
* @{{ contributor.username }} made their first contribution
44+
{%- if contributor.pr_number %} in \
45+
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
46+
{%- endif %}
47+
{%- endfor %}\n
48+
"""
49+
# A Tera template to be rendered as the changelog's footer.
50+
# See https://keats.github.io/tera/docs/#introduction
51+
footer = """
52+
{%- macro remote_url() -%}
53+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
54+
{%- endmacro -%}
55+
56+
{% for release in releases -%}
57+
{% if release.version -%}
58+
{% if release.previous.version -%}
59+
[{{ release.version | trim_start_matches(pat="v") }}]: \
60+
{{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }}
61+
{% endif -%}
62+
{% else -%}
63+
{% if release.previous.version -%}
64+
[unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD
65+
{% endif -%}
66+
{% endif -%}
67+
{% endfor %}
68+
<!-- generated by git-cliff -->
69+
"""
70+
# Remove leading and trailing whitespaces from the changelog's body.
71+
trim = true
72+
73+
[git]
74+
# regex for matching git tags
75+
tag_pattern = "api-v[0-9].*"
76+
# Parse commits according to the conventional commits specification.
77+
# See https://www.conventionalcommits.org
78+
conventional_commits = true
79+
# Exclude commits that do not match the conventional commits specification.
80+
filter_unconventional = false
81+
# An array of regex based parsers to modify commit messages prior to further processing.
82+
commit_preprocessors = [
83+
# Remove issue numbers.
84+
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
85+
]
86+
# An array of regex based parsers for extracting data from the commit message.
87+
# Assigns commits to groups.
88+
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
89+
commit_parsers = [
90+
{ message = "^[a|A]dd", group = "Added" },
91+
{ message = "^[s|S]upport", group = "Added" },
92+
{ message = "^[r|R]emove", group = "Removed" },
93+
{ message = "^.*: add", group = "Added" },
94+
{ message = "^.*: support", group = "Added" },
95+
{ message = "^.*: remove", group = "Removed" },
96+
{ message = "^.*: delete", group = "Removed" },
97+
{ message = "^test", group = "Fixed" },
98+
{ message = "^fix", group = "Fixed" },
99+
{ message = "^.*: fix", group = "Fixed" },
100+
{ message = "^.*", group = "Changed" },
101+
]
102+
# Exclude commits that are not matched by any commit parser.
103+
filter_commits = false
104+
# Order releases topologically instead of chronologically.
105+
topo_order = false
106+
# Order of commits in each group/release within the changelog.
107+
# Allowed values: newest, oldest
108+
sort_commits = "newest"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Changed
11+
- Use cliff for per-application changelogs
12+
13+
14+
<!-- generated by git-cliff -->

0 commit comments

Comments
 (0)