fix: nullable MaxPeriods response + migrate off Stainless build#9
Merged
Conversation
The CloudPayments API returns "MaxPeriods": null for subscriptions with no payment limit (unlimited recurring payments), but the response model typed max_periods as a non-nullable Integer. Mark it nullable so the runtime type framework, RBS and RBI all reflect the value the API actually returns. Response model only — the create/update request params stay non-nullable, since per the API docs "no limit" is expressed by omitting maxPeriods, not by sending null. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Stainless wound down its hosted SDK generator, so the gem is now hand-maintained. Remove the Stainless-only build job (it was gated on the stainless-sdks mirror repo and uploaded artifacts to pkg.stainless.com) and the codegen/stl-preview branch plumbing from CI; lint and test now run on normal pushes and pull requests. Add a release-please workflow using the official googleapis action so release PRs and GitHub releases are created from conventional commits, and retarget release-please-config.json from the Stainless fork to the official schema (dropping prerelease mode and the Stainless-only ruby-readme updater in favor of the standard generic README updater). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Background
Stainless is winding down its hosted SDK generator, so this gem is no longer auto-regenerated from the
Hexlet/cloudpayments-apiTypeSpec spec — it is now hand-maintained. This PR does two things.1.
fix: nullableMaxPeriodsin the subscription response modelThe CloudPayments API returns
"MaxPeriods": nullfor subscriptions created without a payment limit (unlimited recurring payments). The response model (CloudpaymentsRuby::Models::Subscription) typedmax_periodsas a non-nullableInteger, mismatching a value the API actually returns.lib/.../models/subscription.rb:optional :max_periods, Integer, nil?: truesig/.../models/subscription.rbs+rbi/.../models/subscription.rbi:max_periodswriter / constructor / shape become nilable (readers were already nilable).Scope: response model only. The
create/updaterequest params stay non-nullable — per the API docsmaxPeriodsis optional and "no limit" is expressed by omitting the field, not by sendingnull. (Matches the corresponding spec change: Hexlet/cloudpayments-api#2.)2.
ci: drop the Stainless build, add release-pleaseci.yml: removed thebuildjob (gated on thestainless-sdks/*mirror, uploaded artifacts topkg.stainless.com) and thecodegen/**/stl-preview-*branch plumbing.lintandtestnow run on normal pushes tomainand on PRs.release-please.yml(new): officialgoogleapis/release-please-action@v4, opening release PRs and cutting GitHub releases from conventional commits.release-please-config.json: retargeted from the Stainless fork schema to the official one; droppedprereleasemode and the Stainless-onlyruby-readmeupdater (replaced with the standardgenericREADME updater that understands the existingx-release-please-*markers).A published GitHub release still triggers the existing
publish-gem.yml→ RubyGems.Verification
Locally with the gem's own scripts:
./scripts/lint(Sorbet + RBS + RuboCop) clean,./scripts/testgreen (84 runs, 0 failures). Workflow YAML and config JSON validated.🤖 Generated with Claude Code