feat(ci): add automated Epic documentation audit workflow#36294
Conversation
🤖 Bedrock Review —
|
|
Claude finished @jdcmsd's task in 1m 25s —— View job Rollback Safety Analysis
Result: ✅ Safe to Roll Back This PR adds a single GitHub Actions workflow file ( Checked against all 13 rollback-unsafe categories (C-1 through M-4): none apply. Rolling back this change simply removes the workflow — no application state, database state, or index state is affected. Label |
Replace uv/Python-script-based eval and finalize steps with: - Python3 stdlib context assembly using gh CLI and grep - Shell finalize using gh issue comment, curl for dotCMS API, and git commit/push - prompts/burlap.txt read directly via cat (no YAML parsing) - Fix jq null parent bug in preflight guard Eliminates dependency on dotcms-aios PR merge order.
🤖 Bedrock Review —
|
🤖 Bedrock Review —
|
- Fix -f → -F on gh api PATCH so the file is read, not sent literally - Prepend <!-- autodoc-report --> marker in finalize before posting so idempotent edit lookup works (marker was not in the report itself) - Add --paginate to comment lookup to search beyond the first page - Use jq first // empty instead of | head -1 to avoid SIGPIPE - Fix urlTitle awk to use sub() consistent with title/tags/seoDescription - Remove -k (TLS bypass); add --fail-with-body to dotCMS curl calls - Add comment clarifying AUTODOC_DOTCMS_API_TOKEN_AISEARCH is used by the Claude subprocess via burlap.txt, not directly by a workflow step
🤖 Bedrock Review —
|
- Make git push conditional on commit succeeding (|| true was causing unconditional push even when there was nothing new to commit) - Add git push origin HEAD for explicit branch targeting - Validate urlTitle is a URL slug before interpolating into JSON query (non-slug chars would break the shell-built -d payload) - Validate IDENTIFIER matches UUID format before placing in URL - Add comment on unpinned npm install explaining the tradeoff
🤖 Bedrock Review —
|
|
Claude's roasting this bedrock review:
|
Rewrites the `issue_autodoc.yml` workflow to eliminate the `uv` / Python-script dependency, making it self-contained. **What changed:** - Removed: `Set up uv`, `Install autodoc dependencies`, `uv run python finalize.py` steps - Build eval context: Python3 stdlib + `gh` CLI in a heredoc (no pip, no venv) - Run Claude: unchanged — `claude --print --allowedTools Bash,Write < /tmp/eval_context.md` - Finalize: pure shell + inline Python3 heredocs for JSON payloads; `gh issue comment` for posting; `curl` for dotCMS EDIT/NEW; `git push` for committing - Fixed jq null-parent bug in preflight guard - Reads `prompts/burlap.txt` directly (no YAML parsing) This mirrors the change in `dotCMS/core` PR dotCMS#36294 and resolves the ordering dependency on the dotcms-aios PR.
🤖 Bedrock Review —
|
Report lives as an issue comment — the repo copy is redundant. Removing the push also drops the write-scope requirement on AUTODOC_AIOS_CI.
🤖 Bedrock Review —
|
Embed burlap.txt content directly in the workflow as a heredoc step. Update report path to /tmp — report is ephemeral, lives as issue comment. dotcms-aios checkout now solely serves vault epic context lookup.
🤖 Bedrock Review —
|
- Add conservatism clause to prompt: if Epic lacks technical detail, set action none rather than hallucinating a draft - Restore <details> wrapping of doc draft in issue comment (was lost when post_report.py was replaced with inline shell)
🤖 Bedrock Review —
|
| preflight: | ||
| name: Determine whether to run | ||
| if: | | ||
| contains(github.event.issue.labels.*.name, 'Epic') || |
There was a problem hiding this comment.
Good call, I only noticed the Epic in the labels, not that it's in both.
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| ISSUE_NUMBER: ${{ github.event.issue.number }} | ||
| REPO: ${{ github.repository }} | ||
| HAS_EPIC: ${{ contains(github.event.issue.labels.*.name, 'Epic') }} |
| REPO: ${{ github.repository }} | ||
| HAS_EPIC: ${{ contains(github.event.issue.labels.*.name, 'Epic') }} | ||
| run: | | ||
| if [ "$HAS_EPIC" = "true" ]; then |
There was a problem hiding this comment.
Also I am not sure that only EPICs needs this to run... what happen when we just fixed a but or did a task that requires doc update?
There was a problem hiding this comment.
That's where this comes in:
The gist is:
- If it's Epic, then it's non-negotiable, it's getting the full review.
- If it has one of the Needs Doc labels, then it will receive the doc review if it is NOT the sub-task of an Epic, since then it'll be covered when the Epic finishes anyway.
So, yes, any other tasks that require doc updates just need to have the Doc : Needs Doc or the Changelog: Needs Doc label when they're closed. Or, if the label is added after closing, then it just needs to be reopened and reclosed.
| - name: Install Claude Code CLI | ||
| # Version is unpinned intentionally — claude-code updates frequently and | ||
| # the package is published by Anthropic. Pin if supply-chain policy requires it. | ||
| run: npm install -g @anthropic-ai/claude-code |
There was a problem hiding this comment.
We need to use what @sfreudenthaler put together in Amazon Bedrock to be able to swap models... we can copy the approach from here:
There was a problem hiding this comment.
Thanks, I'll have Claude refer to it.
| - name: Run Claude | ||
| run: claude --print --allowedTools Bash,Write < /tmp/eval_context.md | ||
|
|
||
| - name: Post comment, apply to dotCMS, commit report |
There was a problem hiding this comment.
we should split this into 3 steps for easier auditing.


This resolves #36293 by adding an automation that hopefully works. Testing on
core-workflow-reposeemed entirely promising, so hopefully the change of environment won't add any complications!All secrets (
AUTODOC_*) have already been provisioned by moi.This PR fixes: #36293