Skip to content

fix(autodoc): address code review — Epic type, Bedrock model, step split#502

Open
jdcmsd wants to merge 46 commits into
mainfrom
autodoc-review-fixes
Open

fix(autodoc): address code review — Epic type, Bedrock model, step split#502
jdcmsd wants to merge 46 commits into
mainfrom
autodoc-review-fixes

Conversation

@jdcmsd

@jdcmsd jdcmsd commented Jun 26, 2026

Copy link
Copy Markdown
Member

Addresses Freddy's review comments on the autodoc workflow.

Changes

  • Epic type vs label: contains(...labels..., 'Epic')github.event.issue.type.name == 'Epic' in both the job-level if and the HAS_EPIC env var. GraphQL parent lookup updated from labels { nodes { name } } to issueType { name }.
  • Bedrock model switching: Replaced npm install -g @anthropic-ai/claude-code + claude --print with anthropics/claude-code-action@v1. Model and Bedrock role read from vars.BEDROCK_MODEL_ID / vars.BEDROCK_ROLE_ARN so they can be swapped without editing the workflow. Added id-token: write permission for OIDC.
  • Step split: "Post comment, apply to dotCMS, commit report" → three discrete steps: Post report comment / Apply doc update to dotCMS / Apply doc create to dotCMS. Each apply step has an explicit if: env.ACTION == '...' condition visible in the Actions UI.

Notes

  • If vars.BEDROCK_ROLE_ARN is unset, the action falls back to direct Anthropic API via secrets.ANTHROPIC_API_KEY (existing behaviour unchanged).
  • Comment 3 (Epic-only scope question) was answered in the PR thread — no code change needed.

spbolton and others added 30 commits February 12, 2026 18:39
Add new workflow_dispatch inputs to allow testing with different Java versions:
- java-version: Override JDK version (SDKMAN format, e.g., 25.0.2-ms)
- maven-compiler-release: Override compiler release version
- artifact-suffix: Override artifact naming suffix (e.g., -java25)

Changes:
- maven-job/action.yml: Add java override inputs, compute artifact suffix
- deploy-docker/action.yml: Add artifact_suffix input for correct artifact download
- Trunk, Nightly, Release workflows: Add java override inputs
- Build/Test/Deployment phases: Propagate java override inputs
- CLI builds: Skip when java-version overridden (GraalVM compatibility)

Cherry-picked from dotCMS/core PR dotCMS#34612 (28b47ca)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Since CLI builds are entirely skipped when java-version is overridden
(GraalVM/Quarkus compatibility), the java-suffix parameters in
deploy-cli-npm and deploy-jfrog actions are never used.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The CLI modules (dotcms-cli-parent, dotcms-api-data-model, dotcms-cli)
use Quarkus which has an ASM dependency that doesn't support Java 25+
bytecode yet.

When java-version is overridden, exclude these modules from the Maven
reactor build using `-pl '!:module-name'` syntax.

The separate CLI Build job is already correctly skipped when
java-version is set, but the modules were still being built in the
main Build Phase reactor.

Error encountered:
  java.lang.IllegalArgumentException: Unsupported class file major version 69
  at org.objectweb.asm.ClassReader.<init>

This allows testing with newer Java versions without breaking on
Quarkus/GraalVM incompatibilities.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace CLI module exclusion approach with a cleaner property-based
isolation strategy.

Changes:
- Add dotcms.cli.compiler.release property in parent/pom.xml (defaults to 21)
- CLI module POM now uses ${dotcms.cli.compiler.release} instead of hardcoded 11
- Remove CLI exclusion logic from maven-job action

This allows:
- Global maven.compiler.release can be set to any version (e.g., 25)
- CLI modules always compile with safe bytecode version (21) for Quarkus/GraalVM
- Single Maven reactor build (no exclusions or multi-pass)
- Clean property-based separation of concerns

Example usage:
  ./mvnw clean install -Dmaven.compiler.release=25
  # Main modules: Java 25 bytecode
  # CLI modules: Java 21 bytecode (Quarkus compatible)

This resolves ASM limitation:
  java.lang.IllegalArgumentException: Unsupported class file major version 69

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
PROBLEM:
- Command-line -Dmaven.compiler.release=25 overrides ALL property values in POMs
- Previous fix using ${dotcms.cli.compiler.release} in CLI POM didn't work
- CLI still inherited global override, causing Quarkus/ASM bytecode errors

SOLUTION:
- Added dotcms.core.compiler.release property (default 11) in parent POM
- Core modules reference ${dotcms.core.compiler.release} via maven.compiler.release
- CLI modules reference ${dotcms.cli.compiler.release} (default 11) directly
- Changed action to pass -Ddotcms.core.compiler.release instead of -Dmaven.compiler.release

RESULT:
- Override with -Ddotcms.core.compiler.release=25 affects only core modules
- CLI always uses release=11 (Quarkus/GraalVM compatible)
- Single Maven reactor build, no module exclusions needed
- Maintains backward compatibility (both default to 11)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
### Proposed Changes
* change 1
* change 2

### Checklist
- [ ] Tests
- [ ] Translations
- [ ] Security Implications Contemplated (add notes if applicable)

### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **

---------

Co-authored-by: spbolton <steve.bolton@dotcms.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Freddy <147462678+freddyDOTCMS@users.noreply.github.com>
Co-authored-by: dotCMS Machine User <157533496+dotCMS-Machine-User@users.noreply.github.com>
Co-authored-by: dcolina <29883881+dcolina@users.noreply.github.com>
Co-authored-by: Daniel Colina <daniel.colina@dotcms.com>
Co-authored-by: Geronimo Ortiz <geronimo.ortiz@dotcms.com>
Co-authored-by: Fabrizzio Araya <37148755+fabrizzio-dotCMS@users.noreply.github.com>
Co-authored-by: Jalinson Diaz <zjaaaldev@gmail.com>
Co-authored-by: Afaq Javed <68289832+AfaqJaved@users.noreply.github.com>
Co-authored-by: afaqjaved <afaq.javed@dotcms.com>
Co-authored-by: Freddy Montes <freddymontes@gmail.com>
Co-authored-by: hassandotcms <muhammad.hassan@dotcms.com>
Co-authored-by: daniel.solis <2894221+dsolistorres@users.noreply.github.com>
Co-authored-by: Will Ezell <will@dotcms.com>
Co-authored-by: Steve Freudenthaler <31257998+sfreudenthaler@users.noreply.github.com>
Co-authored-by: Arcadio Quintero <oidacra@gmail.com>
Co-authored-by: Dario Daza <dario.daza@dotcms.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: fmontes <751424+fmontes@users.noreply.github.com>
Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>
Co-authored-by: Rafael Velazco <rjvelazco21@gmail.com>
Co-authored-by: Kevin <kevin.davila@dotcms.com>
Co-authored-by: Nicolas Molina Monroy <hi@nicobytes.com>
Co-authored-by: Adrian Molina <adrian.molina@dotcms.com>
Co-authored-by: Iván Hoffmann <ivan.hoffmann@dotcms.com>
Co-authored-by: Kevin Davila <144152756+KevinDavilaDotCMS@users.noreply.github.com>
Co-authored-by: fabrizzio-dotCMS <fabrizzio@dotCMS.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Jose Castro <jose.castro@dotcms.com>
Co-authored-by: Humberto Morera <31667212+hmoreras@users.noreply.github.com>
Co-authored-by: Humberto Morera <humberto.morera@dotcms.com>
Co-authored-by: Steve Freudenthaler <stevefreudenthaler@36:c1:bd:05:e8:20.home>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Freddy Montes <fmontes@users.noreply.github.com>
Co-authored-by: Mehdi <10160868+mbiuki@users.noreply.github.com>
### Proposed Changes
* change 1
* change 2

### Checklist
- [ ] Tests
- [ ] Translations
- [ ] Security Implications Contemplated (add notes if applicable)

### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **
### Proposed Changes
* change 1
* change 2

### Checklist
- [ ] Tests
- [ ] Translations
- [ ] Security Implications Contemplated (add notes if applicable)

### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **
use the debug branch of the ai-workflows repo

### Proposed Changes
* change 1
* change 2

### Checklist
- [ ] Tests
- [ ] Translations
- [ ] Security Implications Contemplated (add notes if applicable)

### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **
use new workflow version

### Proposed Changes
* change 1
* change 2

### Checklist
- [ ] Tests
- [ ] Translations
- [ ] Security Implications Contemplated (add notes if applicable)

### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **
## Summary

Migrates to `dotCMS/ai-workflows@v2.0.0` which upgrades the underlying
`anthropics/claude-code-action` from `@beta` to `@v1` GA.

All three Claude jobs updated:
- `claude-interactive`: `@v1.0.0` → `@v2.0.0`, `allowed_tools` →
`claude_args`
- `claude-automatic-review`: `@v1.0.0` → `@v2.0.0`, `direct_prompt` →
`prompt`, `allowed_tools` → `claude_args`
- `claude-rollback-safety-check`: already on `@v2.0.0` but still had old
`direct_prompt`/`allowed_tools` — fixed

## Breaking changes handled

| Before | After |
|---|---|
| `direct_prompt:` | `prompt:` |
| `allowed_tools:` (multiline) | `claude_args: '--allowedTools "..."'` |
| `@v1.0.0` ref | `@v2.0.0` ref |

## New behavior (from v2.0.0)

- **Sticky comments**: Claude updates a single comment instead of
spamming new ones
- **Progress tracking**: Posts progress updates during automation runs

## Test plan

- [ ] Open a test PR without `@claude` mention → verify automatic review
runs
- [ ] Comment `@claude` on a PR → verify interactive mode triggers
- [ ] Confirm single sticky comment is updated (not multiple new
comments)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
New widget rendering system with SSR, lazy-loading, and widget-scoped
caching.
…llision (#447)

Fixed cache key generation to include contentlet inode. Closes #440
Database migration to add locale_id column. One-way migration that
cannot be rolled back safely.
Internal tooling only - not customer-facing.
Upgraded base image from jammy to noble (24.04 LTS) for security
patches.
## Summary
- TypeScript data-gathering script that extracts PR details, labels, and
categorization from GitHub API
- Prompt template for Claude to generate changelog prose (assembled via
simple shell concatenation with JSON data)
- Reusable workflow component (`cicd_comp_ai-release-notes-phase.yml`)
with release validation and `continue-on-error` for non-blocking
execution
- Backfill workflow (`cicd_ai-release-notes-backfill.yml`) for
manual/retroactive runs
- Reproducible test harness script (`test/create-test-harness.sh`)
- Jest tests for categorization and GitHub API helpers (30 passing)

## Architecture

```
┌─────────────────────────────────────────────────────────┐
│                  RELEASE PIPELINE                        │
│              (cicd_6-release.yml)                        │
│                                                          │
│  Step 1: Build artifacts                                 │
│  Step 2: Run tests                                       │
│  Step 3: Create GitHub release + tag                     │
│  Step 4: Deploy                                          │
│  Step 5: ───► calls ───────────────────────┐             │
│               (passes newly generated release tag)       │             
└────────────────────────────────────────────┼─────────────┘
                                             │
                                             ▼
                              ┌──────────────────────────┐
                              │   REUSABLE COMPONENT      │
                              │  (cicd_comp_ai-release-   │
                              │   notes-phase.yml)        │
                              │                           │
                              │  1. Gather PR data        │
                              │  2. Assemble prompt       │
                              │  3. Claude writes notes   │
                              │  4. Update release desc   │
                              └──────────────────────────┘
                                             ▲
                                             │
┌────────────────────────────────────────────┼─────────────┐
│                BACKFILL WORKFLOW           │             │
│        (cicd_ai-release-notes-backfill.yml)│             │
│                                            │             │
│  Manual trigger (workflow_dispatch) ───────┘             │
│                                                          │
│  Use cases:                                              │
│  • Past releases that never got AI notes                 │
│  • Re-generate notes after prompt improvements           │
│  • Test the pipeline without doing a real release        │
└──────────────────────────────────────────────────────────┘
```

## Test plan
- [ ] Merge this PR so workflows are available on `main`
- [ ] Trigger backfill workflow with `v26.03.17-02` to test end-to-end
- [ ] Verify filter: trigger with `v26.03.17_lts_v01` → should skip
- [ ] Re-trigger with `v26.03.17-02` → should safely overwrite existing
notes

## Links
closes dotCMS#35016

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Steve Freudenthaler <stevefreudenthaler@dotcmss-mbp.home>
- Use `prompt` input instead of removed `prompt_file`
- Move `--allowedTools` and `--max-turns` to `claude_args`
- Add `id-token: write` permission required for OIDC token
- Pass prompt content via GITHUB_ENV to avoid shell escaping issues

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…467)

### Proposed Changes

