Skip to content

ci: run doc tests on version bumps and support version overrides - #1848

Merged
JakeSCahill merged 2 commits into
mainfrom
ci-doc-test-triggers
Aug 4, 2026
Merged

ci: run doc tests on version bumps and support version overrides#1848
JakeSCahill merged 2 commits into
mainfrom
ci-doc-test-triggers

Conversation

@JakeSCahill

@JakeSCahill JakeSCahill commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes the trigger gap that let the Console v3.9 UI rework break the quickstart doc test silently: the version-bump PR never ran the test (antora.yml is not in the quickstart paths filter (since #1846 it is in kindguide, so the kind-guide test already runs on version bumps — this PR extends that to the quickstart test)), so the breakage only surfaced in nightly runs, which then failed for ~92 consecutive nights until #1846 fixed the selectors.

Changes

  1. Run the quickstart test on version-bump PRs. antora.yml pins the Redpanda and Console versions the test runs against, so a new versions paths filter now triggers the PR test step when it changes. UI or image breakage from a version bump is caught before merge instead of by the nightly.
  2. Support version overrides for dispatch and manual runs. The workflow_dispatch trigger gains optional inputs (redpanda_version, redpanda_docker_repo, console_version, console_docker_repo), and the dispatch/schedule test step maps them (or the same keys from a trigger-tests client_payload) to the env vars the test spec already resolves before falling back to antora.yml. This makes the previously unused trigger-tests dispatch hook actually useful: upstream repos can now ask the docs repo to test a specific version combination, and RC combos are testable manually today (for example redpanda_docker_repo: redpanda-unstable).

No behavior change for scheduled runs or ordinary PRs: with no overrides set, the env vars are empty and the test resolves versions from antora.yml exactly as before.

Upstream proposals enabled by this PR (not included)

  • Console GA: the console repo's existing repository-dispatch.yml can add a trigger-tests dispatch to this repo on v* tags with console_version in the payload. Caveat for the Console team: at tag-push time the release image may not be published yet, so the dispatch may belong at the end of the release pipeline instead.
  • Redpanda RC: Redpanda images build in Buildkite, so the dispatch belongs at the end of the RC build pipeline (after images publish to redpanda-unstable) with redpanda_version + redpanda_docker_repo: redpanda-unstable in the payload. A GitHub tag-push trigger would race image publication.

🤖 Generated with Claude Code

@JakeSCahill
JakeSCahill requested a review from a team as a code owner July 29, 2026 14:31
@netlify

netlify Bot commented Jul 29, 2026

Copy link
Copy Markdown

Deploy Preview for redpanda-docs-preview ready!

Name Link
🔨 Latest commit d2455f6
🔍 Latest deploy log https://app.netlify.com/projects/redpanda-docs-preview/deploys/6a72096804902b0007248944
😎 Deploy Preview https://deploy-preview-1848--redpanda-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The documentation test workflow adds optional Redpanda and Console version or Docker repository inputs, detects changes to antora.yml, exposes a versions setup output, and passes resolved values into the test job. The Redpanda Streaming quickstart now also runs when version configuration changes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Trigger as Manual or repository dispatch
  participant Setup as setup job
  participant Filter as dorny/paths-filter
  participant Tests as Run all tests job
  participant Quickstart as Redpanda Streaming quickstart
  Trigger->>Setup: Start with optional version overrides
  Setup->>Filter: Check changed paths
  Filter-->>Setup: Return versions output for antora.yml
  Setup->>Tests: Provide version-related job output
  Tests->>Quickstart: Run when versions output is true
Loading

Suggested reviewers: feediver1

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation and rationale, but it omits the template’s ticket, review deadline, page previews, and checks sections. Add the required template sections and complete them, or mark non-applicable fields explicitly.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes both primary CI changes: testing version bumps and supporting version overrides.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci-doc-test-triggers

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/test-docs.yml (1)

29-34: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Restrict the setup job to read-only permissions.

This job only checks out code and evaluates changed paths, but it currently inherits the workflow/repository default token permissions. Add an explicit contents: read permission to avoid exposing unnecessary write access.

Proposed fix
   setup:
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     outputs:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-docs.yml around lines 29 - 34, Add an explicit
read-only permissions block to the setup job, granting only contents: read.
Update the setup job configuration around its runs-on and outputs fields,
without changing the path-filtering or output behavior.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/test-docs.yml:
- Around line 29-34: Add an explicit read-only permissions block to the setup
job, granting only contents: read. Update the setup job configuration around its
runs-on and outputs fields, without changing the path-filtering or output
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dda9e6ec-7217-4fe6-a85e-e5f53b99146f

📥 Commits

Reviewing files that changed from the base of the PR and between 4e47021 and 0abc697.

📒 Files selected for processing (1)
  • .github/workflows/test-docs.yml

@JakeSCahill

Copy link
Copy Markdown
Contributor Author

@micheleRP rebased onto main as requested. The conflict was a clean union: main's kind-guide filter (from #1846) and this PR's versions filter both add independent outputs and paths, so both survive — the run-tests condition now honors quickstart/console/versions changes and the kind-guide job keeps its own trigger. YAML validated, no other changes.

@JakeSCahill
JakeSCahill force-pushed the ci-doc-test-triggers branch from 0abc697 to e6ef203 Compare August 4, 2026 15:26

@micheleRP micheleRP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs-team-standards review

Files reviewed: 1 (.github/workflows/test-docs.yml, +33/−1)
Overall assessment: The change is correct and the part most likely to be silently broken — the env var names — checks out exactly. But the PR is currently CONFLICTING and its stated premise has been overtaken by #1846, so it needs a rebase and a description touch-up before it can land.

What this PR does

Adds a versions paths filter on antora.yml so version-bump PRs run the quickstart doc test, and adds four optional workflow_dispatch inputs (redpanda_version, redpanda_docker_repo, console_version, console_docker_repo) mapped — along with the same keys from a trigger-tests client_payload — onto the env vars the test spec already honours. No behavior change when the overrides are unset.

Jira ticket alignment

No linked Jira ticket. The PR references #1846 as the fix for the underlying selector breakage and frames itself as closing the trigger gap that hid it.

Critical issues

  1. The PR cannot merge as-is: mergeable: CONFLICTING, mergeStateStatus: DIRTY. The branch has one commit from 2026-07-29 and hasn't been updated since. #1846 merged 2026-07-30 and rewrote the same file — it added the whole test-kind-guide job, added issue_body to the "Run all tests" step (which is why this diff's context lines don't match current main), and added antora.yml to the kindguide filter.

    • Fix: rebase on main and re-verify the hunks still apply where intended.
  2. The premise in the description is no longer accurate. "antora.yml is not in the paths filter" was true when written, but as of #1846 antora.yml is in the filter — under kindguide (line 33 on main). The substance of the PR still holds, because it's not in the quickstart filter, so version bumps still don't run the quickstart test. But as written, a reviewer checking main will conclude the premise is wrong.

    • Fix: reword to "antora.yml is not in the quickstart filter" (and note the kind guide already covers it).

Suggestions

  1. After the rebase, antora.yml will appear in two filters. That's harmless — dorny/paths-filter evaluates filters independently — and the new versions filter carries a comment explaining its purpose, which is the right call. Just make it a deliberate outcome of the rebase rather than a surprise: keep the dedicated versions filter (it's what gates the quickstart step and its intent is clearer) and leave kindguide alone, since removing antora.yml there would change kind-guide behavior.

  2. The payload key names are now a cross-repo API with no durable home. trigger-tests plus redpanda_version / redpanda_docker_repo / console_version / console_docker_repo will be referenced by the console repo and the Redpanda RC pipeline, but they're documented only in this workflow's env: block and this PR description. A short comment in the workflow (or a line in the testing docs) naming the contract would keep an upstream sender from guessing.

  3. The coupling to tests/setup-tests/fetch-versions-and-rpk.json is invisible from the workflow. That spec is what makes these overrides work; if someone renames a variable there, the override silently stops applying and the test quietly falls back to antora.yml with no failure. A one-line comment pointing at the spec would make the dependency discoverable.

  4. Nit: the overrides are attached only to the "Run all tests" step, not to "Test Redpanda Streaming quickstart". That's correct today (PR-triggered runs have no overrides to apply), but if anyone later wants a dispatch that exercises only the quickstart step, the env: block will need duplicating.

Impact on other files

  • redpanda-data/console — I checked .github/workflows/repository-dispatch.yml: it currently sends event-type: release and event-type: push, both to redpanda-data/console-enterprise. So the description's framing is accurate — a trigger-tests dispatch to docs would be new, and it needs a token with dispatch permission on this repo, which is usually the blocker for cross-repo dispatch. Worth confirming that before promising the Console team it's a small change.
  • Redpanda RC pipeline (Buildkite) — out of this repo entirely; the caveat about dispatching only after images publish to redpanda-unstable is well-taken and worth keeping in the ticket that tracks it, not just this PR description.
  • No .adoc files touched, so the style checklist doesn't apply and no page previews are needed.

What works well

  • All four env var names are correct, verified against tests/setup-tests/fetch-versions-and-rpk.json: REDPANDA_VERSION, REDPANDA_DOCKER_REPO, REDPANDA_CONSOLE_VERSION, CONSOLE_DOCKER_REPO. The spec's fallback is exactly as the description claims — if [ -n "$X" ]; then echo $X; else npx doc-tools get-…-version --from-antora … — so overrides take precedence and an unset value resolves from antora.yml. This is the claim most likely to be silently wrong, and it's right.
  • The inputs.* || client_payload.* chain is correct for both trigger types: inputs is null on repository_dispatch and client_payload is null on workflow_dispatch, so each event picks up its own source.
  • Input descriptions state both the format and the default source, and the redpanda-unstable example makes the RC use case immediately usable.
  • The filter comment explains why antora.yml gates a test rather than restating what the YAML does.

@micheleRP

Copy link
Copy Markdown
Contributor

Follow-up: correcting my earlier review, plus one thing to fix

Retracting my critical issue #1

My review landed 63 seconds after your force-push, so the conflict finding was already out of date when I posted it. For the record: you rebased at 15:26:03, I posted at 15:27:06. The PR is MERGEABLE now and there is no conflict to resolve. Sorry for the noise.

Critical issue #2 (the stale "not in the paths filter" premise) and suggestions 3 through 6 still apply.

One real thing to fix: the rebase dropped kind-guide coverage on version bumps

The rebase resolved the conflict by moving antora.yml out of kindguide and into the new versions filter. At e6ef203:

kindguide:
  - 'modules/deploy/pages/redpanda/kubernetes/local-guide.adoc'
  - 'modules/deploy/partials/kubernetes/**'
versions:
  - 'antora.yml'

On main, antora.yml is the third entry under kindguide, added deliberately in #1846 (its diff creates kindguide with all three paths at once). So as it stands, this PR adds quickstart coverage on version-bump PRs and silently removes kind-guide coverage from them.

Fix is one line: keep - 'antora.yml' under kindguide as well as under versions. Duplication across dorny/paths-filter filters is harmless because filters evaluate independently.

The "pinned in antora.yml" wording is inaccurate

The test does not read the versions from antora.yml. Tracing the chain:

  1. tests/setup-tests/fetch-versions-and-rpk.json:18 calls npx doc-tools get-console-version --from-antora.
  2. tools/get-console-version.js calls GetLatestConsoleVersion(octokit, 'redpanda-data', 'console'), a GitHub releases API call, and prints CONSOLE_VERSION=<latest stable release>.
  3. --from-antora does not read a version. It calls getPrereleaseFromAntora(), which only decides stable versus beta. Grepping both tools for latest-console-tag and latest-redpanda-tag returns no matches.
  4. get-redpanda-version.js behaves the same way.

Corroborating: antora.yml pins latest-console-tag: 'v3.3.1', but the test runs against whatever Console has released most recently. There is a separate command built for reading the pins (get-antora-value asciidoc.attributes.latest-console-tag) that the spec does not use.

The claim appears in seven places: the four workflow_dispatch input descriptions ("Defaults to the version pinned in antora.yml"), the new versions filter comment, the env block comment ("the test resolves versions from antora.yml as before"), and the PR description. The four input descriptions are the ones worth fixing regardless, since they render in the Actions run-workflow UI.

This also affects what the versions filter can deliver. Console 3.9's UI rework broke the test because Console published a release upstream, with no docs-repo commit to filter on, so no paths filter could have caught it pre-merge. The filter still helps in practice, because a version bump usually follows a release and the test always resolves latest, so some nightly failures become PR failures. It does not close the window: if Console releases and nobody touches antora.yml for three weeks, the nightly stays the only detector for three weeks.

If you want the stronger guarantee, a separate change could resolve the test's versions from the antora.yml pins via get-antora-value. That would make the test deterministic and would make this PR's versions filter exactly the right gate. Not a blocker here, and your override plumbing is what would keep RC testing possible afterwards.

Merge status

Nothing in the code has to change for the merge button to work. Verified: mergeable: MERGEABLE, all checks passing or skipped, and ruleset "Require one PR review" has required_approving_review_count: 1 with an empty required_status_checks list, so the skipped test-kind-guide does not block. The only requirement is one approving review.

I would fix the kindguide line before that approval, since it is a silent coverage loss that no check will catch.

…on claims

- The rebase moved antora.yml out of the kindguide filter, silently
  removing kind-guide coverage from version-bump PRs (#1846 added it
  deliberately). antora.yml now appears under both filters, which is
  fine because dorny/paths-filter filters evaluate independently.
- 'Defaults to the version pinned in antora.yml' was wrong everywhere
  it appeared: the test resolves the latest stable GitHub release at
  runtime (antora.yml only decides stable vs beta), verified against
  get-redpanda-version.js / get-console-version.js. All four input
  descriptions, the versions filter comment, and the env comment now
  state the real behavior, including what the versions filter can and
  cannot catch.
- The env comment now names the cross-repo dispatch contract
  (trigger-tests + four payload keys) and the coupling to
  tests/setup-tests/fetch-versions-and-rpk.json.
@JakeSCahill

Copy link
Copy Markdown
Contributor Author

@micheleRP both follow-up items fixed, plus your original review's remaining points:

  • kind-guide coverage restored: antora.yml is back under kindguide as well as versions — your read of the conflict was right, my union resolution gave the shared trailing line to only one side. The filter comment now states the duplication is deliberate.
  • Version-resolution wording corrected everywhere: verified your trace against get-redpanda-version.js/get-console-version.js — the docker repo defaults are redpanda (or redpanda-unstable only in beta mode with an RC present) and console, and versions resolve to the latest stable GitHub release. All four input descriptions, the versions-filter comment, the env comment, and the PR description now say what actually happens, including the honest limitation you identified: the filter narrows the nightly-only window but cannot close it, since a Console release with no docs commit has nothing to filter on.
  • Cross-repo contract + spec coupling (suggestions 4-5): the env block now names the trigger-tests payload contract and points at fetch-versions-and-rpk.json, with the step-scoping note from your nit 6.
  • Premise reworded per critical #2: "not in the quickstart filter", with the Fix all open issues: Kind guide template, stale Helm chart links, property name typo, Console consumer visibility #1846 kindguide context.

Your deterministic-pins suggestion (resolve from get-antora-value) is a good follow-up — agreed it's separate from this PR since it changes what the nightly tests too.

@JakeSCahill
JakeSCahill merged commit aa716c0 into main Aug 4, 2026
8 checks passed
@JakeSCahill
JakeSCahill deleted the ci-doc-test-triggers branch August 4, 2026 15:59
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.

2 participants