Skip to content

Commit 762de7d

Browse files
felipegonzalezmvclaudeyenienserrano
authored
Change the changelog format to use a table per block (#1482)
* Change the changelog format to use a table per block Render every Added/Changed/Fixed/Removed block as an Issue/Comment table, moving the existing references into the Issue column and keeping the descriptions unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Juan Felipe Gonzalez <felipegonzalezmv@hotmail.com> * Generate changelog tables in the changelog bumper The bumper reset CHANGELOG.md to bullet-list sections seeded with a "- Support for Wazuh X.Y.Z" entry. Emit an empty "| Issue | Comment |" table per section instead, so a bumped changelog starts in the table format, and drop the seeded entry, which had no reference to put in the Issue column. Update the tests, their fixtures and the tools/tests README accordingly. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Juan Felipe Gonzalez <felipegonzalezmv@hotmail.com> * Remove the Support for Wazuh changelog entry The entry had no issue or pull request reference, so in the new table format it rendered as a row with an empty Issue column. The changelog bumper no longer seeds it either. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Juan Felipe Gonzalez <felipegonzalezmv@hotmail.com> * Add missing issue to the changelog entry --------- Signed-off-by: Juan Felipe Gonzalez <felipegonzalezmv@hotmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com>
1 parent dcc6132 commit 762de7d

5 files changed

Lines changed: 64 additions & 34 deletions

File tree

CHANGELOG.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,40 @@
22

33
### Added
44

5-
- Support for Wazuh 5.0.0
6-
- Health check service [#811](https://github.com/wazuh/wazuh-dashboard/pull/811) [#866](https://github.com/wazuh/wazuh-dashboard/pull/866) [#961](https://github.com/wazuh/wazuh-dashboard/pull/961) [#1031](https://github.com/wazuh/wazuh-dashboard/pull/1031) [#1179](https://github.com/wazuh/wazuh-dashboard/pull/1179) [#1366](https://github.com/wazuh/wazuh-dashboard/pull/1366)
7-
- Added Health Check app [#870](https://github.com/wazuh/wazuh-dashboard/pull/870) [#946](https://github.com/wazuh/wazuh-dashboard/pull/946) [#1366](https://github.com/wazuh/wazuh-dashboard/pull/1366) [#1379](https://github.com/wazuh/wazuh-dashboard/pull/1379)
8-
- Added manager host configuration for the default configuration file [#998](https://github.com/wazuh/wazuh-dashboard/pull/998)
9-
- Set v9 theme as default [#1092](https://github.com/wazuh/wazuh-dashboard/pull/1092)
10-
- Added version, revision, and stage to the Wazuh build metadata [#1327](https://github.com/wazuh/wazuh-dashboard/pull/1327) [#1421](https://github.com/wazuh/wazuh-dashboard/pull/1421)
11-
- Made the Discover CSV download row limit configurable via the `reports.csv.maxRows` setting [#1434](https://github.com/wazuh/wazuh-dashboard/issues/1434)
12-
- Added automatic generation and storage of the AI assistant encryption key on first install [#1480](https://github.com/wazuh/wazuh-dashboard/issues/1480)
5+
| Issue | Comment |
6+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
7+
| [#811](https://github.com/wazuh/wazuh-dashboard/pull/811) [#866](https://github.com/wazuh/wazuh-dashboard/pull/866) [#961](https://github.com/wazuh/wazuh-dashboard/pull/961) [#1031](https://github.com/wazuh/wazuh-dashboard/pull/1031) [#1179](https://github.com/wazuh/wazuh-dashboard/pull/1179) [#1366](https://github.com/wazuh/wazuh-dashboard/pull/1366) | Health check service |
8+
| [#870](https://github.com/wazuh/wazuh-dashboard/pull/870) [#946](https://github.com/wazuh/wazuh-dashboard/pull/946) [#1366](https://github.com/wazuh/wazuh-dashboard/pull/1366) [#1379](https://github.com/wazuh/wazuh-dashboard/pull/1379) | Added Health Check app |
9+
| [#998](https://github.com/wazuh/wazuh-dashboard/pull/998) | Added manager host configuration for the default configuration file |
10+
| [#1092](https://github.com/wazuh/wazuh-dashboard/pull/1092) | Set v9 theme as default |
11+
| [#1327](https://github.com/wazuh/wazuh-dashboard/pull/1327) [#1421](https://github.com/wazuh/wazuh-dashboard/pull/1421) | Added version, revision, and stage to the Wazuh build metadata |
12+
| [#1434](https://github.com/wazuh/wazuh-dashboard/issues/1434) | Made the Discover CSV download row limit configurable via the `reports.csv.maxRows` setting |
13+
| [#1480](https://github.com/wazuh/wazuh-dashboard/issues/1480) | Added automatic generation and storage of the AI assistant encryption key on first install |
1314

1415
### Fixed
1516

16-
- Fixed health check padding styles [#1276](https://github.com/wazuh/wazuh-dashboard/pull/1276)
17-
- Sanitized redirect path to prevent open redirect [#1285](https://github.com/wazuh/wazuh-dashboard/pull/1285)
18-
- Prevent infinite remount loop when navigating from an app before its bundle finishes loading [#1400](https://github.com/wazuh/wazuh-dashboard/pull/1400)
17+
| Issue | Comment |
18+
| ----------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
19+
| [#1276](https://github.com/wazuh/wazuh-dashboard/pull/1276) | Fixed health check padding styles |
20+
| [#1285](https://github.com/wazuh/wazuh-dashboard/pull/1285) | Sanitized redirect path to prevent open redirect |
21+
| [#1400](https://github.com/wazuh/wazuh-dashboard/pull/1400) | Prevent infinite remount loop when navigating from an app before its bundle finishes loading |
1922

2023
### Removed
2124

22-
- Removed creation of /usr/lib/.build-id/\* links to prevent conflicts when installing Wazuh Dashboard alongside OpenSearch Dashboards on the same system
23-
- Removed the Anomaly Detection plugin from the default Wazuh dashboard package [#1382](https://github.com/wazuh/wazuh-dashboard/pull/1382)
25+
| Issue | Comment |
26+
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
27+
| [#699](https://github.com/wazuh/wazuh-dashboard/issues/699) | Removed creation of /usr/lib/.build-id/\* links to prevent conflicts when installing Wazuh Dashboard alongside OpenSearch Dashboards on the same system |
28+
| [#1382](https://github.com/wazuh/wazuh-dashboard/pull/1382) | Removed the Anomaly Detection plugin from the default Wazuh dashboard package |
2429

2530
### Changed
2631

27-
- Changed the location of the wazuh-dashboard service to match with the other Wazuh components [#805](https://github.com/wazuh/wazuh-dashboard/issues/805)
28-
- Changed the default value of `metaFields` and `timepicker:timeDefaults` settings [#998](https://github.com/wazuh/wazuh-dashboard/pull/998)
29-
- Excluded Wazuh dashboards and visualizations listing [#1278](https://github.com/wazuh/wazuh-dashboard/pull/1278) [#1279](https://github.com/wazuh/wazuh-dashboard/pull/1279)
30-
- Changed log level of the cross compatibility service on start [#1330](https://github.com/wazuh/wazuh-dashboard/pull/1330)
31-
- Changed pre install scripts to block Wazuh dashboard installation if there's an existing installation prior to 5.x [#1328](https://github.com/wazuh/wazuh-dashboard/pull/1328) [#1365](https://github.com/wazuh/wazuh-dashboard/pull/1365)
32+
| Issue | Comment |
33+
| ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
34+
| [#805](https://github.com/wazuh/wazuh-dashboard/issues/805) | Changed the location of the wazuh-dashboard service to match with the other Wazuh components |
35+
| [#998](https://github.com/wazuh/wazuh-dashboard/pull/998) | Changed the default value of `metaFields` and `timepicker:timeDefaults` settings |
36+
| [#1278](https://github.com/wazuh/wazuh-dashboard/pull/1278) [#1279](https://github.com/wazuh/wazuh-dashboard/pull/1279) | Excluded Wazuh dashboards and visualizations listing |
37+
| [#1330](https://github.com/wazuh/wazuh-dashboard/pull/1330) | Changed log level of the cross compatibility service on start |
38+
| [#1328](https://github.com/wazuh/wazuh-dashboard/pull/1328) [#1365](https://github.com/wazuh/wazuh-dashboard/pull/1365) | Changed pre install scripts to block Wazuh dashboard installation if there's an existing installation prior to 5.x |
3239

3340
## Prior versions
3441

tools/changelog_bump.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
# From 5.x, each changelog only contains its own version changes and
99
# references the prior changelogs with links, so on a version bump this
1010
# script:
11-
# - Resets the changelog to a single "## [vX.Y.Z]" entry with empty
12-
# Added/Changed/Removed/Fixed sections, where Added starts with the
13-
# "- Support for Wazuh X.Y.Z" entry.
11+
# - Resets the changelog to a single "## [vX.Y.Z]" entry with an empty
12+
# "| Issue | Comment |" table under each of the Added/Changed/
13+
# Removed/Fixed sections.
1414
# - Rebuilds the "## Prior versions" section with the two most recent
1515
# minors below the new version, including every patch of each,
1616
# newest first.
@@ -112,7 +112,18 @@ function print_prior_versions_section() {
112112
}
113113

114114
# ====
115-
# Rewrite CHANGELOG.md with the new version entry (empty sections) and the
115+
# Print a changelog section heading followed by an empty entries table.
116+
# Arguments:
117+
# $1 - section name (Added, Changed, Removed, Fixed)
118+
# ====
119+
function print_section() {
120+
printf '### %s\n\n' "$1"
121+
printf '| Issue | Comment |\n'
122+
printf '| ----- | ------- |\n\n'
123+
}
124+
125+
# ====
126+
# Rewrite CHANGELOG.md with the new version entry (empty tables) and the
116127
# rebuilt "## Prior versions" section.
117128
# Arguments:
118129
# $1 - new version
@@ -124,11 +135,10 @@ function write_changelog() {
124135

125136
{
126137
printf '## [v%s]\n\n' "$new_version"
127-
printf '### Added\n\n'
128-
printf -- '- Support for Wazuh %s\n\n' "$new_version"
129-
printf '### Changed\n\n'
130-
printf '### Removed\n\n'
131-
printf '### Fixed\n\n'
138+
print_section 'Added'
139+
print_section 'Changed'
140+
print_section 'Removed'
141+
print_section 'Fixed'
132142
print_prior_versions_section "$new_version"
133143
} > "$temp_file"
134144

tools/tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ there for debugging (the directory is git-ignored).
5555

5656
- Argument validation (`--help`, missing/extra args, malformed `x.y.z`
5757
versions) and that failures leave `CHANGELOG.md` untouched.
58-
- Version bump: changelog reset to the new `## [vX.Y.Z]` entry with empty
59-
sections and the `- Support for Wazuh X.Y.Z` line; "Prior versions" rebuilt
58+
- Version bump: changelog reset to the new `## [vX.Y.Z]` entry with an empty
59+
`| Issue | Comment |` table per section; "Prior versions" rebuilt
6060
with the two most recent minors below the new version, every patch of each,
6161
newest first; non-version tags filtered out; `v`-prefixed tags normalized.
6262
- Stage-only bump (same version) and `--tag`: entries preserved, only the

tools/tests/test_changelog_bump.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ run_tool changelog_bump.sh 5.1.0 5.0.0
3737
assert_eq 0 "$STATUS" "exits 0"
3838
CONTENT=$(cat "$WORK/CHANGELOG.md")
3939
assert_contains "$CONTENT" "## [v5.1.0]" "new version heading"
40-
assert_contains "$CONTENT" "- Support for Wazuh 5.1.0" "Support for Wazuh entry"
4140
assert_contains "$CONTENT" "### Added" "Added section"
4241
assert_contains "$CONTENT" "### Changed" "Changed section"
4342
assert_contains "$CONTENT" "### Removed" "Removed section"
4443
assert_contains "$CONTENT" "### Fixed" "Fixed section"
44+
assert_eq 4 "$(grep -c '^| Issue | Comment |$' "$WORK/CHANGELOG.md")" \
45+
"one empty entries table per section"
4546
assert_not_contains "$CONTENT" "Some existing feature entry" "old entries removed"
4647
assert_eq "$(expected_priors 5.0.0 4.10.2 4.10.1 4.10.0)" "$(prior_versions_block)" \
4748
"Prior versions = last 2 minors (every patch, newest first)"
@@ -78,12 +79,14 @@ cat >"$WORK/CHANGELOG.md" <<'EOF'
7879
7980
### Added
8081
81-
- Support for Wazuh 5.0.0
82+
| Issue | Comment |
83+
| ----- | ------- |
84+
| [#1](https://github.com/wazuh/test-repo/issues/1) | Some existing feature entry |
8285
EOF
8386
run_tool changelog_bump.sh 5.0.0 5.0.0
8487
assert_eq 0 "$STATUS" "exits 0"
8588
CONTENT=$(cat "$WORK/CHANGELOG.md")
86-
assert_contains "$CONTENT" "- Support for Wazuh 5.0.0" "entries preserved"
89+
assert_contains "$CONTENT" "| Some existing feature entry |" "entries preserved"
8790
assert_contains "$CONTENT" "## Prior versions" "section appended"
8891
assert_eq "$(expected_priors 4.10.2 4.10.1 4.10.0 4.9.1 4.9.0)" "$(prior_versions_block)" \
8992
"list built correctly"

tools/tests/test_helpers.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,25 @@ EOF
214214
215215
### Added
216216
217-
- Support for Wazuh 5.0.0
218-
- Some existing feature entry
217+
| Issue | Comment |
218+
| ----- | ------- |
219+
| [#1](https://github.com/wazuh/test-repo/issues/1) | Some existing feature entry |
219220
220221
### Changed
221222
223+
| Issue | Comment |
224+
| ----- | ------- |
225+
222226
### Removed
223227
228+
| Issue | Comment |
229+
| ----- | ------- |
230+
224231
### Fixed
225232
233+
| Issue | Comment |
234+
| ----- | ------- |
235+
226236
## Prior versions
227237
228238
- [v4.10.0](https://github.com/wazuh/test-repo/blob/v4.10.0/CHANGELOG.md)

0 commit comments

Comments
 (0)