-
Notifications
You must be signed in to change notification settings - Fork 3
Add YAML file support to sync_code_blocks.py #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Remove unsupported auto-sync code block for workflow.yml file. The sync script only supports Python files, not YAML files. The workflow file is already properly linked in the Related Files section. Co-authored-by: openhands <[email protected]>
…orkflow - Extended sync_code_blocks.py to support both Python (.py) and YAML (.yml/.yaml) files - Updated extract_code_blocks() to handle multiple file types with language detection - Modified update_doc_file() to preserve language-specific code block formatting - Restored and populated YAML code block in pr-review.mdx with workflow content - All existing Python code blocks remain fully functional Co-authored-by: openhands <[email protected]>
| - name: Install OpenHands dependencies | ||
| run: | | ||
| # Install OpenHands SDK and tools from git repository | ||
| uv pip install --system "openhands-sdk @ git+https://github.com/OpenHands/agent-sdk.git@main#subdirectory=openhands-sdk" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we say 1.0.0 ? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or install from pypi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually the example workflow in the SDK repo, not this repo.
cc @simonrosenberg - maybe we do want to point it to latest pypi wheel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sure 😅
|
@OpenHands What do you think about the PR reviewer workflow requesting "openhands-agent", is there anything else the user needs to do to make it work on their own repos? |
|
I'm on it! enyst can track my progress at all-hands.dev |
|
Summary of my response to the question
Recommendation
|
…s; recommend label trigger as universal option Co-authored-by: openhands <[email protected]>
…in OpenHands org repos; advise collaborators/label/use-own-handle for external repos Co-authored-by: openhands <[email protected]>
|
|
||
| <Note> | ||
| The reference workflow triggers on either the "review-this" label or when the openhands-agent account is requested as a reviewer. In OpenHands organization repositories, openhands-agent has access, so this works as-is. In your own repositories, requesting openhands-agent will only work if that account is added as a collaborator or is part of a team with access. If you don't plan to grant access, use the label trigger instead, or change the condition to a reviewer handle that exists in your repo. | ||
| </Note> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct to me (right?), maybe a bit too verbose, but idk, readable.
WDYT, should we keep it? @xingyaoww @simonrosenberg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems useful info to keep?
enyst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'm very happy to see openhands-agent documented and working!
Summary of changes
Problem
The
pr-review.mdxfile had an empty YAML code block that wasn't rendering properly. Investigation revealed that the auto-sync script (/docs/.github/scripts/sync_code_blocks.py) only supported Python files (.py), not YAML files (.yml).Solution
Extended the sync script to support YAML files:
Updated
sync_code_blocks.py:extract_code_blocks()to detect both Python and YAML code blocksRestored
pr-review.mdx:examples/03_github_workflows/02_pr_review/workflow.ymlTesting
.ymland.yamlextensionsImpact
This enables auto-syncing of GitHub workflow examples and other YAML configuration files throughout the documentation, ensuring they stay up-to-date with the source repository.