-
Notifications
You must be signed in to change notification settings - Fork 2
Add GitHub Action workflows to support Admin API v2 #25
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
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthrough
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer/PR
participant GH as GitHub Actions (bump.yml)
participant Bump as bump-sh/action
participant PR as Pull Request
Dev->>GH: Push/PR triggers bump.yml
GH->>GH: Compute overlays/output
alt file_path == admin/admin.yaml (admin v1)
GH->>Bump: Deploy API docs (branch v1)
Bump-->>GH: Status
GH->>Bump: Comment PR with API diff (branch v1)
Bump-->>PR: Post diff comment
else file_path == admin/admin-v2.yaml (admin v2)
GH->>Bump: Deploy API docs (branch v2)
Bump-->>GH: Status
GH->>Bump: Comment PR with API diff (branch v2)
Bump-->>PR: Post diff comment
else other files
GH->>Bump: Deploy API docs (default)
Bump-->>GH: Status
GH->>Bump: Comment PR with API diff (default)
Bump-->>PR: Post diff comment
end
sequenceDiagram
autonumber
actor Upstream as Upstream Trigger
participant GH as GitHub Actions (get-admin-api-spec.yml)
participant AWS as AWS (STS/Secrets Manager)
participant Repo as Repo
participant Tools as doc-tools
participant PR as create-pull-request
Upstream->>GH: repository_dispatch (redpanda-openapi-bundle) or workflow_dispatch(tag)
GH->>GH: Determine TAG (input or payload)
GH->>AWS: Assume role (OIDC)
AWS-->>GH: Temp creds
GH->>AWS: Fetch secrets (bot token, etc.)
AWS-->>GH: Secrets JSON
GH->>Repo: Checkout (actions token)
GH->>GH: Setup Node.js v22 + cache
GH->>GH: Validate TAG present
GH->>Tools: npm ci && npx doc-tools install
GH->>Tools: npx doc-tools generate --tag TAG --use-admin-major-version --surface admin -o admin/admin-v2.yaml
Tools-->>GH: Generated spec
GH->>PR: Open PR (branch, title, body, label)
PR-->>GH: PR created
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Pre-merge checks and finishing touches✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 6
🧹 Nitpick comments (3)
.github/workflows/get-admin-api-spec.yml (3)
61-64
: Pin and non-interactively install toolchain via npx.Use npx with -y and pin doc-tools for reproducibility.
- - name: Install tools - run: | - npx doc-tools install-test-dependencies + - name: Install tools + run: | + npx -y doc-tools@latest install-test-dependenciesOptionally replace “install-test-dependencies” with only what’s needed for bundle to keep the workflow lean.
65-69
: Rename step for clarity.This generates Admin API docs, not “RPCN Connector”.
- - name: Generate RPCN Connector docs + - name: Generate Admin API docs (v2)
75-77
: Consider unique branches per tag to avoid PR contention.Using a static branch can cause collisions across runs. Including TAG in the branch helps parallel updates.
- branch: auto-docs/admin-api + branch: auto-docs/admin-api/${{ env.TAG }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (2)
.github/workflows/bump.yml
(3 hunks).github/workflows/get-admin-api-spec.yml
(1 hunks)
🔇 Additional comments (3)
.github/workflows/bump.yml (3)
137-148
: LGTM for “other files” path.Condition correctly excludes the two admin files; inputs and env look good.
240-251
: LGTM for “other files” diff path.Condition and inputs are consistent with deploy.
226-239
: Make admin v2 diff step explicit and update file detection
Theif
onsteps.format.outputs.file_path
will never matchadmin/admin-v2.yaml
—the “Determine file format” step only handlesmatrix.doc_id.yaml
,.json
or-api.json
. Mirror the deploy fix: hardcodeif: ${{ matrix.doc_id == 'admin' && hashFiles('admin/admin-v2.yaml') != '' }} file: admin/admin-v2.yaml(and similarly for v1), and extend the “Determine file format” step to recognize
admin/admin-v2.yaml
.
This pull request introduces improvements to the automation around deploying and reviewing Redpanda Admin API documentation, and adds a new workflow for bundling the Admin OpenAPI spec. The most important changes are the addition of targeted deployment and diff-commenting steps for different admin API versions, and the creation of a dedicated workflow to automate OpenAPI spec updates.
Improvements to API documentation deployment and review:
.github/workflows/bump.yml
into three separate actions, each targeting eitheradmin/admin.yaml
,admin/admin-v2.yaml
, or other files, allowing for version-specific deployment to the correct branch..github/workflows/bump.yml
into three separate actions for version-specific API diffs, improving clarity and traceability in PRs.New workflow for OpenAPI spec bundling:
.github/workflows/get-admin-api-spec.yml
, a new workflow that bundles the Admin OpenAPI spec for a given Redpanda tag, generates the documentation, and automatically creates a pull request to update the spec files. This streamlines the update process and ensures documentation stays current.Related: redpanda-data/redpanda#27947