Skip to content

Conversation

JakeSCahill
Copy link
Contributor

@JakeSCahill JakeSCahill commented Oct 8, 2025

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:

  • Split the API documentation deployment step in .github/workflows/bump.yml into three separate actions, each targeting either admin/admin.yaml, admin/admin-v2.yaml, or other files, allowing for version-specific deployment to the correct branch.
  • Split the pull request diff-commenting step in .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:

  • Added .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

@JakeSCahill JakeSCahill requested a review from a team as a code owner October 8, 2025 11:19
Copy link

coderabbitai bot commented Oct 8, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

  • Modifies .github/workflows/bump.yml to split API documentation deployment and PR comment steps into conditional branches for admin v1 (admin/admin.yaml → branch v1), admin v2 (admin/admin-v2.yaml → branch v2), and “other files.”
  • Each conditional step uses bump-sh/github-action@v1 and passes overlays and GITHUB_TOKEN.
  • Adds .github/workflows/get-admin-api-spec.yml workflow that bundles Admin OpenAPI v2 via doc-tools on triggers (repository_dispatch redpanda-openapi-bundle or workflow_dispatch with tag), assumes AWS role, fetches secrets, installs Node/npm tools, generates admin/admin-v2.yaml with a tag and major-version flag, and opens a pull request with labels.

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
Loading
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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly states the addition of GitHub Action workflows for Admin API v2 and relates directly to the main change of supporting v2, though it does not mention the deployment split for v1 or the new bundling workflow. It is specific, clear, and highlights a core aspect of the changeset.
Linked Issues Check ✅ Passed The PR implements a new bundling workflow that generates Admin API v2 specs from protobuf definitions and automates pull requests to update documentation, and it enhances deployment steps to ensure reference docs are updated and released, fully satisfying the objectives of DOC-1705.
Out of Scope Changes Check ✅ Passed All changes, including splitting the deployment and diff-commenting steps by file path and adding the bundling workflow, are directly related to automating Admin API v2 updates and do not introduce any unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed The pull request description clearly outlines the automation improvements for deploying and reviewing Admin API documentation and the addition of a new workflow for bundling the Admin OpenAPI spec, directly matching the changes to bump.yml and the new get-admin-api-spec.yml workflow file.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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-dependencies

Optionally 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 58634be and a18da03.

⛔ 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
The if on steps.format.outputs.file_path will never match admin/admin-v2.yaml—the “Determine file format” step only handles matrix.doc_id.yaml, .json or -api.json. Mirror the deploy fix: hardcode

if: ${{ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant