Skip to content

Commit 55e6c6d

Browse files
authored
Restructure the config properties to support automation (#1485)
1 parent ea0bca7 commit 55e6c6d

16 files changed

+47052
-10591
lines changed

.github/copilot-instructions.md

Lines changed: 917 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
name: Generate Property Docs
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: "Tag to use for property doc generation"
9+
required: true
10+
type: string
11+
repository_dispatch:
12+
types: [trigger-property-docs-generation]
13+
14+
jobs:
15+
generate-property-docs:
16+
runs-on: ubuntu-24.04
17+
permissions:
18+
id-token: write
19+
contents: write
20+
pull-requests: write
21+
22+
steps:
23+
- name: Configure AWS credentials
24+
uses: aws-actions/configure-aws-credentials@v4
25+
with:
26+
aws-region: ${{ vars.RP_AWS_CRED_REGION }}
27+
role-to-assume: arn:aws:iam::${{ secrets.RP_AWS_CRED_ACCOUNT_ID }}:role/${{ vars.RP_AWS_CRED_BASE_ROLE_NAME }}${{ github.event.repository.name }}
28+
29+
- name: Get secrets from AWS Secrets Manager
30+
uses: aws-actions/aws-secretsmanager-get-secrets@v2
31+
with:
32+
secret-ids: |
33+
,sdlc/prod/github/actions_bot_token
34+
parse-json-secrets: true
35+
36+
- name: Checkout the repository
37+
uses: actions/checkout@v4
38+
with:
39+
ref: main
40+
token: ${{ env.ACTIONS_BOT_TOKEN }}
41+
42+
- name: Set up Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: 20
46+
47+
- name: Install dependencies
48+
run: npm ci
49+
50+
- name: Determine tag
51+
id: tag
52+
run: |
53+
if [ -n "${{ github.event.inputs.tag }}" ]; then
54+
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
55+
elif [ -n "${{ github.event.client_payload.tag }}" ]; then
56+
echo "tag=${{ github.event.client_payload.tag }}" >> $GITHUB_OUTPUT
57+
else
58+
echo "❌ No tag provided via input or dispatch payload" >&2
59+
exit 1
60+
fi
61+
62+
- name: Check if tag is newer than antora.yml latest
63+
id: version_check
64+
run: |
65+
set -euo pipefail
66+
TAG="${{ steps.tag.outputs.tag }}"
67+
CURRENT=$(grep 'latest-redpanda-tag:' antora.yml | awk '{print $2}' | tr -d '"')
68+
69+
echo "📄 Current latest-redpanda-tag in antora.yml: $CURRENT"
70+
echo "🔖 Incoming tag: $TAG"
71+
72+
# Strip leading 'v' for numeric comparison
73+
CUR_NUM=$(echo "$CURRENT" | sed 's/^v//')
74+
NEW_NUM=$(echo "$TAG" | sed 's/^v//')
75+
76+
# Compare semver using sort -V
77+
if [ "$(printf "%s\n%s" "$CUR_NUM" "$NEW_NUM" | sort -V | tail -n1)" = "$NEW_NUM" ] && [ "$CUR_NUM" != "$NEW_NUM" ]; then
78+
echo "$TAG is newer than $CURRENT"
79+
echo "is_newer=true" >> $GITHUB_OUTPUT
80+
else
81+
echo "$TAG is not newer than $CURRENT — skipping doc generation"
82+
echo "is_newer=false" >> $GITHUB_OUTPUT
83+
fi
84+
85+
- name: Generate property docs
86+
if: steps.version_check.outputs.is_newer == 'true'
87+
run: |
88+
set -euo pipefail
89+
echo "Running doc generation for: ${{ steps.tag.outputs.tag }}"
90+
npx doc-tools generate property-docs \
91+
--tag "${{ steps.tag.outputs.tag }}" \
92+
--generate-partials \
93+
--cloud-support \
94+
--overrides docs-data/property-overrides.json
95+
env:
96+
GITHUB_TOKEN: ${{ env.ACTIONS_BOT_TOKEN }}
97+
98+
- name: Create pull request
99+
if: steps.version_check.outputs.is_newer == 'true'
100+
uses: peter-evans/create-pull-request@v6
101+
with:
102+
token: ${{ env.ACTIONS_BOT_TOKEN }}
103+
commit-message: "auto-docs: Update property docs for ${{ steps.tag.outputs.tag }}"
104+
branch: update-property-docs-${{ steps.tag.outputs.tag }}
105+
title: "auto-docs: Update property docs for tag ${{ steps.tag.outputs.tag }}"
106+
body: |
107+
This PR auto-generates updated Redpanda property documentation for **${{ steps.tag.outputs.tag }}**.
108+
labels: auto-docs
109+
110+
- name: Skip notice
111+
if: steps.version_check.outputs.is_newer != 'true'
112+
run: echo "Skipping doc generation — tag is not newer than latest-redpanda-tag in antora.yml."

antora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ asciidoc:
1919
# --
2020
full-version: 25.3.1
2121
latest-redpanda-tag: 'v25.3.1'
22-
latest-console-tag: '3.30.1'
22+
latest-console-tag: 'v3.3.1'
2323
latest-release-commit: '6aa5af28b020b66e5caa966094882b7260497a53'
2424
latest-operator-version: 'v2.3.8-24.3.6'
2525
operator-beta-tag: ''

docs-data/property-overrides.json

Lines changed: 2079 additions & 0 deletions
Large diffs are not rendered by default.

local-antora-playbook.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ content:
1717
- url: https://github.com/redpanda-data/docs
1818
branches: [v/*, shared, site-search,'!v-end-of-life/*']
1919
- url: https://github.com/redpanda-data/cloud-docs
20-
branches: 'main'
20+
branches: 'config-automation'
2121
- url: https://github.com/redpanda-data/redpanda-labs
2222
branches: main
2323
start_paths: [docs,'*/docs']
2424
- url: https://github.com/redpanda-data/rp-connect-docs
2525
branches: main
26+
- url: https://github.com/redpanda-data/docs-site
27+
branches: 'main'
28+
start_paths: [home]
2629
ui:
2730
bundle:
2831
url: https://github.com/redpanda-data/docs-ui/releases/latest/download/ui-bundle.zip

0 commit comments

Comments
 (0)