Skip to content

docs: add versioned documentation with mike - #233

Open
ibm-adarsh wants to merge 3 commits into
kubernetes-sigs:mainfrom
ibm-adarsh:docs/issue-222-versioned-docs
Open

docs: add versioned documentation with mike#233
ibm-adarsh wants to merge 3 commits into
kubernetes-sigs:mainfrom
ibm-adarsh:docs/issue-222-versioned-docs

Conversation

@ibm-adarsh

@ibm-adarsh ibm-adarsh commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add versioned documentation using mike: latest (default, aligned with releases/latest) and main (development preview)
  • Add .github/workflows/docs.yaml to lint docs on PRs, deploy main preview on push, and deploy release docs on GitHub release publish
  • Point Netlify publishing at the pre-built gh-pages branch (with one-time Netlify config change documented in site-src/README.md)
  • Extend release issue templates with a docs deployment verification step

Closes #222

Post-merge migration sequence

Complete these steps in order — merge alone does not finish the migration:

  1. Merge this PR to main
  2. Bootstrap latest: run Actions → Docs → Deploy docs (manual) with v0.1.0 (or the current release tag)
  3. Switch Netlify production branch to gh-pages (build command empty, publish /)

Until step 3, main-branch production Netlify builds fail by design (netlify.toml intentional exit 1); the last good production deploy stays live.

Test plan

  • Docs workflow Lint docs job passes on this PR
  • After merge: run Docs → Deploy docs (manual) workflow for v0.1.0 to bootstrap the latest version on gh-pages
  • Update Netlify production branch to gh-pages (build command empty, publish /)
  • Verify https://mcp-lifecycle-operator.sigs.k8s.io/ shows version selector with latest and main
  • Publish a test release and confirm latest updates automatically

Align the public docs site with release artifacts by publishing versioned
docs to gh-pages: latest release as default, main as a preview. Adds
GitHub Actions deploy workflow, Netlify gh-pages publishing config, and
release checklist updates for future releases.

Fixes kubernetes-sigs#222
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 9, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ibm-adarsh
Once this PR has been reviewed and has the lgtm label, please assign arangogutierrez for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
k8s-ci-robot requested review from matzew and mikebrow June 9, 2026 09:45
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ibm-adarsh, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f94306f2-6cfa-49a8-81a6-06489ca6c72d

📥 Commits

Reviewing files that changed from the base of the PR and between ed13301 and fe0d351.

📒 Files selected for processing (13)
  • .github/ISSUE_TEMPLATE/new-patch-release.md
  • .github/ISSUE_TEMPLATE/new-release.md
  • .github/workflows/docs.yaml
  • Makefile
  • hack/mkdocs/deploy.sh
  • hack/mkdocs/gh-pages-netlify.toml
  • hack/mkdocs/image/requirements.txt
  • mkdocs.yml
  • netlify.toml
  • site-src/README.md
  • site-src/guides/index.md
  • site-src/guides/quickstart.md
  • site-src/introduction.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 9, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @ibm-adarsh. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 9, 2026
@ibm-adarsh ibm-adarsh changed the title docs: add versioned documentation with mike [WIP] docs: add versioned documentation with mike Jun 9, 2026
Exclude site-src/README.md from the built site to avoid index.md conflict
under --strict, fix API reference links, and allow deploy-preview builds
while production remains on gh-pages.
@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy Preview for mcp-lifecycle-operator failed. Why did it fail? →

Name Link
🔨 Latest commit 4608738
🔍 Latest deploy log https://app.netlify.com/projects/mcp-lifecycle-operator/deploys/6a27e0a6387e850008c54bc1

@ibm-adarsh

Copy link
Copy Markdown
Contributor Author

The skipped jobs are expected behavior. This workflow has four jobs, each gated by a specific event:

  • Lint docs → runs on pull_request
  • Deploy main preview → runs on push
  • Deploy release docs → runs on release
  • Deploy docs (manual) → runs on workflow_dispatch

Since this run was triggered by a PR (pull_request), only Lint docs executes. The deploy jobs do not meet their if conditions, so GitHub marks them as Skipped, which is normal and not a failure.

This is intentional: deploy jobs publish documentation to gh-pages and require write access, so they should only run after merge, on a release, or when manually triggered. PRs are validated through the docs build and the Netlify preview instead.

@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy Preview for mcp-lifecycle-operator ready!

Name Link
🔨 Latest commit fe0d351
🔍 Latest deploy log https://app.netlify.com/projects/mcp-lifecycle-operator/deploys/6a5725f4d4317c000890d50b
😎 Deploy Preview https://deploy-preview-233--mcp-lifecycle-operator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@ArangoGutierrez ArangoGutierrez 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.