* Extends `ai_claude-rollback-safety.yml` to produce two outputs from a
single diff-comprehension pass per PR:
1. **Doc-object draft** — a structured YAML + markdown summary of the
change, posted as a collapsible PR comment pre-merge and attached to the
squash commit via `git notes` post-merge
  2. **Rollback safety assessment** — existing behavior, unchanged
* Adds `prompts/doc_object_generation.md` — the schema, classification
heuristics, and body-section guidance the model follows when generating
a doc object
* Adds a new `doc-object-attach` job (pure shell, no LLM call) that
fires on `pull_request: closed` + `merged == true`, reads the draft
comment, substitutes the real merge SHA for placeholders, and pushes to
`refs/notes/doc-objects`
  
### Why
  
Doc objects are pre-analyzed, commit-bound summaries intended to make
downstream documentation pipelines cheaper — a release-notes generator
or doc-update pipeline can consume pre-computed doc objects for a commit
range without re-reading every diff. Attaching them at merge time via
`git notes` keeps the working tree clean and the notes fetchable as a
separate ref.
  
Piggybacking on the existing rollback-safety workflow means one diff
read per PR instead of two, halving the token cost of the combined
operation.
  
### Rollback safety
  
This change touches only CI configuration and a markdown prompt file. No
Java, no database, no Elasticsearch mappings, no public API surface.
Safe to roll back by reverting this PR.
  
### Checklist
- [x] Tests — workflow behavior verified via this PR itself
- [x] Translations — N/A
- [x] Security Implications Contemplated — Claude access remains gated
by the existing org-membership check; no new secrets required;
`doc-object-attach` has `contents: write` + `pull-requests: read` only
this is part of the testing process!

### Proposed Changes
* Adds `docs/core/DOC_OBJECT_PIPELINE.md` — reference documentation for
the doc-object pipeline: what it generates, how to fetch notes locally,
the schema summary, audience filtering, and provenance tracking

### Checklist
- [x] Tests — N/A (documentation only)
This is also a test of the existing workflow!
the git note add failed due to lack of ident, so this should fix that.
#474)

this one's the charm, I can feel it. this may also tell us if the epic
lookup is performing:

> The epic lookup will probably reach for something in the
`q2-transparent-evergreen-updates` or `q2-mcp-v2` neighborhood, which
tells us whether the matching logic is working sensibly.
…475)

[1m] garbage in the model name
  
> What's happening: the doc object's provenance block is supposed to
record which AI model generated it. The prompt tells Claude to fill in
its own model ID. When Claude does this inside the CI runner, it reads
its identifier from its environment — but that value has invisible
terminal formatting codes attached to it (the [1m] is a "bold text"
instruction meant for a terminal display, not for a YAML file). It ends
up written to the note as literal characters.
> 
> Why it matters: the provenance block is meant to be machine-readable.
Downstream tooling that parses YAML notes will get claude-opus-4-8[1m]
instead of claude-opus-4-8, which could cause parse errors or mismatches
when checking which prompt version generated a note.
> 
> The fix is to just tell Claude the exact string to write, the same way
we already handle the SHAs with PLACEHOLDER_* values. The model name is
known at workflow-authoring time; it should live in the workflow as a
hardcoded literal, not be self-reported.

I asked if there are any downsides to this approach. Included for
thoroughness:

