Skip to content

Commit 9a4721a

Browse files
committed
chore(ci): Automation scripts to compare influxdb3 CLI help to reference documentation and generate an audit report, runs influxdb3 core and enterprise using Docker, improves compose.yaml, restructures helper-scripts for different versions
1 parent b0294eb commit 9a4721a

File tree

16 files changed

+1675
-755
lines changed

16 files changed

+1675
-755
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: Audit Documentation
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
product:
7+
description: 'Product to audit'
8+
required: true
9+
type: choice
10+
options:
11+
- core
12+
- enterprise
13+
- clustered
14+
- cloud-dedicated
15+
- all-monolith
16+
- all-distributed
17+
version:
18+
description: 'Version to audit (use "local" for running containers)'
19+
required: false
20+
default: 'local'
21+
22+
schedule:
23+
# Run weekly on Mondays at 9 AM UTC
24+
- cron: '0 9 * * 1'
25+
26+
jobs:
27+
audit-cli:
28+
name: Audit CLI Documentation
29+
runs-on: ubuntu-latest
30+
if: contains(fromJSON('["core", "enterprise", "all-monolith"]'), github.event.inputs.product)
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Set up Docker
36+
if: github.event.inputs.version == 'local'
37+
run: |
38+
docker compose up -d influxdb3-core influxdb3-enterprise
39+
sleep 10 # Wait for containers to be ready
40+
41+
- name: Run CLI audit
42+
run: |
43+
PRODUCT="${{ github.event.inputs.product }}"
44+
VERSION="${{ github.event.inputs.version }}"
45+
46+
if [ "$PRODUCT" == "all-monolith" ]; then
47+
./helper-scripts/influxdb3-monolith/audit-cli-documentation.sh both $VERSION
48+
else
49+
./helper-scripts/influxdb3-monolith/audit-cli-documentation.sh $PRODUCT $VERSION
50+
fi
51+
52+
- name: Upload CLI audit reports
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: cli-audit-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}
56+
path: helper-scripts/output/cli-audit/
57+
retention-days: 30
58+
59+
- name: Create CLI audit issue
60+
if: github.event_name == 'schedule' || github.event.inputs.create_issue == 'true'
61+
uses: actions/github-script@v7
62+
with:
63+
script: |
64+
const fs = require('fs');
65+
const product = '${{ github.event.inputs.product }}';
66+
const version = '${{ github.event.inputs.version }}';
67+
68+
// Read audit report
69+
const reportPath = `helper-scripts/output/cli-audit/documentation-audit-${product}-${version}.md`;
70+
const report = fs.readFileSync(reportPath, 'utf8');
71+
72+
// Create issue
73+
await github.rest.issues.create({
74+
owner: context.repo.owner,
75+
repo: context.repo.repo,
76+
title: `CLI Documentation Audit - ${product} ${version}`,
77+
body: report,
78+
labels: ['documentation', 'cli-audit', product]
79+
});
80+
81+
audit-api:
82+
name: Audit API Documentation
83+
runs-on: ubuntu-latest
84+
if: contains(fromJSON('["clustered", "cloud-dedicated", "all-distributed"]'), github.event.inputs.product)
85+
86+
steps:
87+
- uses: actions/checkout@v4
88+
89+
- name: Run API audit
90+
run: |
91+
echo "API audit not yet implemented"
92+
# TODO: Implement API documentation audit
93+
# ./helper-scripts/influxdb3-distributed/audit-api-documentation.sh ${{ github.event.inputs.product }}
94+
95+
- name: Upload API audit reports
96+
if: false # Enable when API audit is implemented
97+
uses: actions/upload-artifact@v4
98+
with:
99+
name: api-audit-${{ github.event.inputs.product }}
100+
path: helper-scripts/output/api-audit/
101+
retention-days: 30
102+
103+
summary:
104+
name: Generate Summary Report
105+
runs-on: ubuntu-latest
106+
needs: [audit-cli, audit-api]
107+
if: always()
108+
109+
steps:
110+
- uses: actions/checkout@v4
111+
112+
- name: Download all artifacts
113+
uses: actions/download-artifact@v4
114+
with:
115+
path: audit-artifacts/
116+
117+
- name: Generate summary
118+
run: |
119+
echo "# Documentation Audit Summary" > summary.md
120+
echo "Date: $(date)" >> summary.md
121+
echo "Product: ${{ github.event.inputs.product }}" >> summary.md
122+
echo "Version: ${{ github.event.inputs.version }}" >> summary.md
123+
echo "" >> summary.md
124+
125+
# Add CLI audit results if available
126+
if [ -d "audit-artifacts/cli-audit-*" ]; then
127+
echo "## CLI Audit Results" >> summary.md
128+
cat audit-artifacts/cli-audit-*/*.md >> summary.md
129+
fi
130+
131+
# Add API audit results if available
132+
if [ -d "audit-artifacts/api-audit-*" ]; then
133+
echo "## API Audit Results" >> summary.md
134+
cat audit-artifacts/api-audit-*/*.md >> summary.md
135+
fi
136+
137+
- name: Upload summary
138+
uses: actions/upload-artifact@v4
139+
with:
140+
name: audit-summary
141+
path: summary.md
142+
retention-days: 30