WIP is in good shape — actions are SHA-pinned and the deploy jobs use least-privilege contents:write. Two gh-pages publishing concerns worth hardening before this graduates from draft.

  1. The three deploy jobs (deploy-main on push, deploy-release on release, deploy-manual) all run mike deploy --push against gh-pages, but there's no concurrency control. A merge to main landing during a release publish has both jobs commit and push gh-pages at once, giving a non-fast-forward push failure or a clobbered version. Add a workflow-level concurrency group (e.g. group: docs-deploy-gh-pages, cancel-in-progress: false). (.github/workflows/docs.yaml:32)
  2. This switches the live working tree to gh-pages mid-script. make api-ref-docs on line 56 may leave tracked docs modified, so under set -e the checkout can abort the run after mike has already pushed. Also git fetch origin gh-pages only advances the remote-tracking ref, so the later git push origin gh-pages isn't reconciled with a concurrent update and can fail non-fast-forward. Consider syncing netlify.toml from a dedicated clean clone/worktree, or git checkout -B gh-pages origin/gh-pages after stashing generated files. (hack/mkdocs/deploy.sh:82)

type: boolean
default: true

permissions:

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.

The three deploy jobs (deploy-main on push, deploy-release on release, deploy-manual) all run mike deploy --push against gh-pages, but there's no concurrency control. A merge to main landing during a release publish has both jobs commit and push gh-pages at once, giving a non-fast-forward push failure or a clobbered version. Add a workflow-level concurrency group (e.g. group: docs-deploy-gh-pages, cancel-in-progress: false).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this — great point about overlapping release and main deploys racing on gh-pages.

Addressed in fe0d351: added a workflow-level concurrency group that serializes deploy runs (docs-deploy-gh-pages) while keeping PR lint runs on their own per-PR group so doc validation isn't blocked by deploys.

Happy to adjust if you'd prefer a separate deploy-only workflow instead.

Comment thread hack/mkdocs/deploy.sh Outdated

echo "Ensuring Netlify configuration on gh-pages..."
git fetch origin gh-pages
git checkout gh-pages

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.

This switches the live working tree to gh-pages mid-script. make api-ref-docs on line 56 may leave tracked docs modified, so under set -e the checkout can abort the run after mike has already pushed. Also git fetch origin gh-pages only advances the remote-tracking ref, so the later git push origin gh-pages isn't reconciled with a concurrent update and can fail non-fast-forward. Consider syncing netlify.toml from a dedicated clean clone/worktree, or git checkout -B gh-pages origin/gh-pages after stashing generated files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the detailed review on this — really helpful.

Updated in fe0d351: the Netlify config sync now uses a dedicated git worktree checked out from origin/gh-pages instead of switching the live working tree. That avoids disturbing the source checkout after mike deploy, and combined with the concurrency group, reduces the non-fast-forward push risk you flagged.

Appreciate the correction on the gitignored reference/index.md — that clarified which part of the concern still applied.

@ArangoGutierrez ArangoGutierrez 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.

This is the right shape for #222: mike-versioned docs with latest as the default (tracking release tags) and main as a preview matches the stated preference, and the release checklist updates close the process gap. The strict docs build passes locally and the workflow is well-scoped (SHA-pinned actions, least-privilege permissions, fetch-depth 0). Two things to harden before this graduates from draft: add a workflow-level concurrency group so the gh-pages deploy jobs serialize (they currently race), and document the merge -> bootstrap -> switch-Netlify ordering, since the intentional exit 1 in netlify.toml means merge alone doesn't complete the migration. One correction to my earlier review: the deploy.sh dirty-tree concern doesn't apply (the generated reference doc is gitignored), but the non-fast-forward push in that same block is real and folds into the concurrency fix. With concurrency added and the manual switch sequenced, this is good to move forward.

type: boolean
default: true

permissions:

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.

Consider a workflow-level concurrency group so the deploy jobs can't push gh-pages at the same time:

concurrency:
  group: docs-deploy-gh-pages
  cancel-in-progress: false

A release publish overlapping a main push (each doing mike deploy --push, plus the set-default and netlify.toml pushes) can otherwise fail non-fast-forward or clobber a version.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed — implemented in fe0d351 with the same docs-deploy-gh-pages concurrency group (cancel-in-progress: false). Thanks for following up on this.

