Skip to content

Commit a1d7a63

Browse files
committed
chore(ci): Migrate generate-release-notes.sh to generate-release-notes.js. Update and cleanup workflows to use the new script and the Markdown-formatted output.
1 parent c60483a commit a1d7a63

File tree

6 files changed

+1236
-447
lines changed

6 files changed

+1236
-447
lines changed

.github/workflows/influxdb3-release.yml

Lines changed: 170 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ on:
2828
default: true
2929

3030
jobs:
31-
generate-release-notes:
32-
name: Generate Release Notes
31+
generate-release-notes-core-enterprise:
32+
name: Generate Release Notes (Core/Enterprise)
3333
runs-on: ubuntu-latest
34+
if: contains(fromJSON('["core", "enterprise"]'), github.event.inputs.product)
3435
outputs:
3536
generated: ${{ steps.generate.outputs.generated }}
3637

@@ -49,17 +50,117 @@ jobs:
4950
- name: Generate release notes
5051
id: generate
5152
run: |
52-
echo "Generating release notes for ${{ github.event.inputs.product }} v${{ github.event.inputs.version }}"
53+
echo "Generating Core/Enterprise release notes for ${{ github.event.inputs.product }} v${{ github.event.inputs.version }}"
5354
54-
# TODO: Call the actual generate-release-notes script when it exists
55-
# node ./helper-scripts/influxdb3-monolith/generate-release-notes.js \
56-
# --product ${{ github.event.inputs.product }} \
57-
# --version ${{ github.event.inputs.version }} \
58-
# --previous ${{ github.event.inputs.previous_version }}
55+
# Create output directory
56+
mkdir -p helper-scripts/output/release-notes
57+
58+
# Note: This generates placeholder release notes since the actual repositories
59+
# (influxdb and influxdb_pro) are not available in the GitHub Actions environment.
60+
# To generate actual release notes, the script would need to be run locally with:
61+
# node ./helper-scripts/common/generate-release-notes.js \
62+
# --format core-enterprise \
63+
# ${{ github.event.inputs.previous_version }} \
64+
# ${{ github.event.inputs.version }} \
65+
# /path/to/influxdb \
66+
# /path/to/influxdb_pro
67+
68+
# Create structured placeholder that matches the expected format
69+
cat > helper-scripts/output/release-notes/release-notes-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}.md << EOF
70+
> [!Note]
71+
> #### InfluxDB 3 Core and Enterprise relationship
72+
>
73+
> InfluxDB 3 Enterprise is a superset of InfluxDB 3 Core.
74+
> All updates to Core are automatically included in Enterprise.
75+
> The Enterprise sections below only list updates exclusive to Enterprise.
76+
77+
## ${{ github.event.inputs.version }} {date="$(date +'%Y-%m-%d')"}
78+
79+
### Core
80+
81+
#### Features
82+
83+
- TODO: Add Core features for ${{ github.event.inputs.product }} ${{ github.event.inputs.version }}
84+
85+
#### Bug Fixes
86+
87+
- TODO: Add Core bug fixes for ${{ github.event.inputs.product }} ${{ github.event.inputs.version }}
88+
89+
### Enterprise
90+
91+
All Core updates are included in Enterprise. Additional Enterprise-specific features and fixes:
92+
93+
#### Features
94+
95+
- TODO: Add Enterprise-specific features for ${{ github.event.inputs.version }}
96+
97+
#### Bug Fixes
98+
99+
- TODO: Add Enterprise-specific bug fixes for ${{ github.event.inputs.version }}
100+
EOF
59101
60-
# For now, create a placeholder
102+
echo "generated=true" >> $GITHUB_OUTPUT
103+
104+
- name: Upload release notes
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: release-notes-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}
108+
path: helper-scripts/output/release-notes/
109+
retention-days: 30
110+
111+
generate-release-notes-distributed:
112+
name: Generate Release Notes (Distributed)
113+
runs-on: ubuntu-latest
114+
if: contains(fromJSON('["clustered", "cloud-dedicated", "cloud-serverless"]'), github.event.inputs.product)
115+
outputs:
116+
generated: ${{ steps.generate.outputs.generated }}
117+
118+
steps:
119+
- uses: actions/checkout@v4
120+
121+
- name: Set up Node.js
122+
uses: actions/setup-node@v4
123+
with:
124+
node-version: '18'
125+
cache: 'yarn'
126+
127+
- name: Install dependencies
128+
run: yarn install --frozen-lockfile
129+
130+
- name: Generate release notes
131+
id: generate
132+
run: |
133+
echo "Generating distributed product release notes for ${{ github.event.inputs.product }} v${{ github.event.inputs.version }}"
134+
135+
# Create output directory
61136
mkdir -p helper-scripts/output/release-notes
62-
echo "# Release Notes for ${{ github.event.inputs.product }} v${{ github.event.inputs.version }}" > helper-scripts/output/release-notes/release-notes-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}.md
137+
138+
# Note: This generates placeholder release notes since the actual repositories
139+
# for distributed products are not available in the GitHub Actions environment.
140+
# To generate actual release notes, the script would need to be run locally with:
141+
# node ./helper-scripts/common/generate-release-notes.js \
142+
# --format standard \
143+
# ${{ github.event.inputs.previous_version }} \
144+
# ${{ github.event.inputs.version }} \
145+
# /path/to/repository
146+
147+
# Create structured placeholder for distributed products
148+
cat > helper-scripts/output/release-notes/release-notes-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}.md << EOF
149+
## ${{ github.event.inputs.version }} {date="$(date +'%Y-%m-%d')"}
150+
151+
### Features
152+
153+
- TODO: Add features for ${{ github.event.inputs.product }} ${{ github.event.inputs.version }}
154+
155+
### Bug Fixes
156+
157+
- TODO: Add bug fixes for ${{ github.event.inputs.product }} ${{ github.event.inputs.version }}
158+
159+
### Performance Improvements
160+
161+
- TODO: Add performance improvements for ${{ github.event.inputs.product }} ${{ github.event.inputs.version }}
162+
EOF
163+
63164
echo "generated=true" >> $GITHUB_OUTPUT
64165
65166
- name: Upload release notes
@@ -71,9 +172,9 @@ jobs:
71172

72173
audit-cli-documentation:
73174
name: Audit CLI Documentation
74-
needs: generate-release-notes
175+
needs: generate-release-notes-core-enterprise
75176
runs-on: ubuntu-latest
76-
if: needs.generate-release-notes.outputs.generated == 'true' && contains(fromJSON('["core", "enterprise"]'), github.event.inputs.product)
177+
if: needs.generate-release-notes-core-enterprise.outputs.generated == 'true' && contains(fromJSON('["core", "enterprise"]'), github.event.inputs.product)
77178

78179
steps:
79180
- uses: actions/checkout@v4
@@ -115,9 +216,9 @@ jobs:
115216

116217
audit-distributed-documentation:
117218
name: Audit Distributed Products Documentation
118-
needs: generate-release-notes
219+
needs: generate-release-notes-distributed
119220
runs-on: ubuntu-latest
120-
if: needs.generate-release-notes.outputs.generated == 'true' && contains(fromJSON('["clustered", "cloud-dedicated", "cloud-serverless"]'), github.event.inputs.product)
221+
if: needs.generate-release-notes-distributed.outputs.generated == 'true' && contains(fromJSON('["clustered", "cloud-dedicated", "cloud-serverless"]'), github.event.inputs.product)
121222

122223
steps:
123224
- uses: actions/checkout@v4
@@ -174,9 +275,9 @@ jobs:
174275

175276
create-documentation-pr:
176277
name: Create Documentation PR
177-
needs: [generate-release-notes, audit-cli-documentation, audit-distributed-documentation]
278+
needs: [generate-release-notes-core-enterprise, generate-release-notes-distributed, audit-cli-documentation, audit-distributed-documentation]
178279
runs-on: ubuntu-latest
179-
if: github.event.inputs.dry_run != 'true' && always() && needs.generate-release-notes.result == 'success'
280+
if: github.event.inputs.dry_run != 'true' && always() && (needs.generate-release-notes-core-enterprise.result == 'success' || needs.generate-release-notes-distributed.result == 'success')
180281

181282
steps:
182283
- uses: actions/checkout@v4
@@ -194,8 +295,56 @@ jobs:
194295
195296
- name: Copy release notes to docs
196297
run: |
197-
# TODO: Copy release notes to appropriate documentation location
198-
echo "Release notes would be copied here"
298+
# Download the generated release notes artifact
299+
PRODUCT="${{ github.event.inputs.product }}"
300+
VERSION="${{ github.event.inputs.version }}"
301+
302+
# Determine the target documentation file based on product
303+
case "$PRODUCT" in
304+
"core"|"enterprise")
305+
TARGET_FILE="content/shared/v3-core-enterprise-release-notes/_index.md"
306+
SOURCE_FILE="artifacts/release-notes-${PRODUCT}-${VERSION}/release-notes-${PRODUCT}-${VERSION}.md"
307+
;;
308+
"clustered")
309+
TARGET_FILE="content/influxdb3/clustered/reference/release-notes/_index.md"
310+
SOURCE_FILE="artifacts/release-notes-${PRODUCT}-${VERSION}/release-notes-${PRODUCT}-${VERSION}.md"
311+
;;
312+
"cloud-dedicated")
313+
TARGET_FILE="content/influxdb3/cloud-dedicated/reference/release-notes/_index.md"
314+
SOURCE_FILE="artifacts/release-notes-${PRODUCT}-${VERSION}/release-notes-${PRODUCT}-${VERSION}.md"
315+
;;
316+
"cloud-serverless")
317+
TARGET_FILE="content/influxdb3/cloud-serverless/reference/release-notes/_index.md"
318+
SOURCE_FILE="artifacts/release-notes-${PRODUCT}-${VERSION}/release-notes-${PRODUCT}-${VERSION}.md"
319+
;;
320+
*)
321+
echo "Unknown product: $PRODUCT"
322+
exit 1
323+
;;
324+
esac
325+
326+
# Check if source file exists
327+
if [ -f "$SOURCE_FILE" ]; then
328+
echo "Copying release notes from $SOURCE_FILE to $TARGET_FILE"
329+
330+
# For Core/Enterprise, prepend to existing file (new releases go at the top)
331+
if [ "$PRODUCT" = "core" ] || [ "$PRODUCT" = "enterprise" ]; then
332+
# Create temporary file with new content + existing content
333+
cp "$SOURCE_FILE" temp_release_notes.md
334+
echo "" >> temp_release_notes.md
335+
cat "$TARGET_FILE" >> temp_release_notes.md
336+
mv temp_release_notes.md "$TARGET_FILE"
337+
else
338+
# For other products, replace the file
339+
cp "$SOURCE_FILE" "$TARGET_FILE"
340+
fi
341+
342+
echo "Release notes successfully copied to documentation"
343+
else
344+
echo "Warning: Release notes file not found at $SOURCE_FILE"
345+
echo "Available files in artifacts:"
346+
find artifacts/ -type f -name "*.md" || echo "No markdown files found"
347+
fi
199348
200349
- name: Create Pull Request
201350
uses: peter-evans/create-pull-request@v5
@@ -327,7 +476,7 @@ jobs:
327476
328477
influxdb3-monolith-release-summary:
329478
name: Release Summary
330-
needs: [generate-release-notes, audit-cli-documentation, audit-distributed-documentation, create-documentation-pr, create-audit-issue]
479+
needs: [generate-release-notes-core-enterprise, generate-release-notes-distributed, audit-cli-documentation, audit-distributed-documentation, create-documentation-pr, create-audit-issue]
331480
runs-on: ubuntu-latest
332481
if: always()
333482

