Skip to content

Publish examples to the docs Cookbook tab with per-PR previews - #7

Merged
jpshackelford merged 4 commits into
mainfrom
docs-preview-pilot
Oct 3, 2026
Merged

jpshackelford merged 4 commits into
mainfrom
docs-preview-pilot

Conversation

@jpshackelford

@jpshackelford jpshackelford commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Why

The Cookbook tab on docs.openhands.dev should be generated from this repository, not maintained as a hand-written copy (OpenHands/docs#604) that drifts from the examples. This PR adds a converter in tools/docs-render that turns each example's README.md into a docs page with Mintlify components (callouts, tabs, accordions, cards, code blocks pulled from real files). The conversion is deterministic and has no LLM step, and it fails with a file and line number on anything it doesn't understand. An example is published only once it has an example.yaml, so the other examples are unaffected until they're migrated one at a time. conversation-tags is the first, with an unchanged README.

Every pull request now gets a draft PR in OpenHands/docs and a comment with Mintlify preview links to each changed page. A docs-preview status fails if the page doesn't render or the docs checks fail. After merge, a separate cookbook-sync PR carries the change to the docs, and for now a human merges it. The job that holds the docs credential (the shared release GitHub App, limited to the docs repo with code and pull-request write access) only copies the rendered files; it never installs dependencies or runs code from the PR. How to publish and write for both GitHub and the docs site is in tools/docs-render/README.md.

Validation

  • Converter tests — 24 node --test cases cover each conversion rule and error. They also check that docs.json gets only the Cookbook tab and redirects for removed pages, that a second run changes nothing, and that hand-written files under cookbook/ are refused.
  • Preview end to end on this PR — the workflow opened Cookbook preview: OpenHands/enterprise-cookbook#7 (do not merge) docs#883 as openhands-release-bot. It waited for the Mintlify deployment and the docs checks (internal links, link-rot), then posted working preview links and set docs-preview to success.
  • Failure and update paths — a commit with a broken relative link failed docs-preview with conversation-tags/README.md:129: link "./NOTES.md" ... does not exist. Dropping that commit force-updated the same docs PR and edited the existing comment in place.
  • Not yet exercised — closing the preview PR on merge and the first cookbook-sync PR. Both run when this merges.

This PR was drafted by an AI agent on behalf of the user.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py50100% 
cli.py65395%59–60, 100
client.py1051784%56, 109, 117, 150, 160–162, 173, 203, 206–208, 210, 217–219, 221
metrics.py80298%102, 182
v0.py48394%88, 104, 141
v1.py83989%86, 90, 94, 131, 135, 155, 178, 206, 214
TOTAL3863491% 

Co-authored-by: openhands <openhands@all-hands.dev>
Adds a deterministic README-to-MDX converter (tools/docs-render), a docs
preview workflow that opens a draft OpenHands/docs PR per pull request and
reports the Mintlify preview link back, and a publish workflow that keeps a
single cookbook-sync PR in OpenHands/docs up to date. Removes the credential
probe.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Docs preview

✅ Docs preview is ready: https://allhandsai-cookbook-preview-pr-7.mintlify.site

Page Change
/cookbook/conversation-tags added
/cookbook added

Docs PR: OpenHands/docs#883 (draft preview; never merged, closes with this PR).
Rendered from 8c19238. After merge, a separate sync PR updates the docs.

openhands-release-bot Bot added a commit to OpenHands/docs that referenced this pull request Oct 3, 2026
Preview of the Cookbook pages produced by OpenHands/enterprise-cookbook#7 (Docs preview pilot: render examples into the OpenHands docs Cookbook), rendered from OpenHands/enterprise-cookbook@c818d71.

**Do not merge.** This draft exists only to get a Mintlify preview. It is updated on every push to the source PR and closed when that PR closes. Merged changes reach the docs through a separate `cookbook-sync` PR.

_Opened automatically by the docs-preview workflow in OpenHands/enterprise-cookbook._
Only adds example.yaml; the README is unchanged, to show a plain README renders
acceptably.

Co-authored-by: openhands <openhands@all-hands.dev>
openhands-release-bot Bot added a commit to OpenHands/docs that referenced this pull request Oct 3, 2026
Preview of the Cookbook pages produced by OpenHands/enterprise-cookbook#7 (Docs preview pilot: render examples into the OpenHands docs Cookbook), rendered from OpenHands/enterprise-cookbook@8c19238.

**Do not merge.** This draft exists only to get a Mintlify preview. It is updated on every push to the source PR and closed when that PR closes. Merged changes reach the docs through a separate `cookbook-sync` PR.

_Opened automatically by the docs-preview workflow in OpenHands/enterprise-cookbook._
@jpshackelford jpshackelford changed the title Docs preview pilot: render examples into the OpenHands docs Cookbook Publish examples to the docs Cookbook tab with per-PR previews Oct 3, 2026
@jpshackelford
jpshackelford marked this pull request as ready for review October 3, 2026 18:30
@jpshackelford
jpshackelford merged commit d3ac95e into main Oct 3, 2026
8 checks passed
@jpshackelford
jpshackelford deleted the docs-preview-pilot branch October 3, 2026 18:30

@github-actions github-actions 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.

Excellent implementation of the docs preview and publishing system. All tests pass, security separation is solid, and the converter is deterministic with comprehensive error handling.

[RISK ASSESSMENT]

  • Complexity: MEDIUM - Multi-component system (Node converter, Python orchestrator, GitHub workflows)
  • Blast radius: LOW - Only affects docs preview; merges are manual during pilot
  • Security posture: LOW - Strong separation between untrusted render (no secrets) and trusted publish (secrets, artifact-only)
  • Verdict: APPROVE - Production-ready implementation with excellent test coverage (24 tests)

Key architectural insight: The two-job separation (render without secrets, preview with secrets copying only pre-rendered artifacts) is the correct pattern for processing untrusted PR content while maintaining write access to external repositories.


Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/enterprise-cookbook/actions/runs/37144425266

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