- "crd-ref-docs.yaml"
- "api/v1alpha1/**"
- ".github/workflows/docs.yaml"
push:

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.

The push trigger has no paths: filter, so every merge to main redeploys the main preview and commits to gh-pages even for unrelated changes. Mirroring the pull_request paths here would cut noise and shrink the concurrency window.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good call — added the same paths filter to the push trigger (via YAML anchor shared with pull_request) in fe0d351, so unrelated merges to main no longer redeploy the preview or commit to gh-pages. Thanks for the suggestion.

Comment thread netlify.toml
# intentionally. PR deploy previews still build from the PR branch.
[build]
publish = "site"
command = "echo 'Docs are published from gh-pages by GitHub Actions. Point Netlify production branch to gh-pages. See site-src/README.md.' && exit 1"

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.

Nice forcing function. Worth spelling out the required order in the PR body so an approver doesn't half-migrate: merge -> run the manual Docs workflow to bootstrap latest on gh-pages -> switch the Netlify production branch to gh-pages. Until the switch, main production builds fail here by design (last good deploy stays live).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Great idea — documented the required order in the PR body, netlify.toml, and site-src/README.md (fe0d351):

  1. Merge → 2. Manual Docs workflow to bootstrap latest → 3. Switch Netlify production branch to gh-pages

Thanks for making sure approvers have a clear sequence and don't half-migrate.

Comment thread hack/mkdocs/deploy.sh Outdated

echo "Ensuring Netlify configuration on gh-pages..."
git fetch origin gh-pages
git checkout gh-pages

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.

One correction to the earlier review: site-src/reference/index.md is gitignored, so make api-ref-docs leaves no tracked changes and this git checkout gh-pages won't abort on that. The remaining risk is the git push origin gh-pages below racing a concurrent deploy (the git fetch only moves the remote-tracking ref). Writing netlify.toml from a dedicated clone/worktree instead of switching the live tree, plus the concurrency group, would make this robust.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the correction on the gitignored generated file — that helped narrow the fix.

In fe0d351, the remaining push race is addressed with the concurrency group plus writing netlify.toml from a dedicated git worktree on origin/gh-pages rather than checking out gh-pages in the live tree. Open to exploring a fully separate clone if you'd prefer that approach.

@ArangoGutierrez

Copy link
Copy Markdown
Contributor

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 13, 2026
Serialize gh-pages deploys with a concurrency group, limit main preview
deploys to docs-related paths, sync netlify.toml via a git worktree, and
document the merge -> bootstrap -> Netlify switch migration sequence.
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ibm-adarsh
Once this PR has been reviewed and has the lgtm label, please assign arangogutierrez for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ibm-adarsh

Copy link
Copy Markdown
Contributor Author

Thanks @ArangoGutierrez for the thorough review — really appreciate you taking the time to walk through the gh-pages deploy edge cases and the migration sequencing. All feedback has been addressed in fe0d351:

  • Concurrency group to serialize gh-pages deploys (release / main / manual)
  • paths filter on push so unrelated merges don't redeploy the main preview
  • git worktree for Netlify config sync instead of switching the live checkout
  • Migration sequence documented in the PR body, netlify.toml, and site-src/README.md

I've replied inline on each thread with details. Happy to explore further refinements — e.g. a separate deploy-only workflow — if you think that would be cleaner. Planning to drop the [WIP] prefix once CI is green on this commit.

@ibm-adarsh ibm-adarsh changed the title [WIP] docs: add versioned documentation with mike docs: add versioned documentation with mike Jul 15, 2026
@ibm-adarsh

ibm-adarsh commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

/hold cancel

removing WIP and ready for review.

@ibm-adarsh
ibm-adarsh marked this pull request as ready for review July 15, 2026 06:30
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 15, 2026
@kubernetes-prow
kubernetes-prow Bot requested a review from soltysh July 15, 2026 06:30
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@7214252). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #233   +/-   ##
=======================================
  Coverage        ?   73.92%           
=======================================
  Files           ?       15           
  Lines           ?     1822           
  Branches        ?        0           
=======================================
  Hits            ?     1347           
  Misses          ?      432           
  Partials        ?       43           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matzew

matzew commented Sep 9, 2026

Copy link
Copy Markdown
Member

@ibm-adarsh sorry for the late response - but should this be updated ?

@ibm-adarsh

Copy link
Copy Markdown
Contributor Author

@ibm-adarsh sorry for the late response - but should this be updated ?

Sure @matzew , Will start looking into it again. Thanks for the reminder.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs site tracks main while operator installs use latest release — align deployment strategy?

4 participants