> One real one: the hardcoded model name will silently go stale if the
orchestrator switches models without a matching workflow update.
> 
> If someone updates the orchestrator to use claude-opus-4-9 but forgets
to bump model: in this prompt, every doc object generated afterward will
claim to be from claude-opus-4-8-20251001. The provenance block exists
precisely for regeneration audits — "was this generated by an old
model?" — and a stale value defeats that purpose.
> 
> The mitigation is process, not code: treat the model: line here the
same as prompt_version: — both get bumped together whenever the
orchestrator model changes. If that discipline holds, the stale value
risk is low. If the team is loose about it, it becomes a quiet data
quality problem.
> 
> The two other approaches worth knowing about:
> 
> Inject the model as a workflow variable — pass it in from the
workflow's with: block as a GitHub Actions expression so it's set once
at the top of the file, clearly visible, and easy to update. This
doesn't solve the staleness risk but at least makes the value easy to
spot and change. Whether the orchestrator supports passing arbitrary env
vars through is the unknown — worth checking with the original author.
> 
> Drop the model: field from the schema — the prompt_version: field
already anchors regeneration audits. You can always look up which model
was active at a given prompt version. If you're willing to accept that
indirect lookup, removing model: entirely eliminates the problem without
any tradeoff.
> 
> For now the hardcoded approach is fine — it's better than ANSI garbage
and the staleness risk is low given how infrequently models change
relative to prompt iterations. But worth flagging to whoever owns the
workflow long-term.
Another smoke test for updated automation with hardcoded model.
Undoing the test bypass. Shouldn't be needed further, anyway, since my
org membership is now public.
jdcmsd and others added 16 commits June 5, 2026 09:10
…bject quality test (#478)

This is another smoke test.

> The second PR's commit message is intentionally written as a real fix
— fix(page-cache): — so Claude classifies it as a bugfix with real
stakes, not a chore. That's what makes it a useful quality test.

I'm skeptical, but sure, let's try.
…allback (#479)

two fixes

> 1. Prompt change — make it explicit that the HTML comment markers are
CI plumbing, not optional formatting, and must be present even when the
doc object is embedded in the rollback comment
> 2. Extraction fallback — make the Python script resilient enough to
find the doc object even if a future model run varies the format
slightly
This reverts it to before I started messing with Erick's automation,
since my messing with Erick's automation proved unnecessary to the
rescoped project.

But I will still need to test automations, so, we clean the desk.
Putting it back to before I started messing with Erick's automation.
## Summary

- Adds `.github/workflows/issue_autodoc.yml` — triggers when a `Doc :
Needs Doc` or `Changelog: Needs Doc` label is applied to an issue that
also carries the `Epic` label
- Checks out the autodoc scripts repo (`jdcmsd/autodoc`) and
`dotCMS/dotcms-aios` (vault substitute), runs the eval pipeline via
Claude Code CLI, then runs `finalize.py` to save the CMS draft and post
the report as a GitHub issue comment
- Uses existing `ANTHROPIC_API_KEY` and `GITHUB_TOKEN`; requires
`AUTODOC_TOKEN`, `AUTODOC_REPO`, and the `DOTCMS_*` secrets to be set in
repo settings

## Test plan

- [ ] Merge this PR
- [ ] Label a test Epic issue with `Doc : Needs Doc`
- [ ] Confirm the Actions job triggers and runs to completion
- [ ] Confirm a report comment is posted on the issue
## Summary

- Renames `DOTCMS_API_TOKEN` → `DOTCMS_API_TOKEN_AISEARCH` and
`DOTCMS_API_TOKEN_LOCAL` → `DOTCMS_API_TOKEN_AUTODOCDRAFT` in
`issue_autodoc.yml` to match the updated secret names now set in repo
settings.

## Test plan

- [ ] Merge this PR
- [ ] Trigger the autodoc workflow by labeling a test Epic with `Doc :
Needs Doc`
dotcms-aios is a private repo; GITHUB_TOKEN is scoped to
core-workflow-test only. Switch to AUTODOC_TOKEN which has org-level
read access.
The pipe from run_eval.py to Claude times out because run_eval.py is
slow (GitHub API fetches). Write to a temp file first, then feed Claude
via stdin redirect.
…opover (#492)

Closes #491

### Proposed Changes

Restores feature parity with the legacy Block Editor by bringing
internal dotCMS **page search** back to the Block Editor 2.0 link
popover.

* **Page search in the URL field** — replaced the plain URL text input
with a PrimeNG `p-autoComplete`. Typing a partial title/path runs a
debounced (250 ms) search and shows a dropdown of matching pages.
* **Reuses existing data-access** — the search goes through
`DotContentSearchService` from `@dotcms/data-access` (the same service
the slash-menu drill-down uses); no new HTTP service. The Lucene query
is built inline at the call site, mirroring the legacy editor
(`basetype:5` pages + URL-mapped content, matched by title/path/urlmap
prefix).
* **Custom result template** — each suggestion shows the contentlet name
and its path, plus a thumbnail (`/dA/{inode}`) when available, with
ellipsis truncation to fit the popover.
* **External URLs never blocked** — when the value parses as a valid
`http(s)` URL the overlay is suppressed entirely (no search, no empty
message), so pasting/typing an external link works unchanged. Manual
entry is always allowed.
* **Empty state** — shows "No results found in dotCMS" when a search
returns nothing.
* **Works in create and edit flows** — selecting a result populates the
link `href`; opening an existing link prefills the field without firing
a spurious search.
* **Selection highlight while editing** — in insert mode, focusing the
URL input no longer hides which text will become the link: the target
range is painted with a ProseMirror decoration that survives the input
blur and is cleared when the popover closes.
* **Popover shell fix** — whitelisted `.p-autocomplete-overlay` in the
popover's click-outside handler so picking a suggestion (body-appended
overlay) doesn't dismiss the popover.
* **`rel` select fix** — the `rel` control now defaults to `null`
instead of `''`, so PrimeNG's `[showClear]` no longer renders a stray
"X" on the empty dropdown.

### Checklist
- [x] Translations — added `dot.block.editor.dialog.link.search.empty`
and updated the URL placeholder in `Language.properties`.
- [x] Security Implications Contemplated — no new endpoint; reuses the
existing `/api/content/_search`. Query-term interpolation matches the
legacy popover's behavior (search scoped to working/non-deleted content
for the active language).

### Additional Info
The search-result set (pages via `basetype:5` plus URL-mapped content,
scoped to the active `languageId`, working + non-deleted) reproduces the
legacy link popover's behavior.

---
*Mirrored from dotCMS#35907 for autodoc pipeline testing.*
- Collapse separate autodoc + dotcms-aios checkouts into a single
dotcms-aios checkout (autodoc now lives at autodoc/ within that repo)
- Update working-directory and --aios-dir paths accordingly
- Retire AUTODOC_REPO and AUTODOC_TOKEN; use CI_MACHINE_TOKEN instead
- Rename the four dotCMS-specific secrets to AUTODOC_ namespace:
    DOTCMS_API_TOKEN_AISEARCH     → AUTODOC_DOTCMS_API_TOKEN_AISEARCH
    DOTCMS_API_TOKEN_AUTODOCDRAFT → AUTODOC_DOTCMS_API_TOKEN_DRAFTING
    DOTCMS_BASE_URL               → AUTODOC_DOTCMS_BASE_URL
    DOTCMS_SITE_FOLDER            → AUTODOC_DOTCMS_SITE_FOLDER

### Proposed Changes
* change 1
* change 2

### Checklist
- [ ] Tests
- [ ] Translations
- [ ] Security Implications Contemplated (add notes if applicable)

### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Replaces `CI_MACHINE_TOKEN` (which was never provisioned on this repo)
with `AUTODOC_AIOS_CI`, the PAT that was previously working as
`AUTODOC_TOKEN` and has now been re-provisioned under the new name.
…ncy (#498)

Embeds the burlap prompt directly in the workflow as a heredoc step. The
dotcms-aios checkout now solely serves vault epic context lookup from
`work/epics/`. Report path moves to `/tmp` — it's ephemeral, the issue
comment is the durable artifact. Closes the need for the dotcms-aios PR
entirely.
#499)

## Summary

- Adds conservatism clause to the burlap prompt: if the Epic is a
placeholder or lacks real technical detail, the model must set `action:
none` rather than hallucinating a draft. Fixes the 765-word fabricated
document produced in the last test run.
- Restores the `<details>` collapse of the documentation draft in the
posted issue comment. This was dropped when `post_report.py` was removed
in favour of inline shell; the wrapping Python snippet is now inlined in
the finalize step.

## Test plan

- [ ] Close a test issue tagged `Epic` + `Doc : Needs Doc` that is a
clear placeholder (no real PRs, no substance) — confirm report has
`action: none`
- [ ] Close a real Epic with merged PRs — confirm comment is posted with
draft inside a `<details>` block
- Replace label check for Epic with issue type check (github.event.issue.type.name)
- Update GraphQL parent lookup to use issueType { name } instead of labels
- Add id-token: write permission for Bedrock OIDC
- Replace npm install + claude --print with anthropics/claude-code-action@v1;
  model and Bedrock role sourced from vars.BEDROCK_MODEL_ID / vars.BEDROCK_ROLE_ARN
- Split finalize into three discrete steps for easier auditing:
  Post report comment / Apply doc update to dotCMS / Apply doc create to dotCMS
@jdcmsd
jdcmsd requested a review from a team as a code owner June 26, 2026 12:40
@github-actions

Copy link
Copy Markdown

❌ Issue Linking Required

This PR could not be linked to an issue. All PRs must be linked to an issue for tracking purposes.

How to fix this:

Option 1: Add keyword to PR body (Recommended - auto-removes this comment)
Edit this PR description and add one of these lines:

  • This PR fixes #123 or Fixes: #123

  • This PR closes #123 or Closes: #123

  • This PR resolves #123 or Resolves: #123

  • Other supported keywords: fix, fixed, close, closed, resolve, resolved
    Option 2: Link via GitHub UI (Note: won't clear the failed check)

  1. Go to the PR → Development section (right sidebar)

  2. Click "Link issue" and select an existing issue

  3. Push a new commit or re-run the workflow to clear the failed check
    Option 3: Use branch naming
    Create a new branch with one of these patterns:

  • 123-feature-description (number at start)

  • issue-123-feature-description (issue-number at start)

  • feature-issue-123 (issue-number anywhere)

Why is this required?

Issue linking ensures proper tracking, documentation, and helps maintain project history. It connects your code changes to the problem they solve.---

This comment was automatically generated by the issue linking workflow

@claude

claude Bot commented Jun 26, 2026

Copy link
Copy Markdown

Claude finished @jdcmsd's task in 1m 43s —— View job


Autodoc analysis — complete

  • Read doc-object schema & rollback-unsafe categories
  • Fetch PR metadata, diff, linked issues, epic
  • Generate doc object (Output A)
  • Assess rollback safety (Output B)
  • Post results & apply label

🟢 Rollback safety: Safe to Rollback

This PR modifies a single file — .github/workflows/issue_autodoc.yml — and nothing else. I checked the diff against every category in ROLLBACK_UNSAFE_CATEGORIES.md:

  • No DB migrations / runonce tasks (C-1, C-4, H-1, H-2, H-3, H-6, H-7, M-1) — no SQL, no schema change.
  • No Elasticsearch mapping changes (C-2) — the only ES reference is an unchanged /api/es/search query string used at runtime by the workflow; no putMapping/reindex.
  • No content JSON model version bump (C-3), no field type (H-4), no storage provider change (H-5).
  • No REST/GraphQL/OSGi contract change (M-3, M-4) — the GraphQL edit is to the workflow's own consuming query (labels → issueType), not to a dotCMS-exposed API; no bundle format change (M-2).

The change is CI/CD-only (Area : CI/CD), affects only the documentation-automation pipeline, and reverting the file fully restores prior behavior. Applied label AI: Safe To Rollback.

Note on linking: no closes/fixes/resolves #N in the PR body, so no linked issues. The dotcms-aios epics path returned 404 from this runner, so the epic field is omitted (not guessed).


📄 Doc Object Draft (attached to merge commit post-merge)
---
commit: PLACEHOLDER_SHORT_SHA
title: "fix(autodoc): address code review — Epic type, Bedrock model, step split"
type: ci
module: "autodoc CI workflow (issue_autodoc.yml)"
customer_visible: no
security_relevant: false
breaking_change: false
pr:
  primary: 502
release_notes:
  audience: internal
  priority: low
  reasoning: "Internal CI workflow refactor with no customer-observable behavior change."
provenance:
  generator: doc-object-skill
  model: claude-opus-4-8-20251001
  prompt_version: v0.1
  generated_at: 2026-06-26T12:47:44Z
  source_pr: 502
  source_diff_sha: PLACEHOLDER_FULL_SHA
---

What changed

Refines the issue_autodoc GitHub Actions workflow per review feedback. Epic detection now keys off GitHub's native issue type (github.event.issue.type.name == 'Epic') instead of an Epic label, including the GraphQL parent lookup which now reads issueType { name } rather than labels { nodes { name } }. The Claude invocation moves from a globally-installed @anthropic-ai/claude-code CLI to the anthropics/claude-code-action@v1 action, with model and Bedrock role sourced from vars.BEDROCK_MODEL_ID / vars.BEDROCK_ROLE_ARN so they can be swapped without editing the workflow (falls back to direct Anthropic API when the role var is unset). The monolithic finalize step is split into three discrete, independently-visible steps — Post report comment, Apply doc update to dotCMS, Apply doc create to dotCMS — each gated by an explicit if: env.ACTION == '...' condition, with slug/UUID validation retained on the apply paths.

Risk / watch

Adds id-token: write permission to the job for Bedrock OIDC. Behavior is unchanged when vars.BEDROCK_ROLE_ARN is empty. Affects only the documentation-automation pipeline; no product code, API, or data is touched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants