Skip to content

chore: Add CRAN submission and release workflows - #820

Merged
krlmlr merged 27 commits into
mainfrom
claude/rsqlite-cran-release
Nov 10, 2026
Merged

krlmlr merged 27 commits into
mainfrom
claude/rsqlite-cran-release

Conversation

@krlmlr

@krlmlr krlmlr commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

This PR adds RSQLite's CRAN release tooling, copied from duckdb/duckdb-r at commit 86ac17f6b (the commit for its 2.0.0 release) and then adapted to RSQLite. Once it's merged into main, the release workflows can be started with workflow_dispatch.

What it adds

  • .github/workflows/cran-submission.yaml, with the local actions .github/actions/cran-tag/ (cran-tag.sh, which drafts the release and tags the commit, and its offline test) and .github/actions/cran-submit/ (cran-submit.sh and its offline test).
    • You dispatch it by hand on a ref, with the inputs dry-run, allow-dev-version and retag; one run goes at a time, and on a fork every job is skipped.
    • It stops if DESCRIPTION carries a development version.
    • It drafts the GitHub release RSQLite <version> from that version's NEWS.md section, with the marker <!-- cran-submission: RSQLite <version> -->, and tags v<version>. It writes nothing when the tag exists (without retag), when the tags on GitHub cannot be read, or when a published release or more than one draft carries the tag. When it updates an existing draft, it first removes the tarball an earlier attempt attached.
    • It builds the package with R CMD build, recompresses it with zopfli (pigz -11), verifies it and keeps it as an artifact.
    • It uploads the tarball through CRAN's form, the way devtools:::upload_cran() does, with the one-line comment RSQLite <version>.
    • It attaches the submitted tarball to the draft release, after checking its sha256 and that the draft is the only release with the tag.
  • .github/workflows/cran-release.yaml, with the local action .github/actions/cran-release/ (cran-release.sh and its offline test).
    • It runs nightly. It publishes the marked draft as the latest release, by its id, once P3M's source index lists the version, the draft carries the submitted tarball and is the only marked draft for its tag, and the tag points at the draft's commit.
    • It reports to the release's checklist issue: the open issue whose body carries <!-- release-checklist: RSQLite <version> --> and that an owner, member or collaborator of the repository opened. An issue opened by anyone else, a workflow or a bot included, is ignored with a warning.
    • It closes that issue once the release is published.
  • .github/workflows/release-gate.yaml and .github/workflows/winbuilder.yaml, both dispatch-only.
  • .github/actions/release-report/, which posts a workflow's result as one comment and updates it in place on later runs, and whose close-checklist.sh closes the checklist issue once the release is published.
    • Submission, release gate and win-builder post it on the open release PR whose head is the branch they were dispatched on.
    • cran-release.yaml posts it on the checklist issue instead, because the release PR is merged right after the submission.
  • .github/actions/cran-lib/, the log and summary helpers the scripts share.
  • The release process, written into the header of cran-submission.yaml, since RSQLite has no handbook. It covers seven steps: pre-cut review, cut, check, dry run, submit, merge back and publish. It is adapted from duckdb's handbook/operations/releases/cran/README.md and process/README.md.

Commits

  1. Three verbatim copies. Each file's first line names its source and commit; in scripts it is the second line, after the shebang. These lines keep duckdb's original paths.
  2. Adaptation to RSQLite:
    • drop duckdb's vendored-engine check;
    • install the package dependencies before R CMD build, because the vignette needs them;
    • update the repository names and test fixtures;
    • fix one shellcheck finding.
  3. The tag job never moves an existing v<version> tag.
    • If the tag exists, the job prints the tag and its commit and stops before drafting, tagging or uploading.
    • The retag input is only for a submission CRAN never received: it prints the old commit, then moves the tag.
    • A resubmission after a rejection uses a new patch version instead.
  4. An attach-tarball job with contents: write runs after the upload. It checks the sha256 and attaches the submitted tarball to the draft release, so the record of what went to CRAN outlives the run's artifact.
  5. The scripts move from scripts/ into local actions under .github/actions/, and ^scripts$ leaves .Rbuildignore.
  6. The cran-* push triggers go, so every release run is dispatched by hand, and the result-reporting comments are added.
  7. The process text no longer uses cran-comments.md or fledge::bump_version().
    • fledge's marker line is removed from NEWS.md by hand.
    • The NEWS heading is exactly # RSQLite <version>, with no date.
    • A full dry run comes before the real run.
    • Nothing is submitted while any check on that commit is still running or red.
    • After the merge back, main gets a development version and a compare link.
  8. cran-release.yaml reports to the checklist issue and closes it once the release is published, using the new published step output.
  9. Review fixes:
    • the tag job and the issue-closing loop move into scripts with offline tests;
    • the tag check fails closed when the tags on GitHub cannot be read;
    • NEWS code fences no longer cut the section, following CommonMark's fence rules;
    • only a member's or collaborator's issue is the checklist, and a rejected one raises a warning;
    • the docs job reports its real result;
    • a draft is published only with the submitted tarball, and a retargeted draft loses the earlier attempt's tarball;
    • submissions run one at a time and drafts are addressed by id;
    • every job is skipped on forks;
    • the reports state only what happened, and a cancelled win-builder run says its upload state is unknown.

