Skip to content

ci(docs): generate the Kubernetes API reference at publish time - #14122

Open
dagil-nvidia wants to merge 3 commits into
mainfrom
dagil-nvidia/publish-time-kubernetes-api-reference
Open

ci(docs): generate the Kubernetes API reference at publish time#14122
dagil-nvidia wants to merge 3 commits into
mainfrom
dagil-nvidia/publish-time-kubernetes-api-reference

Conversation

@dagil-nvidia

@dagil-nvidia dagil-nvidia commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

The docs publish job ran gen_kubernetes_api.py --check before its sync steps. A stale
committed page therefore failed that step, which skipped both the pages-dev sync and
fern generate --docs. The site stopped updating and nothing announced it.

The per-PR gate in pre-merge.yml is --since-scoped, which is correct: a branch should
only fail for drift it caused. But that leaves merge skew uncovered. A PR that regenerates
against main at T1 merges at T3 after a second PR edited the generator's source at T2.
Neither PR is at fault, main is stale, and the next publish is the thing that breaks.

This regenerates instead of checking. The generator's only input is the docs-owned
api-reference-k8s.md present in the same checkout, and generation already precedes the
pages-dev rsync, so the fresh output publishes. That is the pattern
#13556 established for the Python and Rust
references; the Kubernetes page differs only in staying committed, which it still does
because reviewers read it in the PR diff.

The --since-scoped pre-merge gate is unchanged and still keeps the committed copy honest
for review. There is exactly one publish-blocking invocation in the repository, so this is
the only site that needed changing; the release-version job does not call this generator.

Validation

  • Corrupted the committed full-api-reference.mdx, then confirmed the sequence end to end:
    --check fails (reproducing the publish block), write mode restores byte-identical
    output, and --check is clean again.
  • gen_kubernetes_api.py --check clean on a pristine tree.
  • .github/workflows/fern-docs.yml parses as YAML.
  • scripts/check_action_pins.py passes.
  • Full pre-commit suite green on the commit.

Summary by CodeRabbit

  • Documentation
    • Kubernetes API references are now regenerated and synchronized automatically before publication.
    • Documentation publishing is less likely to be blocked by outdated generated references.

The publish job ran `gen_kubernetes_api.py --check` before the sync steps,
so a stale committed page failed the step and skipped both the sync and
`fern generate --docs`. The site stopped updating and nothing said so.

The per-PR gate is `--since`-scoped, which is correct: a branch should only
fail for drift it caused. But that leaves merge skew uncovered. A PR that
regenerates against main at T1 merges at T3 after a second PR edited the
generator's source at T2, and neither PR is at fault. Main is stale and the
next publish is the thing that breaks.

Regenerate instead of checking. The generator's only input is the
docs-owned `api-reference-k8s.md` in the same checkout, and generation
already precedes the `pages-dev` rsync, so the fresh output publishes. This
is the pattern #13556 established for the Python and Rust references; the
Kubernetes page differs only in staying committed, which it still does.

The scoped pre-merge gate is unchanged and still keeps the committed copy
honest for reviewers.

Validation:
- Corrupted the committed page: `--check` fails, write mode restores
  byte-identical output, `--check` is clean again.
- `gen_kubernetes_api.py --check` clean on a pristine tree.
- fern-docs.yml parses; check_action_pins.py passes.

Signed-off-by: Dan Gil <dagil@nvidia.com>
@dagil-nvidia
dagil-nvidia requested review from a team as code owners September 1, 2026 18:47
@github-actions github-actions Bot added the ci Issues/PRs that reference CI build/test label Sep 1, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T18:49:46.417966Z 009de8e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 009de8e23c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/fern-docs.yml
Comment thread .github/workflows/fern-docs.yml Outdated
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2a6d8099-7508-4c5c-aa04-c5867427501d

📥 Commits

Reviewing files that changed from the base of the PR and between eb300f6 and 009de8e.

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

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

The documentation workflow now generates Kubernetes API references in write mode. It includes the regenerated output in the synchronization and publication flow.

Changes

Kubernetes documentation publication

Layer / File(s) Summary
Write and publish Kubernetes references
.github/workflows/fern-docs.yml
The workflow removes --check, generates Kubernetes references in write mode, and sends the regenerated output through synchronization and publication.

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

Merge Risk: ⚪ Minimal · up to 009de

The publish workflow now regenerates the Kubernetes API reference before synchronization, preventing stale committed output from blocking documentation updates; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem, implementation, scope, and validation. However, it does not use the required Overview, Details, or Where should the reviewer start sections, and it omits the requ… Add the required template sections. Include an Overview, Details, and specific reviewer starting points. Complete Related Issues by adding either the linked issue reference or the confirmation checkbox for no related issue, then remove the …
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: generating the Kubernetes API reference during the documentation publish workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Description check

Explanation

The description explains the problem, implementation, scope, and validation. However, it does not use the required Overview, Details, or Where should the reviewer start sections, and it omits the required Related Issues selection.

Resolution

Add the required template sections. Include an Overview, Details, and specific reviewer starting points. Complete Related Issues by adding either the linked issue reference or the confirmation checkbox for no related issue, then remove the unused alternative path.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI

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

@dagil-nvidia
dagil-nvidia enabled auto-merge (squash) September 1, 2026 20:43
Review caught that the first version removed a property the repository
deliberately protects. The Kubernetes page is committed BECAUSE reviewers read
it in the PR diff, and regenerating at publish meant the site could ship bytes
that differed from the ones approved, with no signal. A regression test
asserted the old `--check` for exactly that reason.

Keep both properties instead of trading one for the other:

- Publish regenerates, so merge skew on main can no longer fail the step and
  silently skip the sync and publish steps that follow it. The site is always
  current.
- A probe records whether the committed copy differed, and a gate at the very
  end of the job fails the run when it did. The mismatch stays loud and
  attributable; it just no longer freezes docs.nvidia.com to report itself.

The regression test now asserts the new contract against the step's parsed
`run` body rather than the workflow text, so an assertion cannot pass on a
comment that happens to name the same command.

Validation:
- Reverting the invocation to `--check` fails the test.
- Deleting the post-publish gate fails the test.
- The full test_api_reference_regressions.py file passes, 38 tests.
- fern-docs.yml parses; the gate is the last step of the job and sorts after
  Publish Docs.

Signed-off-by: Dan Gil <dagil@nvidia.com>
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Sep 1, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 1, 2026
@dagil-nvidia

Copy link
Copy Markdown
Collaborator Author

/ok to test b2cdf31

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Signed-off-by: Dan Gil <dagil@nvidia.com>
@dagil-nvidia

Copy link
Copy Markdown
Collaborator Author

/ok to test a00428f

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

Labels

actions ci Issues/PRs that reference CI build/test documentation Improvements or additions to documentation size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant