Skip to content

Commit ff106d4

Browse files
authored
NO-JIRA: introduce changelog summary by release (#176)
**What this PR does / why we need it**: Update the changelog builder with release summarization. **Which issue(s) this PR fixes** *(optional, use `fixes #<issue_number>(, fixes #<issue_number>, ...)` format, where issue_number might be a GitHub issue, or a Jira story*: Fixes # **Checklist** - [ ] Subject and description added to both, commit and PR. - [x] Relevant issues have been referenced. - [x] This change includes docs. - [ ] This change includes unit tests. ## Tests ![Screenshot From 2025-04-28 13-45-11](https://github.com/user-attachments/assets/462730fe-88d4-4973-959f-a72d38c032f4)
1 parent ca3b112 commit ff106d4

File tree

4 files changed

+247
-8
lines changed

4 files changed

+247
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ build/
88

99
# changelog is generated automaticaly by hack/generate-changelog.sh
1010
# available only in the rendered webpage (built by mkdocs).
11+
# See the make commands: 'build-changelog' and 'build-changelog-commmits'
1112
docs/CHANGELOG.md
13+
docs/CHANGELOG_commits.md

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ clean:
102102
# .github/workflows/static-website.yml
103103
# docs/requirements.txt
104104

105+
.PHONY: build-changelog-commits
106+
build-changelog-commits:
107+
./hack/generate-changelog.sh "commits-only"
108+
105109
.PHONY: build-changelog
106110
build-changelog:
107111
./hack/generate-changelog.sh

docs/CHANGELOG_summary.md

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
<!--
2+
3+
File: CHANGELOG_summary.md
4+
Summary section generated manually by AI text summarization from a file CHANGELOG_commits.md.
5+
6+
Steps to update the summary:
7+
- Generate the CHANGELOG_commits.md: make build-changelog-commits
8+
- Query the inference API by attaching the CHANGELOG_commits.md and instructions (below)
9+
- Update (manually) the file docs/CHANGELOG_summary.md (this file) in the section you want to summarize (last release, maybe?).
10+
- Generate the CHANGELOG.md: make build-changelog
11+
- Run the mkdocs locally: mkdocs serve
12+
- Check the reults on page: 127.0.0.1:8000/opct/CHANGELOG
13+
- Commit the changes (CHANGELOG_summary.md)
14+
15+
Below are prompt details (copy/paste the following lines):
16+
---
17+
Instructions:
18+
You are a tech writer review expert and need to extract information from a changelog file (CHANGELOG_commits.md) of an open-source project.
19+
20+
Extraction instruction:
21+
- Write a consolidated changelog summary from a markdown file containing commits by release.
22+
The summary must group the features by release, such as: enhancements, result review improvements, bug fixes, clean-up, others.
23+
- The result summary must aggregate releases by Y-stream, examples: v0.5.x, v0.6.x...
24+
- The result summary file must be a raw markdown file in a code block, without any additional context. A section in second-level ('##') with the name 'Release Summary', and each child section by release ('###').
25+
- The groups must be in bold name, example '**Enhancements**:', and each item must be in a bullet list. The first line must be blank to prevent markdown-to-HTML rendering issues.
26+
- Do not search for external content, only run a text summarization with files provided.
27+
- Do not add commit, PR, or task numbers.
28+
29+
Example of the first lines of the result file (inside the code block):
30+
~~~
31+
## Release Summary
32+
33+
### v0.6.x
34+
35+
**Enhancements**:
36+
37+
- Added checks for validating cluster install time and SLOs for valid install/platform (VCSP)
38+
- Introduced a controller to mutate unschedulable e2e pods
39+
40+
**Bug Fixes**:
41+
42+
- Disabled kube-burner to address long-running issues
43+
- Fixed matchExpressions to remove trailing commas
44+
45+
**Clean Up**:
46+
47+
- Renamed and improved commands and documentation for node setup and tainting
48+
- Improved documentation structure and changelog CD pipeline
49+
50+
**Review Improvements**:
51+
52+
- Reviewed and updated report, installation, and CLI documentation
53+
- Updated project owners and CI steps
54+
55+
### v0.5.x
56+
57+
**Enhancements**:
58+
59+
- Added multi-arch build instructions and ARM64 support
60+
- Improved status command and increased verbosity for failure detection
61+
62+
**Bug Fixes**:
63+
64+
- Fixed Kubernetes service URL, conformance checks, and node/MCP checks
65+
- Fixed typos, cache expiration, and data handling in result archives
66+
67+
...
68+
~~~
69+
70+
Goal:
71+
Read the CHANGELOG_commits.md and generate the summary file CHANGELOG_summary.md as a result, following the instructions provided.
72+
-->
73+
74+
<!-- Final Tips:
75+
- To prevent changing past releases, update only the release you are summarizing.
76+
- If you are improving the summarization, feel free to update the other sections. ;)
77+
-->
78+
79+
80+
## Release Summary
81+
82+
### v0.6.x
83+
84+
*Enhancements*:
85+
86+
- Introduced checks to validate cluster install time and VCSP platform compatibility
87+
- Added controller to handle unschedulable e2e pods
88+
- Implemented automated check rule documentation generation
89+
- Enhanced archive cleanup processes for unused objects
90+
91+
*Bug Fixes*:
92+
93+
- Disabled kube-burner to resolve long-running test issues
94+
- Fixed matchExpressions syntax by removing trailing commas
95+
- Addressed security alerts through dependency updates
96+
97+
*Clean Up*:
98+
99+
- Renamed CLI commands for node tainting and dedicated node setup
100+
- Updated documentation structure and changelog pipeline
101+
- Streamlined CI workflows and label enforcement
102+
103+
*Review Improvements*:
104+
105+
- Created visual process diagrams for user guides
106+
- Updated SLO/rules documentation with automatic validation
107+
- Improved CLI reference and installation review guides
108+
109+
### v0.5.x
110+
111+
*Enhancements*:
112+
113+
- Added ARM64 support and multi-arch build capabilities
114+
- Introduced batch report generation and manual e2e execution guides
115+
- Implemented disconnected registry mirror support
116+
- Enhanced status monitoring with configurable intervals
117+
118+
*Bug Fixes*:
119+
120+
- Fixed Kubernetes service URL and conformance check logic
121+
- Resolved node label/MCP upgrade validation issues
122+
- Addressed security vulnerabilities in dependencies
123+
- Improved error handling for missing optional metrics
124+
125+
*Clean Up*:
126+
127+
- Renamed project binaries and documentation references
128+
- Migrated to embedded file systems (EFS) from bindata
129+
- Updated CI pipelines with static analysis and linter jobs
130+
131+
*Review Improvements*:
132+
133+
- Created community standards documentation
134+
- Automated check rule documentation generation
135+
- Added upgrade execution mode documentation
136+
137+
### v0.4.x
138+
139+
*Enhancements*:
140+
141+
- Added platformName field validation for external clusters
142+
- Introduced dedicated mode execution by default
143+
144+
*Bug Fixes*:
145+
146+
- Backported OCP 4.14 compatibility fixes
147+
- Addressed container security issues through UBI updates
148+
149+
*Clean Up*:
150+
151+
- Removed certification references from documentation
152+
- Improved RBAC configuration and namespace management
153+
154+
### v0.3.x
155+
156+
*Enhancements*:
157+
158+
- Implemented upgrade execution mode
159+
- Added dev environment test limitation flag
160+
- Introduced automated changelog generation
161+
162+
*Bug Fixes*:
163+
164+
- Fixed plugin status counters and PSA label application
165+
- Addressed SCC creation conflicts
166+
167+
*Review Improvements*:
168+
169+
- Created documentation website with GitHub Pages
170+
- Added support matrix for OCP versions
171+
172+
### v0.2.x
173+
174+
*Enhancements*:
175+
176+
- Implemented artifacts collector for test results
177+
- Added dedicated node execution mode
178+
179+
*Bug Fixes*:
180+
181+
- Fixed regression issues in plugin image
182+
- Addressed namespace conflicts in aggregator
183+
184+
*Clean Up*:
185+
186+
- Standardized plugin manifest naming conventions
187+
- Improved documentation structure and FAQ
188+
189+
### v0.1.x
190+
191+
*Enhancements*:
192+
193+
- Initial release with core certification workflow
194+
- Added pre-checks for cluster stability and registry management
195+
196+
*Bug Fixes*:
197+
198+
- Resolved namespace conflicts and RBAC issues
199+
- Fixed status monitoring retry logic
200+
201+
*Clean Up*:
202+
203+
- Established release process documentation
204+
- Implemented code formatting and linting standards

hack/generate-changelog.sh

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@ set -o errexit
1111
set -o nounset
1212
set -o pipefail
1313

14-
releases=("v0.1.0" "v0.2.0" "v0.3.0" "v0.4.0" "v0.5.0" "v0.5.1" "v0.5.2")
14+
arg_cmd=${1-}
15+
if [[ -n "$arg_cmd" && "$arg_cmd" != "commits-only" ]]; then
16+
echo "Error: Invalid argument '$arg_cmd'. Only 'commits-only' is allowed."
17+
exit 1
18+
fi
19+
20+
releases=($(git tag --list 'v*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V))
1521

1622
chagelog_file="$(dirname $0)"/../docs/CHANGELOG.md
17-
chagelog_dir="$(dirname $0)"/../docs/changelogs
23+
chagelog_commits_file="$(dirname $0)"/../docs/CHANGELOG_commits.md
24+
chagelog_sum_file="$(dirname $0)"/../docs/CHANGELOG_summary.md
25+
1826
chagelog_dir="/tmp/opct-changelogs"
1927
mkdir -p $chagelog_dir
2028

@@ -62,8 +70,14 @@ function extract_jira_id() {
6270
first_commit=$(git rev-list --max-parents=0 HEAD)
6371
init_release=$first_commit
6472
for rel in "${releases[@]}"; do
73+
echo "Processing release $rel"
74+
if [[ "$rel" == *","* ]]; then
75+
echo "Skipping release $rel due to invalid characters (commas)."
76+
continue
77+
fi
78+
6579
ch_file=$chagelog_dir/$rel.md
66-
echo -e "\n## OPCT [$rel](https://github.com/redhat-openshift-ecosystem/opct/releases/tag/$rel)\n" > "$ch_file"
80+
echo -e "\n### OPCT [$rel](https://github.com/redhat-openshift-ecosystem/opct/releases/tag/$rel)\n" > "$ch_file"
6781

6882
# read the git log with changes between releases (from/to)
6983
git log --pretty=oneline --abbrev-commit --no-decorate --no-color "$init_release"..tags/"$rel" | \
@@ -92,7 +106,7 @@ done
92106

93107
# devel (since last release - need to run from 'main' branch)
94108
ch_file=$chagelog_dir/devel.md
95-
echo -e "\n## OPCT Development\n" > "$ch_file"
109+
echo -e "\n### OPCT Development\n" > "$ch_file"
96110

97111
# Process OPCT repo
98112
git log --pretty=oneline --abbrev-commit --no-decorate --no-color "$init_release"..HEAD | \
@@ -125,17 +139,32 @@ Changelog by release for [CLI (OPCT)][project-cli] project.
125139
126140
EOF
127141

142+
# if summary file exists, insert it
143+
if [[ -f ${chagelog_sum_file} ]];
144+
then
145+
cat ${chagelog_sum_file} >> "$chagelog_file"
146+
fi
147+
148+
echo -e "\n## Releases Changes" > "$chagelog_commits_file"
149+
128150
# devel.md will be first
129-
cat $chagelog_dir/devel.md >> "$chagelog_file"
151+
cat $chagelog_dir/devel.md >> "$chagelog_commits_file"
130152

131153
# then append the releases by reverse order (newest version/file first)
132154
for rev_releases in $(ls -r $chagelog_dir --ignore=devel.md); do
133-
echo -e "\n" >> "$chagelog_file"
134-
cat $chagelog_dir/"$rev_releases" >> "$chagelog_file"
155+
echo -e "\n" >> "$chagelog_commits_file"
156+
cat $chagelog_dir/"$rev_releases" >> "$chagelog_commits_file"
135157
done
136158

137-
echo -e "\n\n > This page is generated automatically by CI/hack-generate-changelog.sh\n\n" >> "$chagelog_file"
159+
# Saving the commits file
160+
cat $chagelog_commits_file >> $chagelog_file
138161

162+
echo -e "\n\n > This page is generated automatically by CI/hack-generate-changelog.sh\n\n" >> "$chagelog_file"
139163

140164
# TODO: create plugin changelog
141165
#plugin_releases=("v0.1.1" "v0.2.2" "v0.3.0" "v0.4.0")
166+
167+
echo "Removing changelog dir ${chagelog_dir}..."
168+
if [[ -n "${chagelog_dir}" && -d "${chagelog_dir}" ]]; then
169+
rm -rvf "${chagelog_dir}"
170+
fi

0 commit comments

Comments
 (0)