Repository navigation
CI: run codegen checks and E2E on macOS and Windows - #50
Merged
devin-ai-integration[bot] merged 10 commits intoNov 3, 2026
Merged
Conversation
…ilt WASM Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…gger in Gemfile.e2e for Ruby 4.0 Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
…eadlock); Windows plugin.cmd path with backslashes Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
…n wins on PATH; document the new coverage Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
…one on Windows); E2E: read .rbs files before fibers run, no fiber overlap expected from mysql2 on Windows; Windows mysql2 build points at mariadb_config Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
…e E2E gems per runner image Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
…nested bundle install on Windows Ruby 3.1) Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
devin-ai-integration
Bot
deleted the
devin/1793743129-cross-platform-ci
branch
November 3, 2026 23:24
4 tasks done
devin-ai-integration Bot
added a commit
that referenced
this pull request
Nov 4, 2026
…ransactions and late PostgreSQL enum arrays (#53) ## Summary This fixes the five bugs found by the latest independent pre-release check. Each bug has a new E2E test in `tests/end2end_*.rb`, and each of those tests fails on `main` until its fix is applied. | Bug | Test | Fix | |---|---|---| | With a table `exceptions`, a raise inside `transaction` committed instead of rolling back, because the generated `Exception` model shadowed `::Exception` (all engines) | `test_models_named_like_core_constants_do_not_shadow_them` (pg, mysql2, sqlite3) | Generated Ruby and RBS now refer to core and driver constants with a leading `::` (`::Exception`, `::Thread`, `::Data`, `::Struct`, `::Set`, `::Monitor`, `::PG`, `::ConnectionPool`, ...), in the driver templates and in `TypeResolver#driver_type` | | Other table names (`data`, `structs`, `threads`, `processes`, `standard_errors`, `sets`, `strings`, `integers`, `times`, `encodings`, `monitors`, `mutexes`, `connection_pools`) broke loading, transactions or the logger | same test. The example schemas now include 14 tables with these names | same fix | | SQLite `:execresult` with `RETURNING` never ran the statement | `test_execresult_with_returning_runs_the_statement` (sqlite3), new `CreateTagResult` query | `Sqlite3#exec_result_lines` now runs the statement to the end (`.to_a`) when it returns columns | | A `tx` used from an `Enumerator`, `Fiber`, `Thread` or `Async` task ran its queries on another pooled connection, outside the transaction (pg, mysql2). SQLite raised `ThreadError` or hung | `test_transaction_query_object_works_from_other_fibers_and_threads` (pg, mysql2, sqlite3) | `transaction` now yields a copy of the query object bound to a `TransactionConnection`. It runs queries from any fiber or thread one at a time (mutex), unlocks while a nested savepoint block runs, and raises `TransactionEnded` once the transaction is over. The README documents that other query objects used from other fibers still run outside the transaction | | PostgreSQL enum arrays came back as a raw `"{a,b}"` string when the enum was created after the connection was configured | `test_enum_arrays_of_a_type_created_after_connecting_are_decoded` (pg, `late` schema) | Unknown result oids now fall back to a `NewTypes` (`PG::TypeMapInRuby`) map. It looks each oid up in `pg_type` once per connection, so arrays of the type become `Array[String]` | Behavior change: the `tx` yielded by `transaction` is no longer `self`. Code that keeps `tx` after the block now gets `TransactionEnded` instead of silently running outside the transaction. Also in this PR: - `tests/rbs_types.rb` strips the leading `::` from RBS types before checking them. - Examples, golden files, `test/fixtures/*.bin` and `steep_expectations.yml` are regenerated. - `README.md`, `docs/Coverage.md` and `docs/Testing.md` are updated. - `main` is merged in, including the cross-platform CI from #50. ## Checklist - [x] `examples/` is regenerated (`rake sqlc_generate_process`) and committed - [x] Tests added or updated (`rake test`, and `rake end2end_*` when the generated code changes) - [x] The generated code stays RuboCop-clean (`rake rubocop`) and Steep-clean (`rake steep`) - [x] Labelled (`bug`, `enhancement`, `documentation`, or `breaking`) so the release notes are grouped correctly --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Doron Eli Rachman <doron050@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI now runs the codegen checks and every E2E suite on macOS and Windows as well as Linux. A new reusable workflow,
.github/workflows/cross-platform.yml, is called frombuild.ymlafterbuild-wasm. It downloads theplugin.wasmbuilt on Linux (the artifact a release publishes) and runs that exact file through sqlc on each OS.Matrix (OS × Ruby × DB)
pg)mysql2)sqlite3)tests.yml, unchanged)macos-latest)ankane/setup-postgres)ankane/setup-mysql)windows-latest)ankane/setup-postgres; the only version on windows-2025)Every macOS/Windows × Ruby cell runs two jobs in parallel:
sqlc diffwith the Linux-built WASM and again with the process plugin (exe\plugin.cmdon Windows), plus the WASM codegen check for that Ruby version.pg/mysql2/sqlite3gems, then the generator-options E2E.Why only Ruby 3.1 and 4.0 on macOS/Windows: they are the oldest and newest supported versions. 3.1 is the
Structcode path and has the old Bundler/default gems; 4.0 is theDatapath with the newest stdlib/bundled-gem split. Ruby-version-specific behaviour is already covered on every version on Linux. What macOS/Windows add is OS behaviour (paths, line endings, native gems, client libraries, the fiber scheduler), and the two ends of the range cover that.The setup actions are pinned by SHA (
ankane/setup-postgres@b1a598d…,ankane/setup-mysql@4aa1b08…,sqlc-dev/setup-sqlc@bac53b7…). MySQL getsSET GLOBAL local_infile = 1for:copyfrom.Hard limits
Every job in
build.yml,tests.yml,cross-platform.yml,docs.ymlandrelease.ymlnow hastimeout-minutes: 10. The slowest job is currently 3m49s.CI duration
main(60a6d90)These changes cut the first version's time:
sqlc diff(~1 min on Windows) are off the E2E critical path, and the Codegen jobs need no database setup.actions/cache, keyed on runner image + Ruby +Gemfile.e2e). On Windows, prism, mysql2 and date compile from source, which took ~2 min per job. The key includes the image version because the native extensions link against the image's libraries.The remaining Windows time goes mostly to the MySQL suite (~1 min:
mysql2queries don't overlap there, see below), PostgreSQL/MySQL/Ruby setup (~1.5 min) and the generator-options E2E. Linuxtests.ymlis unchanged (~1.5 min) and runs in parallel.OS-specific bugs found
:copyfromcorrupted rows containing Ctrl-Z (0x1A) on Windows. The client library reads theLOAD DATA LOCAL INFILEtemp file in text mode on Windows, where a raw Ctrl-Z ends the file. The generatedcsv_linenow writes it as\Z, which MySQL decodes back to0x1Aon every OS.examples/mysql2and the golden files are regenerated, andtest_seeded_random_copyfrom_round_trip_and_duplicate_is_atomicgot a Ctrl-Z row. Before the fix, the seeded random binary payloads failed on Windows.exe/plugin.rbcannot be executed directly there. The newexe/plugin.cmd(@ruby "%~dp0plugin.rb" %*, CRLF) wraps it. It must be referenced asexe\plugin.cmdbecause sqlc runs it throughcmd.exe, which parsesexe/plugin.cmdas a switch.mysql2queries don't run concurrently underSyncon Windows. The pooled queries ran serially there (1.58s concurrent vs 1.55s serial). Themysql2C extension blocks the thread on Windows instead of yielding to the fiber scheduler. Results are still asserted on Windows; only the overlap assertion runs off Windows. The README's async note now says so.sleepheld its mutex. The test now closes it inteardown.tests/rbs_types.rbhitFile.read→EBADFunder the fiber scheduler on Windows Ruby 3.1. It now reads the.rbsfiles before queries run.Gemfile.e2eneedsloggerandbigdecimalon Ruby ≥ 3.4/4.0, where they are no longer default gems.ankane/setup-mysqlfails on windows-2025 (EPERMrenaming over the preinstalled 8.4), so the job starts the image's MySQL instead.mysql2is built against MSYS2'slibmariadbclientwith--with-mysql-config, because its extconf can't findmariadb_config.exethrough PATH.mysql2gets--with-opt-dirfor Homebrew's openssl/zstd..gitattributeskeeps LF everywhere, sosqlc diffand the golden tests stay byte-for-byte equal on Windows checkouts.scripts/wasm/update_sha.shfalls back toshasum -a 256.docs/Testing.mdandCLAUDE.mddescribe the new jobs. The README changed only for themysql2/Windows async note; it makes no other platform claims.Checklist
examples/is regenerated (rake sqlc_generate_process) and committedrake test, andrake end2end_*when the generated code changes)rake rubocop) and Steep-clean (rake steep)bug,enhancement,documentation, orbreaking) so the release notes are grouped correctly