The template workflows (R-CMD-check, rhub, pkgdown, revdep) are unchanged.

Validation

  • Offline tests:
    • cran-submit-test.sh: 94 passed, including the real R CMD build and pigz path.
    • cran-release-test.sh: 53 passed.
    • cran-tag-test.sh: 94 passed. It runs the tag job's script against a local bare remote and a stubbed gh, and covers a fresh tag, an existing draft (including the removal of an earlier tarball), several drafts, an existing tag (real run, dry run, retag dry and real), an origin that cannot be read, a published release, a missing NEWS section, and each code-fence rule.
    • release-report-test.sh: 27 passed.
    • The regression tests for the review findings fail against the scripts before the fixes.
  • shellcheck is clean on .github/actions/*/*.sh.
  • actionlint is clean on the four workflows. Two warnings are ignored because the existing workflows trigger them too: the ubuntu-26.04 runner label and the missing description in the existing custom actions.
  • No workflow has been dispatched, so the GitHub-side behaviour is verified by the offline tests and by reading only.

Review

Two clean-context reviews: the first found two Medium and eight Low issues, the second confirmed the fixes and found four more Low ones, also fixed. What remains is listed under Accepted limitations.

https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9


Generated by Claude Code

Drop the vendored-engine check, point the scripts' advice at the process
documented in the header of cran-submission.yaml, install the dependencies
that building the vignette needs, and keep scripts/ out of the tarball.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
If v<version> exists, the tag job prints the tag and its commit and stops
before drafting, tagging or uploading. The input `retag` is meant only for
a submission CRAN never received; it prints the old commit before moving.
A resubmission after a CRAN rejection is a new patch version instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
A job with `contents: write` runs after the upload, checks the artifact's
sha256 against the submitted one, and attaches the tarball to the draft
release, so that the record of what went to CRAN does not expire with the
run's artifact.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9

krlmlr commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

codecov/project fails here with 28.23% (−0.09%), but the failure isn't caused by this PR. Codecov compares against ee8cdb8, while the PR's base is 0c22c22, so the comparison also covers the SQLite 3.54.1 upgrade in between. The PR itself changes no R or C code, only workflows, shell scripts under scripts/ (which .Rbuildignore now excludes) and .Rbuildignore. That is why codecov/patch passes. No fix exists, and a rerun would get the same numbers. The other checks on the head pass or are skipped, including "Smoke test: stock R" and "Check matrix".


Generated by Claude Code

…ons under .github/actions/

cran-submit.sh and its offline test go to .github/actions/cran-submit/,
cran-release.sh and its test to .github/actions/cran-release/, each beside
a composite action.yml that the workflows now use, and the shared helpers
to .github/actions/cran-lib/. The .Rbuildignore entry for scripts/ goes,
since .github is ignored already.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
…elease pull request

release-gate.yaml and winbuilder.yaml lose their `cran-*` push triggers:
the release branch has no special name, and every release run is
dispatched by hand. Each of the four release workflows ends with a
`report` job that posts its result to the open pull request whose head
is the dispatched branch (cran-release.yaml, which runs on main, falls back
to the one labelled "CRAN release"), as one comment per workflow that
later runs update in place. The new local action
.github/actions/release-pr-comment/ does that, with an offline test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
…e bumps

The header of cran-submission.yaml now names the pre-cut review, a neutral
release branch, fledge's marker removed by hand with no bump_version()
afterwards, the dateless NEWS heading the tag job matches, runs
dispatched by hand on r-dbi/RSQLite, a final dry run before submission,
and the development line that follows the merge back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
… publication

The release pull request is merged right after the submission, so the
nightly cran-release.yaml reports to the release's checklist issue instead,
the open issue whose body carries `<!-- release-checklist: <package>
<version> -->`, and closes that issue once it has published the release.
cran-release.sh writes the releases it published to the step output
`published`. The reporting action, renamed release-report, targets such
an issue when given `issue-marker`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9

krlmlr commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Review of this PR at 44f0746, by a Claude Code reviewer with clean context that read the PR description, its one comment and the full diff against main (four workflows, four local actions, three test scripts), ran the three offline test scripts (with R and pigz present), shellcheck, and a few scratch-directory shell snippets, read a handful of public GitHub REST endpoints, and posted nothing itself. Line numbers refer to that commit. "Confirmed" means reproduced by running code. No High findings: I found no path that moves an existing tag without retag, publishes a draft before P3M lists the version, or submits a different commit than the one tagged.

Medium

1. The "tag exists" guard fails open: any git ls-remote error is read as "no such tag", and the job then goes on to draft or retarget the release. .github/workflows/cran-submission.yaml:271 uses if git ls-remote --exit-code --tags origin "refs/tags/$tag" > /dev/null; then, so a network or auth failure (status 128) takes the same branch as a truly absent tag (status 2). The next step then creates the draft, or runs gh release edit ... --target on an existing draft (cran-submission.yaml:397), before the tag step tries a plain push. Confirmed in a scratch repository: against an unreachable remote the condition is false with status 128, against a reachable remote without the tag it is 2, and the later non-forced git push origin refs/tags/v1.0.0 of a different tag object is rejected with "the tag already exists in the remote". So the tag itself is not moved and nothing is uploaded, but an existing draft has by then been pointed at the new commit and given new notes, which contradicts "Nothing was drafted, tagged or uploaded" and leaves cran-release.sh refusing to publish until someone repairs the draft by hand. Suggested fix: capture the status and treat only 2 as "absent", failing the step on anything else; optionally re-check the tag immediately before the release step writes.

2. The checklist issue is found by body text alone, so any GitHub user can divert the nightly report and have the bot comment on and close their issue. .github/actions/release-report/release-report.sh:40-41 takes the first open issue whose body contains <!-- release-checklist: (the marker passed at .github/workflows/cran-release.yaml:93), and cran-release.yaml:107-108 closes every open issue whose body contains the full marker; neither looks at who wrote the issue. The issues endpoint lists newest first, so a newer issue from anyone wins. Confirmed by running both jq filters over a two-issue sample (an outsider's newer issue and a member's older one): the report targets the outsider's issue, and the close step closes both. The impact is limited (no code execution, the token only has issues: write), but the real checklist then stops receiving the nightly result, including the "tag missing" and "tag points elsewhere" failures. An issue that merely quotes the marker in a code block is hit the same way. The offline test for this path (release-report-test.sh:95-100) only covers skipping pull requests. Suggested fix: add .author_association in OWNER, MEMBER, COLLABORATOR to both filters (or require a label only maintainers can set), and add a test with a non-member issue.

Low

3. The riskiest logic is not covered by the offline tests. The tests exercise the three scripts (94, 41 and 12 passing here, matching the description), but the version check, the NEWS extraction, the existing-tag and retag decisions, the draft create/update, the tag push and the sha256 comparison are inline shell in .github/workflows/cran-submission.yaml:155-202, :233-323, :337-413, :422-457 and :588-612, and the issue-closing loop is inline in cran-release.yaml:104-120. The description says the tag steps were run by hand against a scratch remote, which nothing in the repository repeats. By reading. Suggested fix: move the tag job's shell into a script under .github/actions/ with a test against a local bare remote and a stubbed gh, as the other three already do; finding 1 would have been a natural case.

4. A line starting with # inside a fenced code block ends the NEWS section early, silently truncating the tag message and the release notes. cran-submission.yaml:246-250 stops at the first line matching /^# / after the heading. Confirmed with a sample NEWS.md whose section contains an R code block with a # connect comment: the output stops inside the open fence and drops the bullet after it. No section of the current NEWS.md has such a line, so this is latent. Suggested fix: stop only at ^# <package> headings, or track fences in the awk program.

5. docs in the release-gate report will very likely always read success. The job sets continue-on-error: true (.github/workflows/release-gate.yaml:60) and the report prints needs.docs.result (release-gate.yaml:145); with job-level continue-on-error, GitHub reports the result of a failed job to dependents as success. By reading (not dispatched). The comment on the release pull request would then show a passing docs check when it failed. Suggested fix: drop continue-on-error and let the report ignore the job (it already does, because of the "(reports only)" suffix), or export the real outcome as a job output.

6. cran-release.sh publishes any marked draft whose version P3M lists, without checking that the submission run actually uploaded. The draft and the tag are written before the build and the upload, so a run that fails afterwards leaves a marked draft with a matching tag; if that version later reaches CRAN by another route (a manual upload from a different commit, say), .github/actions/cran-release/cran-release.sh:208 publishes it as latest. By reading. Suggested fix: require the <package>_<version>.tar.gz asset that attach-tarball adds before publishing, and report its absence like a missing tag.

7. Two runs for the same version on different refs can leave two drafts with the same tag name, and both scripts then address the draft by tag, not by id. The concurrency group includes the ref (cran-submission.yaml:113-115), both runs can pass the tag check before either pushes, and gh release edit "$TAG" / gh release upload "$TAG" (cran-submission.yaml:397, :605, cran-release.sh:208) pick whichever draft gh finds first. By reading. Suggested fix: use ${{ github.workflow }} alone as the group, and edit by release id via gh api.

8. Nothing enforces "never on a fork". The header says so (cran-submission.yaml:13-14), but no job has if: github.repository == 'r-dbi/RSQLite', so a dispatch in a fork with Actions enabled would upload to CRAN and win-builder under the maintainer's address from DESCRIPTION, and cran-release.yaml:21 schedules itself there too. By reading. Suggested fix: add the repository condition to the first job of each of the four workflows.

9. The report comments state things that did not happen when a job fails early. .github/workflows/winbuilder.yaml:131 always writes "Uploaded <tarball> to: ", also when the queue check or the build failed and the tarball output is empty; cran-submission.yaml:647 prints "Tarball: _.tar.gz, sha256 ``" when the build did not get that far. By reading. Suggested fix: make those lines conditional on the job result or on a non-empty output.

10. The jobs that tag and build the submitted tarball run third-party actions at a moving ref. cynkra/cynkratemplate/.github/actions/git-identity@main runs in the job holding contents: write with persisted credentials (cran-submission.yaml:223-226), and install@main runs right before R CMD build (cran-submission.yaml:499), while the blockr.ci actions in release-gate.yaml are pinned to a commit. This matches the repository's other workflows, so it is a consistency note rather than a regression. By reading.

Checked and found sound

  • No ${{ }} expression is interpolated into a run: block in the four workflows; inputs and outputs reach shell only through env: or action inputs that the composite actions map to env:. The queues input is validated against a fixed list before use.
  • No secret other than the job token is used, and nothing prints it; build and upload steps run with contents: read and persist-credentials: false, and only tag, attach-tarball and publish hold contents: write.
  • All jobs of a submission run check out the same github.sha; the tag, the draft target and the tarball come from that one commit, and the tarball name is checked against the DESCRIPTION inside it before upload.
  • A published release for the tag stops the run before the tag step, including with retag; a plain push of an existing tag is rejected by the remote (confirmed), so only the explicit retag path can move a tag.
  • The two POSTs match devtools:::upload_cran() in devtools 2.5.2 field for field, and the URL matches devtools:::cran_submission_url (confirmed by printing both).
  • The three offline tests pass with the counts the description gives (94 with R and pigz, 64 without; 41; 12), and shellcheck -x 0.9.0 is clean on .github/actions/*/*.sh (confirmed). actionlint was not available here, so that claim is unverified.
  • tag_commit() resolves an annotated tag to its commit, and the exact ref sorts first among the v3.53.3.9xxx tags that share its prefix (confirmed through the REST API).
  • The pull-request lookup by head=<owner>:<branch> returns nothing for a branch without an open pull request, also for names containing & or # (confirmed through the REST API), so the report does not land on an unrelated pull request.
  • The report comment is matched on author github-actions[bot] plus the marker, so a user quoting the marker in a comment cannot get their comment overwritten or redirect the update (covered by release-report-test.sh:88-91).
  • The description's statements about what is unchanged hold: the diff against main touches only the fourteen new files, and .Rbuildignore already excludes .github.

Generated by Claude Code

The `tag` job of cran-submission.yaml ran three inline shell steps: the NEWS.md section, the existing-tag check, the draft release and the tag push.
They move into .github/actions/cran-tag/cran-tag.sh, unchanged in what they decide, and a composite action runs the script as for the other scripts.
An offline test can then run them against a local remote and a stubbed `gh`.
The script reports through cran-lib.sh like the other scripts, and a failed write now says what it failed at.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
The test pushes a package to a local bare repository and runs the script on its checkout, with a `gh` stub that answers from JSON files and records every write.
It covers a first run, an existing draft, an existing tag on a real run, on a dry run and with `retag`, a published release, a dry run, and a version without a NEWS.md section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
The guard read any failure of `git ls-remote --exit-code` as "no such tag", so a network or authentication error let the job go on to create or retarget the draft release before the tag push was rejected.
Only exit status 2 now means that the tag is absent, and any other status stops the run before anything is written, with or without `retag`.
The offline test points origin at a path that is no repository and checks that the existing draft is neither listed nor touched.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
…release notes

The NEWS.md section ended at the first line starting with `# `, so an R comment in a fenced code block cut the tag message and the release notes short inside the open fence.
The section now ends at such a line only outside a fenced code block, opened by three or more backticks or tildes and closed by at least as many of the same.
The offline test covers a backtick block with a comment line and a tilde block that a shorter backtick fence does not close.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
…hecklist.sh

The step of cran-release.yaml that closes the checklist issue of each published release ran an inline shell loop.
It moves unchanged into .github/actions/release-report/close-checklist.sh, beside the script that finds the issue for the report.
release-report-test.sh now runs it against the same `gh` stub, which also records `-f` fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
…list

The checklist issue was the open issue whose body carried the marker, whoever had opened it.
Since the issues endpoint lists the newest first, anyone's newer issue with the marker, even one quoting it, diverted the nightly report of cran-release.yaml and was then commented on and closed.
release-report.sh and close-checklist.sh now select only issues whose `author_association` is OWNER, MEMBER or COLLABORATOR, and escape the marker inside the jq program.
The offline test adds outsiders' issues, newer than the member's and one quoting the marker, for the report and for the closing step.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
The `docs` job runs with `continue-on-error`, so that its known findings do not turn the release gate red, and with it `needs.docs.result` reads `success` even when the job failed.
The job now ends with a step that runs always and hands `job.status` to the report as the output `result`, which the comment shows, still marked "(reports only)" so that it does not decide the overall result.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
cran-submission.yaml writes the draft and the tag before it builds and uploads, so a run that failed afterwards left a marked draft with a matching tag.
cran-release.sh published such a draft once P3M listed the version, also when the version had reached CRAN some other way.
It now requires the asset `<package>_<version>.tar.gz`, which the `attach-tarball` job adds only after a successful upload, and reports a draft without it as a failure with how to resolve it, publishing nothing.
The offline test covers a draft with another asset and a draft without assets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
The concurrency group of cran-submission.yaml included the ref, so two runs for the same version on different refs could both find no tag and no draft, and each create a draft with the same tag name.
`gh release edit <tag>` and `gh release upload <tag>` then picked whichever draft `gh` found first.
The group is now the workflow alone, and the `tag` job stops when more than one draft carries the tag name, writes the draft by its id, and hands that id on.
`attach-tarball` uploads only when that draft is the one release with the tag, and cran-release.sh publishes by id and refuses a tag that more than one marked draft carries.
The offline tests cover several drafts in the `tag` job and in cran-release.sh, and check the writes by id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
The process says never to run the release workflows on a fork, but nothing enforced it.
A dispatch in a fork with Actions enabled would upload to CRAN and to win-builder under the maintainer's address from DESCRIPTION, and cran-release.yaml would run on its schedule there.
The first jobs of cran-submission.yaml, cran-release.yaml and winbuilder.yaml, the three parallel jobs of release-gate.yaml, and every `report` job now run only when `github.repository` is r-dbi/RSQLite; the jobs that need them are skipped with them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
winbuilder.yaml reported "Uploaded `<tarball>` to: <queues>" also when the queue check or the build failed, and cran-submission.yaml reported "Tarball: `_.tar.gz`, sha256 ``" and the tag name when the run stopped before building or tagging.
The win-builder upload step now writes the queues that took the tarball as the output `uploaded`, and the report names those or says that nothing was uploaded.
cran-tag.sh writes the output `tagged` once the tag is pushed, and the submission report shows the tarball and the tag only when they exist, and "none built" or "none written" otherwise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
The `tag` job, which holds `contents: write`, runs `git-identity@main`, and the build job runs `install@main`, as every workflow of the repository does with cynkratemplate's actions.
A comment at the step records that pinning them is a decision for all workflows rather than for these two.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9

krlmlr commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Review of the fixes at f835ee5 (the 12 commits after 44f0746), by a Claude Code reviewer with clean context that read the first review, the diff 44f0746a..f835ee54 and the resulting files in full, ran the four offline test scripts, shellcheck -x, eleven local mutations of the fixes (each reverted afterwards), a few scratch-directory snippets and two read-only GitHub REST queries, and posted nothing itself. Line numbers refer to that commit. "Confirmed" means reproduced by running code.

No High or Medium findings. I found no path that moves a tag without retag, writes a draft before the tag check, or publishes a draft without a tarball asset, a tag and a matching target. Nothing was dispatched, so every statement about GitHub Actions expression semantics is by reading.

The first review's findings

  • 1: fixed: .github/actions/cran-tag/cran-tag.sh:154-161 treats only status 2 of git ls-remote --exit-code as "absent" and stops on anything else before gh is called at all; confirmed, since reverting the condition makes 4 of the 68 tests in cran-tag-test.sh fail (:311-325).
  • 2: fixed: both release-report.sh:46-48 and close-checklist.sh:36-38 now require author_association to be OWNER, MEMBER or COLLABORATOR; confirmed, since deleting the filter line fails 4 and 2 tests of release-report-test.sh respectively (see new finding 4 for a side effect).
  • 3: partly: the tag job's shell and the checklist-closing loop moved into cran-tag.sh and close-checklist.sh with tests against a bare remote and a stubbed gh (68 and 22 passing here), but the version check (.github/workflows/cran-submission.yaml:163-213) and the sha256 comparison stay inline, and the new release-id check next to it (cran-submission.yaml:397-409) is inline and untested too; I ran that snippet by hand with a stubbed gh in five cases (matching id, empty id, other id, two releases, gh failing) and it behaved correctly in each.
  • 4: fixed for ordinary fenced blocks: cran-tag.sh:103-127 tracks fences, the test at cran-tag-test.sh:369-412 fails when fence tracking is disabled, and the new extractor gives byte-identical output to the old one for all 112 sections of the current NEWS.md (confirmed); see new finding 2 for a case it gets wrong.
  • 5: fixed, by reading: the docs job exports job.status from an always() step (.github/workflows/release-gate.yaml:69-70, :93-100) and the report prefers it (release-gate.yaml:166); a failed job then reads failure (reports only), which release-report.sh:66-69 does not count towards the overall result, as intended.
  • 6: fixed: cran-release.sh:89 reads whether the draft carries <package>_<version>.tar.gz and :193-203 refuses to publish without it; confirmed, since disabling the check fails 7 of the 53 tests (see new finding 1 for the retag case).
  • 7: fixed: the concurrency group is the workflow alone (cran-submission.yaml:121-123), cran-tag.sh:217-220 stops on several drafts and :250-256 writes by id, cran-release.sh:182-188 refuses duplicate marked drafts and :241 publishes by id; confirmed by mutation for the several-drafts stop, the duplicates stop and the publish-by-id call.
  • 8: fixed, by reading: the first job of each workflow and every always() report job carry github.repository == 'r-dbi/RSQLite', and the remaining jobs are skipped through needs.
  • 9: fixed, by reading: the win-builder comment names only the queues that took the tarball (winbuilder.yaml:91-114, :151-152), and the submission comment prints "none built" / "none written" from empty outputs (cran-submission.yaml:453-455); the "Nothing was drafted, tagged or uploaded" message is now true because the tag check precedes every write (see new finding 3 for a cancelled run).
  • 10: not changed, by decision: cran-submission.yaml:238-239 now says why the cynkratemplate actions stay at @main; the first review had it as a consistency note.

New findings

Low

1. After a retag run that fails before its upload, the earlier attempt's tarball still satisfies the new "carries the submitted tarball" check. cran-tag.sh:250-253 updates the existing draft with one PATCH (new target, new notes) and leaves its assets alone, the tag is then moved, and the asset is replaced only at the very end of a successful run (cran-submission.yaml:410-411). If the build or the upload of the retag run fails, the draft targets the new commit, the tag points to it, and the asset is the tarball built from the old commit; cran-release.sh:89 and :193-195 compare the asset's name only, so the nightly run publishes that draft once P3M lists the version. Confirmed for the write side; the rest by reading. It needs an earlier attempt that got as far as attaching, so an upload CRAN accepted but that was never confirmed by e-mail, which is exactly when retag is allowed. Suggested fix: have cran-tag.sh delete the draft's <package>_<version>.tar.gz asset when it updates a draft, or write the tarball's sha256 into the release notes at attach time and have cran-release.sh compare.

2. A NEWS.md line that starts with an inline triple-backtick code span is taken for an opening fence, and the section then runs to the end of the file. cran-tag.sh:105-114 accepts any line starting with three backticks, but CommonMark does not treat a backtick line as a fence when more backticks follow on it. Confirmed with the script's own awk program on a sample whose section contains such a line: the output continues through the next heading and its bullets, so the tag message and the release notes would include every older release. A fence line indented by four spaces has the same effect (confirmed). No section of the current NEWS.md is affected. The closing rules are also not pinned by the tests: replacing either length(f) >= length(open), the same-character test, or the after test at cran-tag.sh:122 with a constant leaves all 68 tests passing (confirmed). Suggested fix: return "" from fence() when the run is backticks and after contains a backtick, and when the line is indented by four or more spaces; add one test line per closing rule.

3. A cancelled or timed-out win-builder run reports "Nothing was uploaded to win-builder." even when a queue already took the tarball. winbuilder.yaml:102 writes the uploaded output once, after the loop over the queues (:93-101); the workflow cancels a run in progress when another is dispatched on the same ref (winbuilder.yaml:24-26), the report job runs on always() (:126), and an empty output prints the "nothing" sentence (:151). By reading. Suggested fix: append uploaded=... to $GITHUB_OUTPUT after each successful queue (the last line for a name wins), and let the report say "unknown" when the job was cancelled.

4. A checklist issue that the new author filter rejects is indistinguishable from no checklist issue. release-report.sh:58-60 and close-checklist.sh:45-47 print a notice and succeed, so nothing tells the maintainers that an issue carrying the marker was skipped. Confirmed for the script, and confirmed through the REST API that issues and pull requests opened by github-actions[bot] in this repository carry author_association: CONTRIBUTOR, so a checklist issue opened by a workflow or a bot would be ignored every night and never closed. Suggested fix: when open issues carry the marker but none passes the filter, emit a ::warning that lists their numbers and associations, and say in the process header that the checklist issue must be opened by a person with access.

Checked and found sound

  • The four offline tests pass: 94 (cran-submit), 68 (cran-tag), 53 (cran-release), 22 (release-report); shellcheck -x 0.9.0 is clean on .github/actions/*/*.sh; all scripts are mode 100755 in the tree, which the direct run: .github/actions/release-report/close-checklist.sh at cran-release.yaml:110 needs; the four workflows and four action.yml files parse as YAML.
  • The regression tests can fail: reverting each of the fixes for findings 1, 2 (both scripts), 4, 6 and 7 (three places) makes between 1 and 7 tests fail; the three surviving mutations are the ones listed in new finding 2.
  • cran-tag.sh performs its checks before its writes in the order its header states: NEWS section, tag on origin, published release, several drafts, then the draft write, then the tag; a failure of gh api when listing releases, or of git fetch for an existing tag, stops the run rather than being read as "none".
  • The jq programs are built safely for their inputs: checklist_issues() escapes backslashes and double quotes in the marker before interpolating it, and the tag names interpolated elsewhere come from DESCRIPTION of the dispatched commit.
  • make_latest is sent as a string and draft as a boolean in the PATCH that publishes (cran-release.sh:241), which is what the releases API expects.
  • The docs status reaches the report whenever the job gets to its last step; if the job dies earlier, the expression falls back to needs.docs.result, which is the previous behaviour.
  • In a fork, attach-tarball is skipped as well: its if has no status function, so it runs only when the jobs it needs succeeded.
  • The workflow-wide concurrency group with cancel-in-progress: false keeps a running submission alive; GitHub keeps at most one pending run per group, so a third dispatch cancels the second while the first runs, which is visible and harmless.
  • No ${{ }} expression was added inside a run: block; the new values reach shell through env: only, and contents: write is still held only by tag, attach-tarball and publish.

Generated by Claude Code

A run dispatched with `retag` retargeted the existing draft and moved the tag, but left the tarball the earlier attempt had attached until its own upload succeeded.
When the build or the upload of that run failed, the draft targeted the new commit and carried the old commit's tarball, and cran-release.sh, which checks the asset by name, would publish it.
cran-tag.sh now reads the id of the draft's `<package>_<version>.tar.gz` and deletes that asset through `gh api` before it updates the draft; a failed deletion stops the run before anything else is written, and a dry run says what a real run would delete.
The offline test checks the deletion by asset id and its order before the update, a failed deletion, and the dry run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
The fence detection took any line starting with three backticks for a fence, so a line starting with an inline code span such as "``` `x` ```" opened a block that never closed, and so did a fence indented by four or more spaces; the section then ran to the end of NEWS.md.
A fence is now indented by at most three spaces, and a backtick fence has no backtick after its run, as in CommonMark.
The offline test gains one case for each rule that opens or closes a block: the length and the character of the closing fence, nothing after it, three spaces of indentation, an inline code span, and four spaces.
Replacing any of these conditions by a constant now makes at least one test fail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
…early

The upload step wrote the queues that took the tarball only after its loop, so a run cancelled or timed out in the middle reported "Nothing was uploaded to win-builder." even when a queue already had the tarball.
The step now writes `uploaded` after each queue that took the tarball, and `finished` once the loop has run to its end.
The report job builds the comment in a step of its own: what the step uploaded when it finished, and otherwise, when the job was cancelled or got past the build, that what win-builder got is unknown, with the queues known to have taken it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
An issue that the author filter rejected was indistinguishable from no checklist issue: the report and the closing step printed a notice and succeeded.
Issues that workflows and bots open in this repository carry the association CONTRIBUTOR, so a checklist issue opened that way would be ignored every night without a trace.
release-report.sh and close-checklist.sh now read the number and the association of every open issue that carries the marker, keep those of an owner, member or collaborator, and, when none is left, emit a warning that lists the others.
The process header in cran-submission.yaml says that a person with access to the repository must open the checklist issue.
The offline test checks the warning in both scripts, and its absence when a checklist issue exists or no issue carries the marker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE

krlmlr commented Nov 10, 2026 •

Copy link
Copy Markdown
Member Author

Superseded: Accepted limitations

Superseded by this comment.

The two reviews above are addressed in the commits up to 731ac47: all Medium findings and all Low findings are fixed, except the ones below. Nothing has been dispatched, so everything GitHub-side rests on the offline tests and on reading.

  • .github/workflows/cran-submission.yaml#L244: git-identity@main runs in the job that holds contents: write, and install@main runs before R CMD build (L294); left at @main for consistency with every other workflow in the repository. Relevance: low; reviewer's confidence: high. (recorded)
  • .github/workflows/cran-submission.yaml#L166: some inline shell has no offline test: the version check, the sha256 comparison, release-id check and upload in attach-tarball (L386, L402, L414), and the win-builder upload loop and report text (winbuilder.yaml L90, L150); each was checked with scratch snippets only. Relevance: medium; reviewer's confidence: high for the release-id check (run by hand in five cases), medium for the rest.
  • .github/actions/cran-tag/cran-tag.sh#L267: the release writes have run only against the gh stub: the asset deletion, the draft write with -F body=@file (L275), and the publishing PATCH by id (cran-release.sh#L241). The first real dry run will exercise them. Relevance: medium; reviewer's confidence: high (by reading the releases API).
  • .github/workflows/winbuilder.yaml#L104: the win-builder report relies on the last value written for an output winning and on a cancelled job's outputs reaching the report; a timeout that loses all outputs would still read "Nothing was uploaded". Relevance: low; confidence: medium (by reading). (recorded)
  • .github/workflows/release-gate.yaml#L97: the docs result relies on job.status under job-level continue-on-error behaving as documented. Relevance: low; confidence: medium (by reading). (recorded)
  • .github/actions/release-report/release-report.sh#L52: the checklist filter trusts the author_association GitHub reports to the workflow token; an issue opened by anyone else, a workflow or a bot included, is ignored with a warning. Relevance: low; reviewer's confidence: high. (recorded)
  • .github/actions/cran-tag/cran-tag.sh#L110: fence indentation is counted from column 0, not from a list item, so a fence inside a deeply indented list item is not tracked; it matters only if a line inside it starts with # at column 0, which no section of the current NEWS.md has. Relevance: low; confidence: high.
  • .github/workflows/cran-submission.yaml#L125: with one concurrency group and cancel-in-progress: false, GitHub keeps only one pending run, so a third dispatch cancels the waiting second one; visible and harmless. Relevance: low; reviewer's confidence: high.
  • .github/actions/cran-tag/cran-tag.sh#L251: on a dry run with an existing tag, the Release section describes the draft a real run would write, although a real run stops first; the Tag section that follows says so. Relevance: low; confidence: high.

Generated by Claude Code

@krlmlr
krlmlr merged commit cd1fed9 into main Nov 10, 2026
8 checks passed
@krlmlr
krlmlr deleted the claude/rsqlite-cran-release branch November 10, 2026 15:26

krlmlr commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Accepted limitations

The two reviews above are addressed in the commits up to 731ac47: all Medium findings and all Low findings are fixed, except the ones below. Nothing has been dispatched, so everything GitHub-side rests on the offline tests and on reading.

  • .github/workflows/cran-submission.yaml#L244: git-identity@main runs in the job that holds contents: write, and install@main runs before R CMD build (L294); left at @main for consistency with every other workflow in the repository. Relevance: low; reviewer's confidence: high. (recorded)
  • .github/workflows/cran-submission.yaml#L166: some inline shell has no offline test: the version check, the sha256 comparison, release-id check and upload in attach-tarball (L386, L402, L414), and the win-builder upload loop and report text (winbuilder.yaml L90, L150); each was checked with scratch snippets only. Where such tests should live is open in Discuss: where offline tests for the shell in workflows and actions live cynkra/cynkratemplate#160, and whether the CI moves to a repository of its own in Discuss: move the CI kit into a repository of its own cynkra/cynkratemplate#161. Relevance: medium; reviewer's confidence: high for the release-id check (run by hand in five cases), medium for the rest.
  • .github/actions/cran-tag/cran-tag.sh#L267: the release writes have run only against the gh stub: the asset deletion, the draft write with -F body=@file (L275), and the publishing PATCH by id (cran-release.sh#L241). The first real dry run will exercise them. Relevance: medium; reviewer's confidence: high (by reading the releases API).
  • .github/workflows/winbuilder.yaml#L104: the win-builder report relies on the last value written for an output winning and on a cancelled job's outputs reaching the report; a timeout that loses all outputs would still read "Nothing was uploaded". Relevance: low; confidence: medium (by reading). (recorded)
  • .github/workflows/release-gate.yaml#L97: the docs result relies on job.status under job-level continue-on-error behaving as documented. Relevance: low; confidence: medium (by reading). (recorded)
  • .github/actions/release-report/release-report.sh#L52: the checklist filter trusts the author_association GitHub reports to the workflow token; an issue opened by anyone else, a workflow or a bot included, is ignored with a warning. Relevance: low; reviewer's confidence: high. (recorded)
  • .github/actions/cran-tag/cran-tag.sh#L110: fence indentation is counted from column 0, not from a list item, so a fence inside a deeply indented list item is not tracked; it matters only if a line inside it starts with # at column 0, which no section of the current NEWS.md has. Relevance: low; confidence: high.
  • .github/workflows/cran-submission.yaml#L125: with one concurrency group and cancel-in-progress: false, GitHub keeps only one pending run, so a third dispatch cancels the waiting second one; visible and harmless. Relevance: low; reviewer's confidence: high.
  • .github/actions/cran-tag/cran-tag.sh#L251: on a dry run with an existing tag, the Release section describes the draft a real run would write, although a real run stops first; the Tag section that follows says so. Relevance: low; confidence: high.

Generated by Claude Code

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants