Skip to content

Commit 1e6b2f0

Browse files
committed
Merge branch 'codex/review-fix-877' into codex/review-fix-878
2 parents d0bcd90 + 6ae05e5 commit 1e6b2f0

55 files changed

Lines changed: 7181 additions & 8 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/scripts/sync_code_blocks.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,17 @@
2020
from pathlib import Path
2121

2222

23+
# Generated from OpenHands/enterprise-cookbook, whose code-block paths are
24+
# relative to each example, not to software-agent-sdk.
25+
EXCLUDED_DIRS = {"cookbook"}
26+
27+
2328
def find_mdx_files(docs_path: Path) -> list[Path]:
2429
"""Find all MDX files in the docs directory."""
2530
mdx_files: list[Path] = []
26-
for root, _, files in os.walk(docs_path):
31+
for root, dirs, files in os.walk(docs_path):
32+
if Path(root) == docs_path:
33+
dirs[:] = [d for d in dirs if d not in EXCLUDED_DIRS]
2734
for file in files:
2835
if file.endswith(".mdx"):
2936
mdx_files.append(Path(root) / file)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Cookbook is generated
2+
3+
# Everything under cookbook/ is generated from OpenHands/enterprise-cookbook by its
4+
# docs-preview and docs-publish workflows, which push only cookbook-preview/* and
5+
# cookbook-sync branches. Any other change would be overwritten by the next sync.
6+
on:
7+
pull_request:
8+
paths:
9+
- 'cookbook/**'
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
guard:
16+
name: Cookbook pages come from enterprise-cookbook
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Allow only the enterprise-cookbook sync branches
20+
env:
21+
HEAD_REF: ${{ github.head_ref }}
22+
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
23+
run: |
24+
if [ "$HEAD_REPO" = "$GITHUB_REPOSITORY" ]; then
25+
case "$HEAD_REF" in
26+
cookbook-sync|cookbook-preview/*) echo "Generated update from OpenHands/enterprise-cookbook."; exit 0 ;;
27+
esac
28+
fi
29+
echo "::error::Pages under cookbook/ are generated from OpenHands/enterprise-cookbook. Change the example's README.md or example.yaml there instead: https://github.com/OpenHands/enterprise-cookbook/tree/main/tools/docs-render"
30+
exit 1

‎AGENTS.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,18 @@ Workflow: `.github/workflows/sync-agent-sdk-openapi.yml`
156156
- Runs the agent-server OpenAPI generator
157157
- Updates `openapi/agent-sdk.json` via an automated PR
158158

159+
### 4) Cookbook tab generated from `OpenHands/enterprise-cookbook`
160+
161+
Every page under `cookbook/` and the `Cookbook` tab in `docs.json` are generated from example READMEs in
162+
`OpenHands/enterprise-cookbook` by its `tools/docs-render` converter. **Do not edit them here**; change the
163+
example's `README.md` or `example.yaml` in that repository.
164+
165+
- Each enterprise-cookbook PR gets a draft `cookbook-preview/pr-<N>` PR here for its Mintlify preview. These
166+
are never merged and close with the source PR.
167+
- Merged changes arrive in a single `cookbook-sync` PR, opened by `openhands-release-bot` and refreshed nightly.
168+
- `.github/workflows/cookbook-generated.yml` fails PRs from any other branch that touch `cookbook/`, and
169+
`sync_code_blocks.py` skips `cookbook/` because its code-block paths are relative to each example.
170+
159171
## Docs writing conventions
160172

161173
- Most pages are `.mdx` with frontmatter:

0 commit comments

Comments
 (0)