Repository navigation
fix: generate Ruby 3.1-compatible empty structs (part 2) - #380
Merged
Merged
Conversation
jterapin
added this pull request to stack #382
October 14, 2026 23:25
jterapin
marked this pull request as ready for review
October 15, 2026 21:37
jterapin
requested review from
boblodgett and
sichanyoo
and removed request for
boblodgett and
sichanyoo
October 15, 2026 21:37
richardwang1124
approved these changes
Oct 16, 2026
jterapin
force-pushed
the
ruby-3.1-minimum-part-2
branch
from
October 19, 2026 20:52
d57a8e0 to
4fbd982
Compare
jterapin
force-pushed
the
ruby-3.1-minimum-part-2
branch
from
October 21, 2026 14:56
4fbd982 to
f6612bc
Compare
peterrsongg
approved these changes
Oct 21, 2026
jterapin
added a commit
that referenced
this pull request
Oct 21, 2026
> [!NOTE] > Stacked on [#380](#380), which includes the runtime preparation from [#378](#378). Retarget to `main` after both parents merge. Local validation is complete; GitHub CI is pending. ## Context The gems currently require Ruby 3.3. This lowers the minimum requirement to Ruby 3.1 for the generator, runtimes, server placeholder, and generated client/schema gems. ## Description - Use Rails 7.2 for the generator so its dependency supports Ruby 3.1. - Lower all seven maintained gem requirements and generated-gem metadata to Ruby 3.1, including matching assertions and sample gemspecs. - Add Ruby 3.1, Ruby 3.2, and JRuby 9.4 to both CI matrices, keeping 3.3, 3.4, 4.0, and JRuby 10.0. Exclude the RBS group from spec jobs; keep RBS and lint on Ruby 4.0. - Target Ruby 3.1 in RuboCop, remove the argument-forwarding exclusions, and use `...` forwarding in `PageEnumerator#reduce`. - Match `Tempfile` before `File` in log formatting so JRuby 9.4 retains the temporary-file label. Existing logging examples cover both paths. - Refresh development setup instructions, allow RBS checks on a compatible local Ruby version, and ignore `.bundle/` so local Bundler settings stay out of commits. ## Testing Generator and runtime suites passed in the source checkout on Ruby 3.1.7, 3.2.11, 3.3.11, 3.4.9, 4.0.3, JRuby 9.4.15.0, and JRuby 10.0.7.0. All suites had zero failures; existing pending tests are included below. | Suite | Examples | MRI pending | JRuby 9.4/10.0 pending | | --- | ---: | ---: | ---: | | Generator unit | 517 | 0 | 2 | | Generated endpoints | 76 | 0 | 0 | | Generated protocols | 117 | 0 | 43 | | Client | 919 | 2 | 86 | | Schema | 149 | 0 | 0 | | CBOR | 269 | 0 | 0 | | JSON | 70 | 0 | 7 | | XML | 59 | 0 | 0 | - Fresh Ruby 3.1 bundle resolved Rails 7.2.4 and SimpleCov 0.22.0 with the RBS group excluded. A subsequent audit parsed all 399 tracked Ruby and gemspec files and reran every generator/runtime suite with zero failures. - Verified `.bundle/config` is ignored and `git diff --check` passes. - RBS on Ruby 4.0: generator 127 unit, 76 endpoint, and 117 protocol examples; client 867 examples (2 existing pending); schema 149; CBOR 269; JSON 70; XML 59. Zero failures. - Ruby 3.1 runtime/generated-package checks passed: empty/populated types, a stubbed CBOR operation, and client-only loading without the generator. Clean installed-generator loading still raises `LoadError` because its existing source-relative CBOR protocol path requires the repository layout; the packaging fix is deferred with a TODO. - Server placeholder parsed and loaded on Ruby 3.1. Maintained sample gemspecs matched actual regeneration from unchanged models. - Downstream AWS protocols on Ruby 4.0: 1,106 examples, zero failures, 4 existing pending tests, using local Smithy source through a temporary bundle. - RuboCop: 374 files, no offenses. Workflow YAML validation and `git diff --check` passed. - Forwarding cleanup: client specs (919 examples, 2 existing pending), client RBS (867 examples, 2 existing pending), and RuboCop passed on Ruby 4.0.3. All four `reduce` calling forms passed on Ruby 3.1.7, JRuby 9.4.15.0, and JRuby 10.0.7.0. 🤖 This PR description was drafted with AI assistance for @jterapin. ✨
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.
Description
Generated structs with no fields fail to load on Ruby 3.1 and 3.2. This affects empty modeled structures and services with no endpoint parameters.
This preparation step keeps all published and generated gem minimums at Ruby 3.3.
Fix
Testing
Suites ran on Ruby 4.0.3:
git diff --checkpassed.🤖 This PR description was drafted with AI assistance for @jterapin. ✨