-
Notifications
You must be signed in to change notification settings - Fork 48
Config automation #1428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JakeSCahill
wants to merge
10
commits into
main
Choose a base branch
from
config-automation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Config automation #1428
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8e83911
Init overrides
JakeSCahill 450e7b8
Add broker property diff
JakeSCahill 714840b
Add cluster property diff
JakeSCahill ba6c5ef
Add object property diff
JakeSCahill e412ba3
Add config property automation
JakeSCahill 2f5ed71
Delete modules/reference/pages/property-report.json
JakeSCahill 3d28a8e
Update overrides
JakeSCahill 9277937
Merge branch 'config-automation' of https://github.com/redpanda-data/…
JakeSCahill 85c4977
Merge branch 'main' of https://github.com/redpanda-data/docs into con…
JakeSCahill 160f365
Apply latest improvements
JakeSCahill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| --- | ||
| name: Generate Property Docs | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Tag to use for property doc generation" | ||
| required: true | ||
| type: string | ||
| repository_dispatch: | ||
| types: [trigger-property-docs-generation] | ||
|
|
||
| jobs: | ||
| generate-property-docs: | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Configure AWS credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: ${{ vars.RP_AWS_CRED_REGION }} | ||
| role-to-assume: arn:aws:iam::${{ secrets.RP_AWS_CRED_ACCOUNT_ID }}:role/${{ vars.RP_AWS_CRED_BASE_ROLE_NAME }}${{ github.event.repository.name }} | ||
|
|
||
| - name: Get secrets from AWS Secrets Manager | ||
| uses: aws-actions/aws-secretsmanager-get-secrets@v2 | ||
| with: | ||
| secret-ids: | | ||
| ,sdlc/prod/github/actions_bot_token | ||
| parse-json-secrets: true | ||
|
|
||
| - name: Checkout the repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: main | ||
| token: ${{ env.ACTIONS_BOT_TOKEN }} | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Determine tag | ||
| id: tag | ||
| run: | | ||
| if [ -n "${{ github.event.inputs.tag }}" ]; then | ||
| echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT | ||
| elif [ -n "${{ github.event.client_payload.tag }}" ]; then | ||
| echo "tag=${{ github.event.client_payload.tag }}" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "❌ No tag provided via input or dispatch payload" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Check if tag is newer than antora.yml latest | ||
| id: version_check | ||
| run: | | ||
| set -euo pipefail | ||
| TAG="${{ steps.tag.outputs.tag }}" | ||
| CURRENT=$(grep 'latest-redpanda-tag:' antora.yml | awk '{print $2}' | tr -d '"') | ||
|
|
||
| echo "📄 Current latest-redpanda-tag in antora.yml: $CURRENT" | ||
| echo "🔖 Incoming tag: $TAG" | ||
|
|
||
| # Strip leading 'v' for numeric comparison | ||
| CUR_NUM=$(echo "$CURRENT" | sed 's/^v//') | ||
| NEW_NUM=$(echo "$TAG" | sed 's/^v//') | ||
|
|
||
| # Compare semver using sort -V | ||
| if [ "$(printf "%s\n%s" "$CUR_NUM" "$NEW_NUM" | sort -V | tail -n1)" = "$NEW_NUM" ] && [ "$CUR_NUM" != "$NEW_NUM" ]; then | ||
| echo "$TAG is newer than $CURRENT" | ||
| echo "is_newer=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "$TAG is not newer than $CURRENT — skipping doc generation" | ||
| echo "is_newer=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Generate property docs | ||
| if: steps.version_check.outputs.is_newer == 'true' | ||
| run: | | ||
| set -euo pipefail | ||
| echo "Running doc generation for: ${{ steps.tag.outputs.tag }}" | ||
| npx doc-tools generate property-docs \ | ||
| --tag "${{ steps.tag.outputs.tag }}" \ | ||
| --generate-partials \ | ||
| --cloud-support \ | ||
| --overrides docs-data/property-overrides.json | ||
| env: | ||
| GITHUB_TOKEN: ${{ env.ACTIONS_BOT_TOKEN }} | ||
|
|
||
| - name: Create pull request | ||
| if: steps.version_check.outputs.is_newer == 'true' | ||
| uses: peter-evans/create-pull-request@v6 | ||
| with: | ||
| token: ${{ env.ACTIONS_BOT_TOKEN }} | ||
| commit-message: "auto-docs: Update property docs for ${{ steps.tag.outputs.tag }}" | ||
| branch: update-property-docs-${{ steps.tag.outputs.tag }} | ||
| title: "auto-docs: Update property docs for tag ${{ steps.tag.outputs.tag }}" | ||
| body: | | ||
| This PR auto-generates updated Redpanda property documentation for **${{ steps.tag.outputs.tag }}**. | ||
| labels: auto-docs | ||
|
|
||
| - name: Skip notice | ||
| if: steps.version_check.outputs.is_newer != 'true' | ||
| run: echo "🟡 Skipping doc generation — tag is not newer than latest-redpanda-tag in antora.yml." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not using
'anymore?