elastic / elastic/ai-github-actions
Parse MkDocs nav with YAML
- Dominant language
- Python
- Stars
- 11
- Forks
- 16
- Avg merge
- 22h 9m
- Merged PRs (30d)
- 31
Description
> [!CAUTION]
> Protected files were modified in this change.
> This pull request is in `request_review` mode and requires explicit human scrutiny before merge.
>
> Protected files: `pyproject.toml`, `uv.lock`
## Summary
- Parse `mkdocs.yml` nav entries with `yaml.safe_load()` and walk the parsed nav tree before collecting workflow slugs.
- Keep direct `python3 scripts/check-nav-catalog.py` compatible when PyYAML is unavailable by stripping YAML line comments in the fallback path.
- Add regression coverage for inline YAML comments containing workflow paths.
Closes \#1460.
## Testing
- `python3 scripts/check-nav-catalog.py`
- `UV_CACHE_DIR=/tmp/gh-aw/agent/uv-cache UV_LINK_MODE=copy make test`
---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Trigger Framework Best Practices](https://github.com/elastic/ai-github-actions/actions/runs/28448713032)
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
---
> [!NOTE]
> This was originally intended as a pull request, but the git push operation failed.
>
> **Workflow Run:** [View run details and download bundle artifact](https://github.com/elastic/ai-github-actions/actions/runs/28448713032)
>
> The bundle file is available in the `agent` artifact in the workflow run linked above.
To create a pull request with the changes:
```sh
# Download the artifact from the workflow run
gh run download 28448713032 -n agent -D /tmp/agent-28448713032
# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-28448713032/aw-fix-nav-catalog-yaml-parsing.bundle refs/heads/fix-nav-catalog-yaml-parsing:refs/bundles/create-pr-fix-nav-catalog-yaml-parsing-77992e4ff6b64390-6fb12244
git update-ref refs/heads/fix-nav-catalog-yaml-parsing-77992e4ff6b64390 refs/bundles/create-pr-fix-nav-catalog-yaml-parsing-77992e4ff6b64390-6fb12244
git checkout fix-nav-catalog-yaml-parsing-77992e4ff6b64390
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d refs/bundles/create-pr-fix-nav-catalog-yaml-parsing-77992e4ff6b64390-6fb12244
# Push the branch to origin
git push origin fix-nav-catalog-yaml-parsing-77992e4ff6b64390
# Create the pull request
gh pr create --title 'Parse MkDocs nav with YAML' --base main --head fix-nav-catalog-yaml-parsing-77992e4ff6b64390 --repo elastic/ai-github-actions
```
Contributor guide
Research direction
Start with scripts/check-nav-catalog.py and inspect how it currently reads mkdocs.yml and collects workflow slugs. Run python3 scripts/check-nav-catalog.py and the listed make test command; done means the parsed nav handles inline YAML comments, the PyYAML-unavailable path remains compatible, and regression coverage passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100