Skip to content

ci: Provide a PostgreSQL server to the R-hub and revdep2 checks - #680

Open
krlmlr wants to merge 5 commits into
mainfrom
claude/ci-postgres-rhub-revdep
Open

krlmlr wants to merge 5 commits into
mainfrom
claude/ci-postgres-rhub-revdep

Conversation

@krlmlr

@krlmlr krlmlr commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

A stopgap for the checks of RPostgres (#677, #678), to be aligned with cynkratemplate later. The R-hub and reverse-dependency checks had no PostgreSQL server, so test-DBItest.R failed in the R-hub containers, no database code ran under the sanitizers or valgrind, and revdeps whose tests use a server when one is there skipped those tests. Only files under .github/workflows/ change. The branch is up to date with main (merged, not rebased).

What changed:

  • rhub.yaml, linux-containers job: a postgres:17 service container with a health check, and job-level PGHOST, PGPORT, PGUSER, PGPASSWORD and PGDATABASE that point libpq, and so postgresHasDefault() and DBItest, at it. The nosuggests job keeps PGHOST empty and so has no server, like CRAN's noSuggests check: with a server, the postgresWaitForNotify() example failed on library(callr) there, and re-building the work-queue vignette hung for 40 minutes until the run was cancelled (run 46315715930).
  • rhub.yaml, other-platforms job (macOS and Windows VMs): ankane/setup-postgres@v1 with Postgres 17 and a database named after the runner's user, as in the rcc workflow's custom/after-install hook.
  • rhub.yaml, both jobs: RPOSTGRES_REQUIRE_SERVER=true wherever a server is started (not for nosuggests; the exclusion matches the matrix label, which r-hub/actions/setup emits as nosuggests, as the job name in run 46320044886 shows). The resubmission branch v1.5-reed gates test-DBItest.R on this variable, set by custom/after-install there, so that an unreachable server fails the check instead of skipping DBItest. main does not have that gating yet and still runs DBItest whenever GITHUB_ACTIONS is true, so the variable is unused on main today and takes effect once the gating is merged.
  • revdep2.yaml, test job (every shard, on the runner host): ankane/setup-postgres@v1 with Postgres 17, a database named after the runner's user, and PGHOST, PGPORT, PGUSER and PGDATABASE in $GITHUB_ENV; the step checks the connection with psql. RPOSTGRES_REQUIRE_SERVER is not set there, since revdep2 checks the reverse dependencies and never runs RPostgres's own tests.

revdep4.yaml is not adapted, because it cannot be done cleanly from this repository. Its test job runs on the VM, but every check half runs in its own docker run --network bridge container started by cynkratemplate's revdepx/check-half.sh. That script forwards only a fixed list of environment variables (NOT_CRAN, RGL_USE_NULL and the _R_CHECK_* settings), with no extension hook, so PG* variables set in the workflow never reach the checks, and inside the container libpq's defaults (a Unix socket, user revdepx) find no server. A server on the runner, from ankane/setup-postgres or a services: container, also listens where the bridge network does not reach it by default. Adapting revdep4 needs a change in cynkratemplate: forward PG* (or a configurable list) from check-half.sh, and give the containers a route to a server, for example --add-host host.docker.internal:host-gateway with a server that listens on the bridge. revdep.yaml is unchanged as well.

Validation:

Still a draft: the first clean review found two Medium issues, both fixed. The fixes have not been reviewed yet.

https://claude.ai/code/session_01Hr1rd43pnoHuAnGBgMih89



Generated by Claude Code

The R-hub container jobs get a postgres:17 service container and the PG*
variables that point libpq at it, the R-hub VM jobs and the revdep2 shards
get ankane/setup-postgres with a default database. A stopgap for the 1.5.0
release (#677, #678), to be aligned with cynkratemplate later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd43pnoHuAnGBgMih89
…lth check as postgres

With the server, the nosuggests check failed the postgresWaitForNotify()
example on library(callr) and hung re-building the work-queue vignette.
CRAN's noSuggests check has no server either.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd43pnoHuAnGBgMih89
…evdep2's sampler comment with its step

R-hub's server checks set RPOSTGRES_REQUIRE_SERVER=true, so that DBItest fails rather than skips once the test gating reads it.
The `nosuggests` container leaves it unset, as it has no server.
In revdep2, the server setup now comes before the comment block that belongs to the resource sampler.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd43pnoHuAnGBgMih89
@krlmlr krlmlr changed the title ci: Provide a PostgreSQL server to the R-hub and revdep checks ci: Provide a PostgreSQL server to the R-hub and revdep2 checks Nov 30, 2026
@krlmlr
krlmlr marked this pull request as ready for review November 30, 2026 22:10

This branch has not been deployed

No deployments
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