-
Notifications
You must be signed in to change notification settings - Fork 47
Restructure the config properties to support automation #1485
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a0131de
Restructure the config properties to support automation
JakeSCahill 123e080
Conditional links
JakeSCahill e1702f4
Clean up links
JakeSCahill 06149a7
Apply fixes
JakeSCahill 8291b6f
Add enum descriptions
JakeSCahill c277849
Add missing descriptions
JakeSCahill 7157059
fix tags
JakeSCahill bfa338d
Fix format
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.