[product-manager-impersonator] Render alternate workflow examples in docs

Open Beginner friendly
#1,457 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
documentation

Research direction

Start in docs/hooks.py, especially _generate_page and the lines that read README.md and example.yml and append the example section. Review the existing _generate_page coverage in tests/test_docs_hooks.py, then run that test while checking a temporary workflow containing example.yml and example-chained.yml. Done means both workflow snippets and their sections appear on the generated page.

Written by the indexing model from the issue text.

Description

Feature Idea

Summary: Update the generated workflow docs so pages automatically include alternate example files such as example-chained.yml when a workflow ships them, instead of showing only the detector-only example.yml.

Why a Customer Would Want This

Maintainers evaluating scheduled detectors often want the fully autonomous detector-to-fixer path, but the generated workflow pages currently embed only the default example. When a workflow already ships a chained example, users should be able to copy it directly from the docs page without jumping back to the repository tree or piecing the pattern together from separate chaining docs.

Rough Implementation Sketch

  • Extend docs/hooks.py to discover optional example variants next to example.yml (starting with example-chained.yml).
  • Render additional sections such as ## Chained Example Workflow after the existing ## Example Workflow block.
  • Add a focused tests/test_docs_hooks.py case that creates a temporary workflow directory with both example.yml and example-chained.yml and asserts both snippets are present.
  • Keep the first iteration narrow to already-existing files; no new workflow templates are required.

Why It Won't Be That Hard

The docs generator already centralizes workflow page creation in one helper: docs/hooks.py reads README.md and example.yml in _generate_page and appends a single YAML block. Adding optional sibling example rendering is a small extension to that helper plus one existing test module.

Evidence

  • docs/hooks.py:81-84 reads only README.md and example.yml for each generated workflow page.
  • docs/hooks.py:114 appends a single ## Example Workflow YAML block.
  • Existing tests already cover _generate_page behavior in tests/test_docs_hooks.py:22-60, so there is a natural place for coverage.
  • The repository already ships chained examples for five detector workflows: gh-agent-workflows/bug-hunter/example-chained.yml, gh-agent-workflows/code-complexity-detector/example-chained.yml, gh-agent-workflows/code-duplication-detector/example-chained.yml, gh-agent-workflows/newbie-contributor-patrol/example-chained.yml, and gh-agent-workflows/test-coverage-detector/example-chained.yml.
  • docs/workflows/gh-agent-workflows/bugs.md:19-27 already advertises a chained install path, but the generator still only embeds example.yml on generated pages.

Duplicate check: this is distinct from #1441 (new comment-only chained templates), #887 (permissions in chaining quick-start), #1201 (homepage Bug Hunter setup path), and #849 (Text Auditor chained setup visibility). This proposal is the small reusable docs-generator feature that surfaces alternate examples that already exist.


What is this? | From workflow: Trigger Product Manager Impersonator

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Dominant language
Python
Stars
11
Forks
16
Avg merge
11h 16m
Merged PRs (30d)
29

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elastic/ai-github-actions

All issues in elastic/ai-github-actions

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.