@@ -346,7 +495,8 @@ jobs:
346495
echo "## Workflow Results" >> $GITHUB_STEP_SUMMARY
347496
echo "| Step | Status |" >> $GITHUB_STEP_SUMMARY
348497
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
349-
echo "| Generate Release Notes | ${{ needs.generate-release-notes.result }} |" >> $GITHUB_STEP_SUMMARY
498+
echo "| Generate Release Notes (Core/Enterprise) | ${{ needs.generate-release-notes-core-enterprise.result }} |" >> $GITHUB_STEP_SUMMARY
499+
echo "| Generate Release Notes (Distributed) | ${{ needs.generate-release-notes-distributed.result }} |" >> $GITHUB_STEP_SUMMARY
350500
echo "| CLI Documentation Audit | ${{ needs.audit-cli-documentation.result }} |" >> $GITHUB_STEP_SUMMARY
351501
echo "| Distributed Documentation Audit | ${{ needs.audit-distributed-documentation.result }} |" >> $GITHUB_STEP_SUMMARY
352502
echo "| Create Documentation PR | ${{ needs.create-documentation-pr.result }} |" >> $GITHUB_STEP_SUMMARY

.github/workflows/prepare-release.yml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,51 @@ jobs:
3535
run: |
3636
git checkout -b docs-release-v${{ inputs.version }}
3737
38+
- name: Set up Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: '18'
42+
cache: 'yarn'
43+
44+
- name: Install dependencies
45+
run: yarn install --frozen-lockfile
46+
3847
- name: Generate release notes
3948
run: |
40-
./helper-scripts/common/generate-release-notes.sh \
41-
--product ${{ inputs.product }} \
42-
--version ${{ inputs.version }} \
43-
--output content/influxdb3/${{ inputs.product }}/release-notes/v${{ inputs.version }}.md
49+
# Note: This workflow assumes release notes are generated manually or from tagged releases
50+
# For Core/Enterprise products, the script needs repository access which would require
51+
# checking out the influxdb and influxdb_pro repositories first
52+
53+
echo "Warning: Release notes generation requires access to InfluxDB source repositories"
54+
echo "For now, creating a placeholder file that should be replaced with actual release notes"
55+
56+
# Create output directory
57+
mkdir -p helper-scripts/output/release-notes
58+
59+
# Create placeholder release notes file
60+
cat > helper-scripts/output/release-notes/release-notes-v${{ inputs.version }}.md << EOF
61+
## v${{ inputs.version }} {date="$(date +'%Y-%m-%d')"}
62+
63+
### Features
64+
65+
- TODO: Add features for ${{ inputs.product }} v${{ inputs.version }}
66+
67+
### Bug Fixes
68+
69+
- TODO: Add bug fixes for ${{ inputs.product }} v${{ inputs.version }}
70+
71+
<!--
72+
Note: This is a placeholder file generated by the workflow.
73+
To generate actual release notes with commit history, run:
74+
75+
node ./helper-scripts/common/generate-release-notes.js \\
76+
--format core-enterprise \\
77+
v$(echo "${{ inputs.version }}" | sed 's/^v//') \\
78+
v${{ inputs.version }} \\
79+
/path/to/influxdb \\
80+
/path/to/influxdb_pro
81+
-->
82+
EOF
4483
4584
- name: Update product versions
4685
run: |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"outputFormat": "core-enterprise",
3+
"repositories": [
4+
{
5+
"name": "influxdb",
6+
"path": "/Users/ja/Documents/github/influxdb",
7+
"label": "influxdb"
8+
},
9+
{
10+
"name": "influxdb_pro",
11+
"path": "/Users/ja/Documents/github/influxdb_pro",
12+
"label": "influxdb_pro"
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)