Repository navigation
chore: Add CRAN submission and release workflows - #820
Conversation
… at 86ac17f6b Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
… 86ac17f6b Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
…-r at 86ac17f6b Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01R97hjbWAywVPMLidsfQuS9
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
|
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
|
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 Medium1. The "tag exists" guard fails open: any 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. Low3. 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 4. A line starting with 5. 6. 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 ( 8. Nothing enforces "never on a fork". The header says so ( 9. The report comments state things that did not happen when a job fails early. 10. The jobs that tag and build the submitted tarball run third-party actions at a moving ref. Checked and found sound
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
|
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 No High or Medium findings. I found no path that moves a tag without The first review's findings
New findingsLow1. After a 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. 3. A cancelled or timed-out win-builder run reports "Nothing was uploaded to win-builder." even when a queue already took the tarball. 4. A checklist issue that the new author filter rejects is indistinguishable from no checklist issue. Checked and found sound
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
Superseded: Accepted limitationsSuperseded 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.
Generated by Claude Code |
Accepted limitationsThe 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.
Generated by Claude Code |
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 withworkflow_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.shand its offline test).dry-run,allow-dev-versionandretag; one run goes at a time, and on a fork every job is skipped.RSQLite <version>from that version's NEWS.md section, with the marker<!-- cran-submission: RSQLite <version> -->, and tagsv<version>. It writes nothing when the tag exists (withoutretag), 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.R CMD build, recompresses it with zopfli (pigz -11), verifies it and keeps it as an artifact.devtools:::upload_cran()does, with the one-line commentRSQLite <version>..github/workflows/cran-release.yaml, with the local action.github/actions/cran-release/(cran-release.shand its offline test).<!-- 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..github/workflows/release-gate.yamland.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 whoseclose-checklist.shcloses the checklist issue once the release is published.cran-release.yamlposts 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.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'shandbook/operations/releases/cran/README.mdandprocess/README.md.Commits
R CMD build, because the vignette needs them;v<version>tag.retaginput is only for a submission CRAN never received: it prints the old commit, then moves the tag.attach-tarballjob withcontents: writeruns 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.scripts/into local actions under.github/actions/, and^scripts$leaves.Rbuildignore.cran-*push triggers go, so every release run is dispatched by hand, and the result-reporting comments are added.cran-comments.mdorfledge::bump_version().# RSQLite <version>, with no date.maingets a development version and a compare link.cran-release.yamlreports to the checklist issue and closes it once the release is published, using the newpublishedstep output.The template workflows (R-CMD-check, rhub, pkgdown, revdep) are unchanged.
Validation
cran-submit-test.sh: 94 passed, including the realR CMD buildandpigzpath.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 stubbedgh, and covers a fresh tag, an existing draft (including the removal of an earlier tarball), several drafts, an existing tag (real run, dry run,retagdry 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..github/actions/*/*.sh.ubuntu-26.04runner label and the missingdescriptionin the existing custom actions.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