.github/workflows/prepare-release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Prepare Documentation Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
product:
7+
description: 'Product to release'
8+
required: true
9+
type: choice
10+
options:
11+
- core
12+
- enterprise
13+
- cloud-serverless
14+
- cloud-dedicated
15+
version:
16+
description: 'Version number (e.g., 3.2.1)'
17+
required: true
18+
release_type:
19+
description: 'Release type'
20+
required: true
21+
type: choice
22+
options:
23+
- major
24+
- minor
25+
- patch
26+
- hotfix
27+
28+
jobs:
29+
prepare-release:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: Create release branch
35+
run: |
36+
git checkout -b docs-release-v${{ inputs.version }}
37+
38+
- name: Generate release notes
39+
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
44+
45+
- name: Update product versions
46+
run: |
47+
# Script to update data/products.yml
48+
./helper-scripts/common/update-product-version.sh \
49+
--product ${{ inputs.product }} \
50+
--version ${{ inputs.version }}
51+
52+
- name: Create release checklist issue
53+
uses: actions/github-script@v7
54+
with:
55+
script: |
56+
const checklist = require('./.github/scripts/release-checklist.js');
57+
await checklist.createIssue({
58+
github,
59+
context,
60+
product: '${{ inputs.product }}',
61+
version: '${{ inputs.version }}',
62+
releaseType: '${{ inputs.release_type }}'
63+
})

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules
1111
/content/influxdb*/**/api/**/*.html
1212
!api-docs/**/.config.yml
1313
/api-docs/redoc-static.html*
14+
/helper-scripts/output/*
1415
/telegraf-build
1516
!telegraf-build/templates
1617
!telegraf-build/scripts

compose.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# This is a Docker Compose file for the InfluxData documentation site.
22
## Run documentation tests for code samples.
33
name: influxdata-docs
4+
# Configure your credentials in the following secrets files.
45
secrets:
56
influxdb2-admin-username:
67
file: ~/.env.influxdb2-admin-username
78
influxdb2-admin-password:
89
file: ~/.env.influxdb2-admin-password
910
influxdb2-admin-token:
1011
file: ~/.env.influxdb2-admin-token
12+
influxdb3-core-admin-token:
13+
file: ~/.env.influxdb3-core-admin-token
14+
influxdb3-enterprise-admin-token:
15+
file: ~/.env.influxdb3-enterprise-admin-token
1116
services:
1217
local-dev:
1318
build:
@@ -302,6 +307,9 @@ services:
302307
influxdb3-core:
303308
container_name: influxdb3-core
304309
image: influxdb:3-core
310+
# Set variables (except your auth token) for Core in the .env.3core file.
311+
env_file:
312+
- .env.3core
305313
ports:
306314
- 8282:8181
307315
command:
@@ -319,14 +327,18 @@ services:
319327
- type: bind
320328
source: test/.influxdb3/core/plugins
321329
target: /var/lib/influxdb3/plugins
330+
environment:
331+
- INFLUXDB3_AUTH_TOKEN=/run/secrets/influxdb3-core-admin-token
332+
secrets:
333+
- influxdb3-core-admin-token
322334
influxdb3-enterprise:
323335
container_name: influxdb3-enterprise
324336
image: influxdb:3-enterprise
337+
# Set license email and other variables (except your auth token) for Enterprise in the .env.3ent file.
338+
env_file:
339+
- .env.3ent
325340
ports:
326341
- 8181:8181
327-
# Change the INFLUXDB3_LICENSE_EMAIL environment variable to your email address. You can also set it in a `.env` file in the same directory as this compose file. Docker Compose automatically loads the .env file.
328-
# The license email option is only used the first time you run the container; you can't change the license email after the first run.
329-
# The server stores the license in the data directory in the object store and the license is associated with the cluster ID and email.
330342
command:
331343
- influxdb3
332344
- serve
@@ -336,14 +348,17 @@ services:
336348
- --object-store=file
337349
- --data-dir=/var/lib/influxdb3/data
338350
- --plugin-dir=/var/lib/influxdb3/plugins
339-
- --license-email=${INFLUXDB3_LICENSE_EMAIL}
351+
environment:
352+
- INFLUXDB3_AUTH_TOKEN=/run/secrets/influxdb3-enterprise-admin-token
340353
volumes:
341354
- type: bind
342355
source: test/.influxdb3/enterprise/data
343356
target: /var/lib/influxdb3/data
344357
- type: bind
345358
source: test/.influxdb3/enterprise/plugins
346359
target: /var/lib/influxdb3/plugins
360+
secrets:
361+
- influxdb3-enterprise-admin-token
347362
telegraf-pytest:
348363
container_name: telegraf-pytest
349364
image: influxdata/docs-pytest

0 commit comments

Comments
 (0)