ci: let @claude run R and file follow-up issues#218
Conversation
Adds two capabilities to .github/workflows/claude.yml so @claude invocations can do work that previously had to be hand-patched or buried in comments. R toolchain ----------- Install JAGS via apt-get, then set up R + dependencies (including devtools, roxygen2, and rjags) before the Run Claude Code step, and extend claude_args' --allowed-tools with Bash(Rscript:*), Bash(R:*), and Bash(R CMD:*). Without this, devtools::document() — and generally anything that needs to load the package — failed with "command not found" / "no R toolchain", and Claude resorted to editing man/*.Rd by hand (see PR #207 thread). Cost: ~1–3 min of extra setup time per @claude invocation when the dependency cache is warm; slower on cold cache or after a dep change. Acceptable since the tasks that need it (document, style, lint) would otherwise block on a maintainer's local environment. Follow-up issue filing ---------------------- Bump the workflow's permissions: issues: read → write, and add Bash(gh issue:*) to the allowlist. With this, Claude can file follow-up issues for items it identifies but defers from the current PR (out-of-scope refactors, broader investigations, etc.) instead of trailing them in a PR comment that gets lost. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @d-morrison's task in 2m 0s —— View job Code Review: PR #218 —
|
Follow-up to the #207 Claude advisory: R-CMD-check.yaml on cran-submission was already updated to the lowercase form runjags::findjags(); test-coverage.yaml and copilot-setup-steps.yml were not. The two casings are aliases at runtime, so this is purely a consistency fix to avoid a stale-feeling diff once 0.1.0 lands. R-CMD-check.yaml itself is left alone here — it'll pick up the lowercase form (plus several other r-lib action version bumps) when cran-submission merges. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bring the @claude workflow's R setup closer to what copilot-setup-steps.yml already installs: * apt-get the system libs that source-builds typically need (libcurl, libssl, libxml2, libfont*/libharfbuzz/libfribidi/ libfreetype, libpng, libtiff5, libjpeg) alongside JAGS, so textshaping/ragg/curl/xml2 don't fail when pak falls back to source. * setup-pandoc, so vignettes and pkgdown can be rebuilt. * Extend extra-packages with rmarkdown, lintr, spelling, and rcmdcheck — the latter two let Claude run spelling::spell_check_package() and R CMD check locally before pushing, which is exactly the loop that's been forcing follow-up pushes. Intentionally not ported: the rjags source-install step (pak handles it given libjags from apt) and the two verification echo steps (diagnostic only — useful when debugging the setup file itself, not on every @claude invocation). Also keeping action versions at @v2, not @Head (matches the cran-submission direction). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Douglas Ezra Morrison <d-morrison@users.noreply.github.com>
Same three-way conflict as the previous main → cran-submission merge: * DESCRIPTION — kept the 0.1.0 release Title and version from cran-submission. Main's dev version (0.0.0.9054 after #218) is superseded. * NEWS.md — kept cran-submission's "first CRAN release" intro and 0.1.0 structure. All of main's incoming dev-version bullets (#218 R toolchain + gh issue allowlist, findjags casing, #210/#216/#217, OS-snapshot consolidation, Copilot decomposition) are already represented under ## Developer-facing changes from the prior merge and the "Incorporate PR #218 changes" cherry, so the main-side block is dropped rather than re-merged. * inst/WORDLIST — union of both branches, ASCII-sorted, CRLF preserved. Workflow files (.github/workflows/{claude,copilot-setup-steps, test-coverage}.yml) auto-merged to main's version, so cran-submission now inherits #218's @claude R toolchain, gh issue allowlist, and the lowercase runjags::findjags() consistency fix in test-coverage and copilot-setup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Two capabilities for the
@claude(Claude Codeworkflow) so it can do work that previously had to be hand-patched or trailed in PR comments.R toolchain
r-lib/actions/setup-r@v2→setup-r-dependencies@v2withany::devtools, any::roxygen2, any::rjags.claude_args --allowed-toolswithBash(Rscript:*),Bash(R:*),Bash(R CMD:*).Motivation:
@clauderequests like "rerundevtools::document()" on PR #207 failed because the runner had no R toolchain and the Bash allowlist was git-only. Claude resorted to editingman/*.Rdby hand and the maintainer had to verify manually. See this thread.Cost: ~1–3 min of extra setup time per
@claudeinvocation when the dependency cache is warm; slower on cold cache. Acceptable for the tasks that need it.Follow-up issue filing
issues: read→issues: write.Bash(gh issue:*)to the allowlist.So Claude can open a tracking issue for deferred work instead of burying it in a PR comment that gets lost.
Out of scope
claude-code-review.yml(auto-trigger onpull_request). Reviews are review-only and shouldn't be filing issues or running long install steps on every push.Test plan
@claudeon a PR with a request like "regenerate the Rd for X" and confirm Claude runsdevtools::document()rather than hand-editing the Rd.@claudeto "file a follow-up issue for $thing" and confirm the issue lands.🤖 Generated with Claude Code