Skip to content

ci: Check URLs in a job of their own, and skip the release workflows in forks without naming the repository - #899

Closed
krlmlr wants to merge 7 commits into
mainfrom
claude/release-gate-url-check
Closed

krlmlr wants to merge 7 commits into
mainfrom
claude/release-gate-url-check

Conversation

@krlmlr

@krlmlr krlmlr commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

The release gate's soft job runs urlchecker::url_check() through BristolMyersSquibb/blockr.ci's release-soft action, but in the release of RSQLite 3.54.1 (#893) its log showed no URL output at all. The action did run the check; it prints to the log only when it finds problems, and its "all URLs resolve" line goes to the step summary only, which the release-gate comment on the release pull request does not carry. The release session also cannot reach the documentation hosts through its proxy, so a reviewer had no visible evidence either way. This PR adds a job of its own for the URL check.

The new urls job in .github/workflows/release-gate.yaml installs only urlchecker, knitr and rmarkdown (urlchecker refuses to read the vignettes without their builder) plus pandoc, runs urlchecker::url_check(".", fail = FALSE) on the checkout, prints the result to the log, and writes a table to the job summary with the file and line, the URL, the status and message, and the suggested replacement, with HTML, pipes and backticks escaped. It goes red on any broken URL, any redirect (CRAN asks for a 301 to be replaced by its target) and any non-canonical CRAN URL. Like docs, it only reports: it runs with continue-on-error and hands its own status to the report job, so the release-gate comment shows urls: <status> (reports only) and a red urls job does not fail the gate, since a third-party host can be down for a moment. The header comment describes the job, and the soft job keeps its own URL check.

The PR also makes the release workflows copyable into other packages without editing their guards: every job of release-gate, cran-submission, cran-release and winbuilder now skips in a fork by checking !github.event.repository.fork instead of github.repository == 'r-dbi/RSQLite'. A scheduled run's payload has no repository, so the guard lets it through; GitHub runs no workflow in a fork until its owner enables Actions there, as cran-release.yaml's header now says. The action tests pass (cran-release 53, cran-submit 64, cran-tag 94, release-report 27).

Validation: the workflow parses as YAML, and actionlint reports nothing new compared with main. The release-report tests pass (27 of 27). The R step ran locally on a fake result with a 301, a 404, a non-canonical CRAN URL, and a |, a backtick and HTML in the values. On GitHub, on c64c0fb, urls succeeded with "All URLs are correct!"; gate fails there only because main carries a development version. A clean review found nothing above Low after the escaping fix.

Once merged, the release branch of #893 merges main and the release gate runs there.

https://claude.ai/code/session_01Hr1rd6znpbaJUu6TJLjgQC


Generated by Claude Code

The URL check of the `soft` job prints to the log only when it finds a problem,
and writes its all-clear only to the job summary,
so the 3.54.1 release run showed no URL output at all,
and a release session cannot reach the documentation hosts to run the check itself.

The new `urls` job runs urlchecker::url_check() on the checkout,
prints the result to the log,
lists every broken or redirected URL with file and line, status, and replacement in the job summary,
and fails on any of them.
Like `docs`, it reports without holding up a release,
and its status appears in the release-gate comment on the release pull request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd6znpbaJUu6TJLjgQC
…the job only reports

Server messages could carry HTML, and URLs could carry backticks
that end the code span early.

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

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

❌ Release gate: failure

Run #7 (attempt 1, workflow_dispatch) on claude/release-gate-url-check at 99cd6b6241, 2026-11-14 20:44 UTC.

  • gate: failure
  • docs: success (reports only)
  • soft: success
  • urls: success (reports only)

The run's summary page has the details. Later runs of this workflow update this comment.

krlmlr commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

The red "Hard gates" job in the release-gate runs dispatched on this branch is expected and not this PR's: the branch is based on main, which carries the development version 3.53.3.9023, and the gate's first check is "Version has exactly three components". The run that matters here is the urls job; the first run stopped before checking anything because urlchecker needs the vignette builder (knitr) installed, fixed in c64c0fb, and the run on c64c0fb is in progress.


Generated by Claude Code

krlmlr commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

The run on c64c0fb shows the new job working: urls succeeded, and its log reads "✔ All URLs are correct!" after urlchecker found knitr. docs and soft are green; gate fails only on the development version of main, as expected. Ready to merge from my side; once it is in main, I merge main into the release branch of #893 and run the release gate there.


Generated by Claude Code

Comment thread .github/workflows/release-gate.yaml Outdated
Comment on lines +147 to +148
if: github.repository == 'r-dbi/RSQLite'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only here? Will be copied to all repos later.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, the guard should not name the repository. 99cd6b6 replaces github.repository == 'r-dbi/RSQLite' with !github.event.repository.fork in every job of all four release workflows (release-gate, cran-submission, cran-release, winbuilder), so they copy into another package without edits to the guards. One caveat, stated in cran-release.yaml's header: a scheduled run's payload has no repository, so the guard lets it through; GitHub runs no workflow in a fork until its owner enables Actions there. The action tests pass (cran-release 53, cran-submit 64, cran-tag 94, release-report 27), actionlint reports nothing new, and the release gate runs again on 99cd6b6 from this branch.

The header comments still name RSQLite in examples (gh workflow run ... --repo r-dbi/RSQLite, the CRAN check page, the NEWS heading); those are documentation and read naturally per package, so I left them.


Generated by Claude Code

Every release job checked `github.repository` against r-dbi/RSQLite,
so a copy into another package had to edit each guard.
The jobs now check `github.event.repository.fork`, which needs no edit.
A scheduled run carries no fork flag, which the header of cran-release.yaml states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd6znpbaJUu6TJLjgQC
@krlmlr krlmlr changed the title ci: Check URLs in a job of their own in the release gate ci: Check URLs in a job of their own, and skip the release workflows in forks without naming the repository Nov 14, 2026

krlmlr commented Nov 14, 2026 •

Copy link
Copy Markdown
Member Author

Accepted limitations

The clean review of the fork guard (99cd6b6) found no High issue; its wording point is fixed in 89d0c62, which no longer claims that a scheduled run's payload lacks the fork flag. The "Hard gates" failure on 99cd6b6 is the same expected one as before (development version on main).

  • .github/workflows/cran-submission.yaml L136 and the other guards: !github.event.repository.fork skips only real GitHub forks. A copy that is not a fork, such as a mirror or a repository pushed from a clone, now runs the release jobs as the repository itself would, where the old guard skipped everything outside r-dbi/RSQLite. A submission from such a copy still needs the maintainer to follow CRAN's confirmation link, and the upload uses the maintainer address in DESCRIPTION. This is the price of copyable workflows; a fix would add && github.repository_owner == '<owner>', naming the owner again. Relevance: low; confidence: high.
  • .github/workflows/cran-release.yaml L50: if a scheduled run's payload lacks repository, the guard lets the run through, also in a fork where its owner enabled Actions; the publish step then acts only on that fork's own drafts. Relevance: low; confidence: medium (the schedule payload was not verified against GitHub's documentation).

Generated by Claude Code

@krlmlr krlmlr mentioned this pull request Nov 15, 2026
16 of 22 tasks
@krlmlr

krlmlr commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

We don't need to gate forks in workflows that we only dispatch. In some cases, the parent org doesn't have full access for the Claude app, and the release will happen from a fork, with subsequent cleanup.

A release can run from a fork when the repository itself is out of reach,
so release-gate, cran-submission and winbuilder no longer skip their jobs there.
cran-release keeps its guard, because it also runs on a schedule.

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

krlmlr commented Nov 15, 2026 •

Copy link
Copy Markdown
Member Author

Done in c4e04e4 and 3f071e4: release-gate, cran-submission and winbuilder no longer skip their jobs in a fork, and their report jobs run on always().

cran-release keeps its guard, because it also runs nightly on a schedule, and a fork with Actions enabled would otherwise try to publish its drafts every night. As a consequence, after a release from a fork, pushing the tag to this repository and publishing the draft release are part of the cleanup; the header of cran-submission.yaml now says so. In a fork, the report jobs find no open release pull request there and exit green without posting.


Generated by Claude Code

krlmlr commented Nov 27, 2026

Copy link
Copy Markdown
Member Author

Closing as superseded by #908, which replaced the four release workflows edited here with thin callers of krlmlr/r-release-actions. Its release gate already reports every URL urlchecker flags, with its answer, in its comment on the release pull request, and a fork guard that skips release jobs in every fork would stop packages that release from their fork.


Generated by Claude Code

@krlmlr krlmlr closed this Nov 27, 2026
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