ci: add docs-sync workflow to open PRs against dojoengine/book#3405
ci: add docs-sync workflow to open PRs against dojoengine/book#3405kronosapiens wants to merge 1 commit intomainfrom
Conversation
|
Ohayo, sensei! 👋 WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
80894f3 to
bbfd3e3
Compare
bbfd3e3 to
77fddb2
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/docs-sync.yml:
- Line 17: The reusable workflow reference "uses:
dojoengine/book/.github/workflows/docs-sync.yml@main" points at a workflow that
doesn't exist yet and will cause dispatch to fail; either keep this PR blocked
until the companion workflow in dojoengine/book is merged to main, or change the
ref in that uses string to a stable existing ref (e.g., a commit SHA or
tag/branch that already contains the docs-sync workflow) so the action resolves
successfully; update the uses line accordingly and ensure the chosen ref indeed
contains .github/workflows/docs-sync.yml before pushing.
- Line 35: Update the reusable workflow reference and remove broad secret
inheritance: replace the invalid call to
"dojoengine/book/.github/workflows/docs-sync.yml@main" with the correct existing
workflow file in that repo (e.g.,
"dojoengine/book/.github/workflows/defrag-docs.yaml@main" or the appropriate
filename you confirm) and then change the reusable workflow invocation to stop
using "secrets: inherit" — explicitly map only the required secrets (e.g.,
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}, DOJO_API_KEY: ${{
secrets.DOJO_API_KEY }}, etc.) in the workflow call so the job only receives
least-privilege secrets.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ff140295-8bb1-4879-ab1d-f992897d5600
📒 Files selected for processing (1)
.github/workflows/docs-sync.yml
Replaces the disabled docs-sync workflow (trigger was branches: [disabled-at-the-moment]) with the current cartridge-gg/controller template. On each merged PR to main (and on manual workflow_dispatch), Claude analyzes the diff and, if user-facing behavior changed, opens an auto-merging PR to dojoengine/book with targeted docs updates. Requires repository secrets: CREATE_PR_TOKEN, ANTHROPIC_API_KEY.
77fddb2 to
b79a07a
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/docs-sync.yml:
- Around line 29-32: The YAML block under canonical-desc contains extra leading
spaces on the two bullet lines causing a preserved hanging indent; edit the
canonical-desc block so the two list lines start at the same column as the first
description line (remove the ~20 extra spaces before "-
docs-repo/docs/pages/framework/..." and "-
docs-repo/docs/pages/toolchain/sozo/..."), ensuring the block scalar preserves
the intended alignment when consumed by the downstream prompt processor; verify
the resulting indentation matches the line with "The Dojo framework..." so
rendering is consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a11f331c-18ed-4255-9c41-101d82bf44af
📒 Files selected for processing (1)
.github/workflows/docs-sync.yml
| canonical-desc: | | ||
| The Dojo framework and sozo CLI are documented in two sections of dojoengine/book: | ||
| - docs-repo/docs/pages/framework/ — World, models, systems, events, testing, authorization, config | ||
| - docs-repo/docs/pages/toolchain/sozo/ — sozo CLI commands and workflows |
There was a problem hiding this comment.
Ohayo sensei — stray indentation inside canonical-desc.
Lines 31–32 carry ~20 extra leading spaces before the - bullets, which the YAML block scalar preserves verbatim when forwarded to Claude. Not a bug, but the prompt string will render with a weird hanging indent compared to the other *-desc inputs. Trim to match the indent of line 30.
✂️ Proposed tidy-up
canonical-desc: |
The Dojo framework and sozo CLI are documented in two sections of dojoengine/book:
- - docs-repo/docs/pages/framework/ — World, models, systems, events, testing, authorization, config
- - docs-repo/docs/pages/toolchain/sozo/ — sozo CLI commands and workflows
+ - docs-repo/docs/pages/framework/ — World, models, systems, events, testing, authorization, config
+ - docs-repo/docs/pages/toolchain/sozo/ — sozo CLI commands and workflows📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| canonical-desc: | | |
| The Dojo framework and sozo CLI are documented in two sections of dojoengine/book: | |
| - docs-repo/docs/pages/framework/ — World, models, systems, events, testing, authorization, config | |
| - docs-repo/docs/pages/toolchain/sozo/ — sozo CLI commands and workflows | |
| canonical-desc: | | |
| The Dojo framework and sozo CLI are documented in two sections of dojoengine/book: | |
| - docs-repo/docs/pages/framework/ — World, models, systems, events, testing, authorization, config | |
| - docs-repo/docs/pages/toolchain/sozo/ — sozo CLI commands and workflows |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/docs-sync.yml around lines 29 - 32, The YAML block under
canonical-desc contains extra leading spaces on the two bullet lines causing a
preserved hanging indent; edit the canonical-desc block so the two list lines
start at the same column as the first description line (remove the ~20 extra
spaces before "- docs-repo/docs/pages/framework/..." and "-
docs-repo/docs/pages/toolchain/sozo/..."), ensuring the block scalar preserves
the intended alignment when consumed by the downstream prompt processor; verify
the resulting indentation matches the line with "The Dojo framework..." so
rendering is consistent.
Replaces the in-tree docs-sync workflow with a minimal stub that invokes the shared reusable workflow hosted in `dojoengine/book`. ## Why The docs-sync logic has been duplicated across 10+ source repos (dojo, katana, torii, torii-core, saya, dojo.js, dojo.c, dojo.unity, dojo.unreal, dojo.bevy, and this one). Any improvement to prompt rules, diff handling, or PR creation had to be applied in 11 places. This migration consolidates the pipeline into a single reusable workflow (`dojoengine/book/.github/workflows/docs-sync.yml`) and leaves each caller with a ~30-line stub. ## Cross-org reuse works `dojoengine/book` is **public**, so `cartridge-gg/controller` can invoke `uses: dojoengine/book/.github/workflows/docs-sync.yml@main` with no access-setting changes. Controller keeps its own `CREATE_PR_TOKEN` and `ANTHROPIC_API_KEY`; they're forwarded to the reusable workflow via `secrets: inherit`. ## What changed - `.github/workflows/docs-sync.yml` shrinks from ~180 lines to ~20. - All pipeline logic (diff computation, `DOCS_PATTERNS` filter, `claude-code-action` invocation, docs-PR branch/commit/auto-merge) moves to the reusable workflow. Behavior is unchanged. - Per-repo variation passed via `with:`: - `target-docs-repo: cartridge-gg/docs` - `source-repo-slug: cartridge-gg/controller` - `diff-globs`, `docs-patterns`, `canonical-desc`, `docs-structure-desc` ## Merge order **Requires `dojoengine/book#504` to land first** — that PR adds the reusable workflow this stub references. Merging this before that means the `uses:` ref won't resolve at trigger time. ## Related Companion stubs across the dojoengine ecosystem: - dojoengine/dojo#3405, katana#552, torii#427, torii-core#68, saya#71, dojo.js#528, dojo.c#165, dojo.unity#117, dojo.unreal#2, dojo.bevy#6.
|
Closed in favor of https://github.com/cartridge-gg/internal/pull/4422 |
Adds a caller stub that invokes the shared reusable docs-sync workflow hosted in
dojoengine/book.What it does
On each merged PR to
main(plus manualworkflow_dispatch), the stub callsdojoengine/book/.github/workflows/docs-sync.yml@mainwith this repo's parameters (diff globs,DOCS_PATTERNS, canonical docs page). The shared workflow diffs the PR, runsanthropics/claude-code-action@betawith a tight "default to no changes / single canonical location / minimal edits" ruleset, and — if Claude made edits — opens an auto-merging PR todojoengine/bookwith the suggested changes.Per-repo parameters
See the
with:block in the diff. Canonical docs location for this repo:dojo:
docs/pages/framework/anddocs/pages/toolchain/sozo/indojoengine/book.Requires these secrets (forwarded via
secrets: inherit)CREATE_PR_TOKEN— PAT withcontents: writeondojoengine/book.ANTHROPIC_API_KEY— foranthropics/claude-code-action@beta.Merge order
Merge
dojoengine/book#504first — that's what adds the reusable workflow this stub references. Merging this stub before that one means the workflow will fail at invocation time (theuses:ref won't resolve).Related
Companion stub PRs across the dojoengine ecosystem, all pointing at the same reusable workflow:
Cross-org companion stub: