Skip to content

ci: Provide a MariaDB server to the R-hub and revdep2 checks - #662

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

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

Conversation

@krlmlr

@krlmlr krlmlr commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

A stopgap for the 1.4.0 release (#660, #661): the R-hub checks and the reverse-dependency checks had no database server, so the DBItest suite and the other server tests failed or skipped there, and no database code ran under the sanitizers or valgrind. To be aligned with cynkratemplate later. Only files under .github/ change, so the package tarball is unaffected. The branch is current with main.

The R-hub container jobs get a mariadb:11.8 service container with a health check, and a first step that adds an [rs-dbi] group to ~/.my.cnf pointing the default connection at it. Like the VM jobs and custom/after-install, the service has a utf8 test database and the Europe/Zurich global time zone; since the job container has no MariaDB client, the health check applies that SQL inside the service container (from the RMARIADB_INIT_SQL variable), so the service turns healthy only once it has, and it repeats idempotently with every health check. The R-hub VM jobs (macOS, Windows, Linux) and the revdep2 shards, which run on the runner itself, get ankane/setup-mariadb with the test database and time zone info, as in the rcc workflow's custom/after-install hook. R-hub offers no ARM64 Windows platform, the one runner setup-mariadb does not serve. On macOS, setup-mariadb puts MariaDB's mysql_config on the PATH, so the package links MariaDB's client, which handles the unix_socket authentication of the runner's user; the password user that custom/after-install creates serves only its Homebrew mysql-client configuration, which R-hub does not run. The macos-arm64 job of run 46317677961 confirms it: configure used MariaDB's mysql_config and linked -lmariadb from Homebrew's [email protected], and the check passed with DBItest; Intel macos has not been run and is expected to behave the same. In revdep2, the database step fails when the server is not reachable (shell: bash runs with -e), and its last call connects as the runner's user, as the default connection does.

Both R-hub jobs set RMARIADB_TEST_SERVER=true, for the test gating from the v1.4-tide branch (tests/testthat/helper-server.R), which makes the server tests and DBItest fail rather than skip when the server is unreachable. It takes effect once that gating is on main; until then nothing reads it, and DBItest runs whenever GITHUB_ACTIONS is true. The revdep2 shards do not set it, since they check reverse dependencies, not RMariaDB's own tests.

Accepted limitation: in revdep2, the two halves of a reverse dependency (CRAN release and dev build of RMariaDB) run concurrently against the same server and the same test database, so a revdep whose tests use fixed table names may collide with its other half and show a spurious difference. A database per half would need the cynkratemplate driver to give each half its own HOME or client options file, which it does not offer; revdep4 runs the halves sequentially and would not have this problem.

revdep4 is not adapted, because it cannot be done cleanly from this repository. Each check runs in its own docker run container started by cynkratemplate's revdepx/check-half.sh, which RMariaDB's workflow cannot extend: the container gets --network bridge, so its loopback is its own and a server that setup-mariadb starts on the runner's localhost is unreachable; its HOME is a fresh per-check directory, so a ~/.my.cnf written on the runner is not seen; and the environment it receives is a fixed list in that script, with no way to add a variable, a mount or a docker run option. Giving revdep4 a server needs a change in cynkratemplate, for example a hook for extra docker run arguments or an options file mounted into each check container, plus a server reachable from the bridge network such as a MariaDB container on a user-defined network.

Validation: actionlint 1.7.7 finds nothing in rhub.yaml; for revdep2.yaml and revdep4.yaml it reports only what main already has (the ubuntu-26.04 label it does not know, and more than ten workflow_dispatch inputs, a limit GitHub has since raised). Earlier runs on the pre-merge head: R-hub https://github.com/r-dbi/RMariaDB/actions/runs/46317677961 on the default platforms plus macos-arm64 and windows: gcc-asan, clang-asan, clang-ubsan, valgrind, macOS and Windows each [ FAIL 0 | WARN 1 | SKIP 43 | PASS 9115 ], nosuggests [ FAIL 0 | SKIP 35 | PASS 254 ] (no DBItest), rchk clean; no sanitizer report and valgrind ERROR SUMMARY: 0 errors. revdep2 https://github.com/r-dbi/RMariaDB/actions/runs/46317709541 (which: most, depth: 1, commit: false, ref a6e3f9f): the shards reach the server (11.8.10-MariaDB-ubu2604 runner@localhost). These runs predate the merge of main, the RMARIADB_TEST_SERVER setting and the service initialization; the merge brought no workflow changes. A nosuggests R-hub run on the current head checks the service initialization: https://github.com/r-dbi/RMariaDB/actions/runs/46524652161.

A clean review's first round is addressed here; the PR stays a draft until its fixes are reviewed.

https://claude.ai/code/session_01Hr1rd43pnoHuAnGBgMih89


Generated by Claude Code

The R-hub container jobs get a mariadb:11.8 service container and an
`[rs-dbi]` group in `~/.my.cnf` that points the default connection at it,
the R-hub VM jobs and the revdep2 shards get ankane/setup-mariadb with the
`test` database and time zone info, as in the `rcc` workflow. A stopgap for
the 1.4.0 release (#660, #661), to be aligned with cynkratemplate later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd43pnoHuAnGBgMih89
Set RMARIADB_TEST_SERVER in both R-hub jobs, which start a server,
so that the tests that need it run, DBItest included, and fail rather than skip where they cannot connect,
once the test helpers read the variable.
Correct the comment on ARM64 Windows: R-hub has no such platform.

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 MariaDB server to the R-hub and revdep checks ci: Provide a MariaDB server to the R-hub and revdep2 checks Nov 30, 2026
…ents

The R-hub service container now gets the `utf8` `test` database and the Europe/Zurich global time zone
that the VM jobs and `custom/after-install` set,
applied by its health check, since the job container has no MariaDB client.
The comment on RMARIADB_TEST_SERVER says that it takes effect once the gating from `v1.4-tide` is on main.
The VM job explains why macOS needs no password user,
and revdep2 says that its database step fails when the server is not reachable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd43pnoHuAnGBgMih89
@krlmlr
krlmlr marked this pull request as ready for review November 30, 2026 22:17

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