-
Notifications
You must be signed in to change notification settings - Fork 52
test: add Doc Detective coverage for the Kind local development guide #1851
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ jobs: | |
| outputs: | ||
| console: ${{ steps.filter.outputs.console }} | ||
| quickstart: ${{ steps.filter.outputs.quickstart }} | ||
| kindguide: ${{ steps.filter.outputs.kindguide }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
@@ -26,6 +27,10 @@ jobs: | |
| - 'modules/console/**' | ||
| quickstart: | ||
| - 'modules/get-started/pages/quick-start.adoc' | ||
| kindguide: | ||
| - 'modules/deploy/pages/redpanda/kubernetes/local-guide.adoc' | ||
| - 'modules/deploy/partials/kubernetes/**' | ||
| - 'antora.yml' | ||
|
|
||
| run-tests: | ||
| needs: setup | ||
|
|
@@ -98,3 +103,71 @@ jobs: | |
| path: /home/runner/work/_temp/doc-detective-output.json | ||
| env: | ||
| REDPANDA_GITHUB_TOKEN: ${{ env.ACTIONS_BOT_TOKEN }} | ||
|
|
||
| test-kind-guide: | ||
| needs: setup | ||
| # Skip the entire job for fork PRs. Run for all scheduled and manual triggers, and on PRs that touch the Kind guide or its shared partials. | ||
| if: >- | ||
| (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork != true) && | ||
| (github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event_name == 'schedule' || needs.setup.outputs.kindguide == 'true') | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write | ||
| id-token: write | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
|
Comment on lines
+118
to
+119
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Increase the job timeout. The guide permits 21 minutes for Redpanda readiness, 11 minutes for broker deletion, and additional 5-minute installation waits plus teardown. A healthy but slow run can exceed 45 minutes and be killed before cleanup. Increase the job timeout or reduce the individual budgets. 🤖 Prompt for AI Agents |
||
| steps: | ||
| - 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 }} | ||
| - uses: aws-actions/aws-secretsmanager-get-secrets@v2 | ||
| with: | ||
| secret-ids: | | ||
| ,sdlc/prod/github/actions_bot_token | ||
| parse-json-secrets: true | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ env.ACTIONS_BOT_TOKEN }} | ||
| path: redpanda-docs | ||
|
Comment on lines
+121
to
+133
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🔴 Critical | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
rg -n -C2 'configure-aws-credentials|aws-secretsmanager|GITHUB_ENV|persist-credentials' \
.github/workflows/test-docs.ymlRepository: redpanda-data/docs Length of output: 1427 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "== workflow size =="
wc -l .github/workflows/test-docs.yml
echo "== relevant sections =="
sed -n '1,190p' .github/workflows/test-docs.yml | cat -n
echo "== commands/runs in workflow =="
rg -n '(^ *(run|environment):\s*|^\s+- name:|configure-aws-credentials|aws-secretsmanager|GITHUB_ENV|persist-credentials|chmod|npm install|run:)' .github/workflows/test-docs.ymlRepository: redpanda-data/docs Length of output: 9059 🌐 Web query:
💡 Result: The aws-actions/aws-secretsmanager-get-secrets Citations:
🌐 Web query:
💡 Result: In the GitHub Actions checkout action (actions/checkout), the persist-credentials input parameter controls whether the GitHub token or SSH key used for the repository checkout is configured in the local git configuration [1][2][3]. Key details regarding this parameter include: Default Value: The default is true [1][2][3]. Function: When set to true (default), the credentials are made available to the local git configuration [4][5]. This allows subsequent steps in your workflow job to execute authenticated git commands (such as git fetch or git push) without requiring additional setup [4][2][5]. Security Note: Because the credentials are stored in the git configuration, they are technically accessible to other steps in the same job [6]. The action automatically cleans up these credentials during the post-job phase [4][7]. Opt-out: To disable this behavior for security reasons or if you do not require authenticated git commands in later steps, you can explicitly set persist-credentials: false in your workflow step [4][2][6]. Recent Improvements: In recent versions (such as v6.0.2), credential storage has been improved to store these credentials in a separate file under $RUNNER_TEMP rather than directly within the.git/config file, enhancing security while maintaining existing functionality [5]. Citations:
Do not expose AWS and write permissions to Doc Detective commands. Both 🧰 Tools🪛 zizmor (1.28.0)[warning] 130-133: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
|
|
||
| - name: Install kind | ||
| uses: helm/kind-action@v1 | ||
| with: | ||
| install_only: true | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
| working-directory: redpanda-docs | ||
|
|
||
| - name: Set GitHub token | ||
| run: | | ||
| echo "REDPANDA_GITHUB_TOKEN=${{ env.ACTIONS_BOT_TOKEN }}" >> $GITHUB_ENV | ||
|
|
||
| - name: Test Kind local development guide | ||
| uses: doc-detective/github-action@v1 | ||
| with: | ||
| input: ../../modules/deploy/pages/redpanda/kubernetes/local-guide.adoc | ||
| working_directory: redpanda-docs/tests/setup-tests | ||
| exit_on_fail: true | ||
| create_issue_on_fail: true | ||
| issue_title: "Doc Detective failure: Kind local guide" | ||
| issue_labels: "doc-detective,kind-guide" | ||
| integrations: "claude" | ||
| prompt: "Investigate this Kind local development guide test failure. The test executes the commands documented in modules/deploy/pages/redpanda/kubernetes/local-guide.adoc and its shared partials (modules/deploy/partials/kubernetes/). Determine whether the failure is a docs bug (command drift vs the current operator/chart behavior), a product regression, or test environment flake, and propose the specific docs fix if applicable." | ||
| token: ${{ env.ACTIONS_BOT_TOKEN }} | ||
| env: | ||
| REDPANDA_GITHUB_TOKEN: ${{ env.ACTIONS_BOT_TOKEN }} | ||
|
|
||
| - name: Upload debug artifacts | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: doc-detective-kind-guide-output | ||
| path: /home/runner/work/_temp/doc-detective-output.json | ||
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Include the rpk installation partial in this filter.
local-guide.adocincludesget-started:partial$install-rpk-linux.adocat Line 540, but this filter only watches the local guide, Kubernetes partials, andantora.yml. Changes to the rpk installation instructions can therefore break the guide without runningtest-kind-guide.Suggested filter update
kindguide: - 'modules/deploy/pages/redpanda/kubernetes/local-guide.adoc' - 'modules/deploy/partials/kubernetes/**' + - 'modules/get-started/partials/install-rpk-linux.adoc' - 'antora.yml'📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.28.0)
[warning] 12-33: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents