Skip to content

Commit 7988825

Browse files
authored
Merge pull request #4721 from ClickHouse/cloud-rss-chagelog
adding rss feed for clickhouse cloud changelog
2 parents e6c9340 + db4b324 commit 7988825

File tree

4 files changed

+1419
-2
lines changed

4 files changed

+1419
-2
lines changed

docs/cloud/reference/01_changelog/01_changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ import dashboards from '@site/static/images/cloud/reference/may-30-dashboards.pn
3333

3434
In addition to this ClickHouse Cloud changelog, please see the [Cloud Compatibility](/whats-new/cloud-compatibility) page.
3535

36+
:::tip[Automatically keep up to date!]
37+
<a href="/docs/cloud/changelog-rss.xml">
38+
Subscribe to Cloud Changelog via RSS
39+
</a>
40+
:::
41+
3642
## November 7, 2025 {#november-7-2025}
3743

3844
- ClickHouse Cloud console now supports configuring replica sizes in increments of 1 vCPU, 4 GiB from the cloud console.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"autogen_needed_files": "src/Core/FormatFactorySettings.h src/Core/Settings.cpp CHANGELOG.md docs/en/operations/server-configuration-parameters/_server_settings_outside_source.md"
88
},
99
"scripts": {
10-
"build": "yarn copy-clickhouse-repo-docs && yarn check-markdown && yarn generate-changelog && yarn autogenerate-settings && yarn autogenerate-table-of-contents && yarn build-swagger && scripts/sed_links.sh && yarn build-docs",
10+
"build": "yarn copy-clickhouse-repo-docs && yarn check-markdown && yarn generate-changelog && yarn autogenerate-settings && yarn autogenerate-table-of-contents && yarn build-swagger && yarn generate:rss && scripts/sed_links.sh && yarn build-docs",
1111
"clear": "docusaurus clear && bash ./placeholderReset.sh",
1212
"deploy": "docusaurus deploy",
1313
"docusaurus": "docusaurus",
@@ -28,7 +28,8 @@
2828
"check-spelling": "./scripts/check-doc-aspell",
2929
"check-kb": "./scripts/check-kb.sh",
3030
"check-markdown": "./scripts/check-markdown.sh",
31-
"check-prose": "./scripts/vale/check-prose.sh"
31+
"check-prose": "./scripts/vale/check-prose.sh",
32+
"generate:rss": "./scripts/changelog/cloud-changelog-rss.sh"
3233
},
3334
"dependencies": {
3435
"@algolia/client-search": "^5.35.0",
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
#!/bin/bash
2+
3+
# Configuration
4+
CHANGELOG_FILE="docs/cloud/reference/01_changelog/01_changelog.md"
5+
OUTPUT_FILE="static/cloud/changelog-rss.xml"
6+
FEED_URL="https://clickhouse.com/docs/cloud/changelog-rss.xml"
7+
SITE_URL="https://clickhouse.com/docs/cloud/whats-new/cloud"
8+
9+
# XML escape function
10+
escape_xml() {
11+
echo "$1" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'\''/\&apos;/g'
12+
}
13+
14+
# Convert date to RFC822 format
15+
date_to_rfc822() {
16+
local date_str="$1"
17+
date -d "$date_str" -R 2>/dev/null || date -j -f "%B %d, %Y" "$date_str" "+%a, %d %b %Y 00:00:00 %z" 2>/dev/null
18+
}
19+
20+
# Remove markdown formatting
21+
clean_markdown() {
22+
local text="$1"
23+
echo "$text" | perl -pe '
24+
s/\[([^\]]+)\]\([^\)]+\)/$1/g;
25+
s/`([^`]+)`/$1/g;
26+
s/\*\*([^\*]+)\*\*/$1/g;
27+
s/\*([^\*]+)\*/$1/g;
28+
s/_{2}([^_]+)_{2}/$1/g;
29+
s/_([^_]+)_/$1/g;
30+
'
31+
}
32+
33+
# Extract features from content as plain text
34+
extract_features() {
35+
local content="$1"
36+
local output=""
37+
local current_section=""
38+
39+
while IFS= read -r line; do
40+
# Match section headers: ### Section Name
41+
if [[ "$line" =~ ^###[[:space:]]+(.+) ]]; then
42+
section="${BASH_REMATCH[1]}"
43+
section=$(echo "$section" | sed 's/ {#[^}]*}$//')
44+
section=$(clean_markdown "$section")
45+
46+
if [ -n "$current_section" ]; then
47+
output="${output}\n"
48+
fi
49+
current_section="$section"
50+
output="${output}${section}:\n"
51+
52+
# Match bold bullet points: - **Title** description
53+
elif [[ "$line" =~ ^[[:space:]]*[-*][[:space:]]+\*\*([^*]+)\*\*[[:space:]]*(.*) ]]; then
54+
title="${BASH_REMATCH[1]}"
55+
desc="${BASH_REMATCH[2]}"
56+
57+
desc=$(clean_markdown "$desc" | tr '\n' ' ' | sed 's/ */ /g' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
58+
59+
if [ -n "$title" ]; then
60+
if [ -n "$desc" ]; then
61+
output="${output}- ${title}: ${desc}\n"
62+
else
63+
output="${output}- ${title}\n"
64+
fi
65+
fi
66+
67+
# Match simple bullets
68+
elif [[ "$line" =~ ^[[:space:]]*[-*][[:space:]]+([^*].+) ]]; then
69+
bullet="${BASH_REMATCH[1]}"
70+
bullet=$(clean_markdown "$bullet" | tr '\n' ' ' | sed 's/ */ /g' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
71+
72+
if [ ${#bullet} -gt 3 ]; then
73+
output="${output}- ${bullet}\n"
74+
fi
75+
fi
76+
done <<< "$content"
77+
78+
if [ -n "$output" ]; then
79+
echo -e "$output"
80+
else
81+
echo "See full changelog for details."
82+
fi
83+
}
84+
85+
# Generate RSS feed
86+
generate_rss() {
87+
local entries="$1"
88+
89+
cat > "$OUTPUT_FILE" << EOF
90+
<?xml version="1.0" encoding="UTF-8" ?>
91+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
92+
<channel>
93+
<title>ClickHouse Cloud Changelog</title>
94+
<link>${SITE_URL}</link>
95+
<description>Latest updates and features in ClickHouse Cloud</description>
96+
<language>en-us</language>
97+
<lastBuildDate>$(date -R 2>/dev/null || date "+%a, %d %b %Y %H:%M:%S %z")</lastBuildDate>
98+
<atom:link href="${FEED_URL}" rel="self" type="application/rss+xml" />
99+
${entries}
100+
</channel>
101+
</rss>
102+
EOF
103+
}
104+
105+
# Main processing
106+
main() {
107+
if ! command -v perl &> /dev/null; then
108+
echo "Error: perl is required but not installed."
109+
exit 1
110+
fi
111+
112+
if [ ! -f "$CHANGELOG_FILE" ]; then
113+
echo "Error: Changelog file not found: $CHANGELOG_FILE"
114+
exit 1
115+
fi
116+
117+
echo "Parsing changelog: $CHANGELOG_FILE"
118+
119+
local items=""
120+
local count=0
121+
local in_release=0
122+
local current_title=""
123+
local current_slug=""
124+
local current_date=""
125+
local current_content=""
126+
127+
while IFS= read -r line; do
128+
if [[ "$line" =~ ^##[[:space:]]+(.+)[[:space:]]+\{#([^}]+)\} ]]; then
129+
if [ $in_release -eq 1 ]; then
130+
description=$(extract_features "$current_content")
131+
description=$(escape_xml "$description")
132+
rfc_date=$(date_to_rfc822 "$current_date")
133+
134+
items="${items} <item>
135+
<title>$(escape_xml "ClickHouse Cloud - $current_title")</title>
136+
<link>${SITE_URL}#${current_slug}</link>
137+
<description>${description}</description>
138+
<pubDate>${rfc_date}</pubDate>
139+
<guid isPermaLink=\"true\">${SITE_URL}#${current_slug}</guid>
140+
</item>
141+
"
142+
((count++))
143+
fi
144+
145+
current_title="${BASH_REMATCH[1]}"
146+
current_slug="${BASH_REMATCH[2]}"
147+
current_date="$current_title"
148+
current_content=""
149+
in_release=1
150+
151+
elif [ $in_release -eq 1 ]; then
152+
current_content="${current_content}${line}"$'\n'
153+
fi
154+
155+
done < "$CHANGELOG_FILE"
156+
157+
if [ $in_release -eq 1 ]; then
158+
description=$(extract_features "$current_content")
159+
description=$(escape_xml "$description")
160+
rfc_date=$(date_to_rfc822 "$current_date")
161+
162+
items="${items} <item>
163+
<title>$(escape_xml "ClickHouse Cloud - $current_title")</title>
164+
<link>${SITE_URL}#${current_slug}</link>
165+
<description>${description}</description>
166+
<pubDate>${rfc_date}</pubDate>
167+
<guid isPermaLink=\"true\">${SITE_URL}#${current_slug}</guid>
168+
</item>
169+
"
170+
fi
171+
172+
echo "Generated $count entries"
173+
174+
mkdir -p "$(dirname "$OUTPUT_FILE")"
175+
176+
generate_rss "$items"
177+
178+
echo "RSS feed written to $OUTPUT_FILE"
179+
echo "Feed will be available at: ${FEED_URL}"
180+
}
181+
182+
main

0 commit comments

Comments
 (0)