Skip to content

fix: nullable MaxPeriods response + migrate off Stainless build#9

Merged
mokevnin merged 2 commits into
mainfrom
fix/subscription-maxperiods-nullable
Jun 26, 2026
Merged

fix: nullable MaxPeriods response + migrate off Stainless build#9
mokevnin merged 2 commits into
mainfrom
fix/subscription-maxperiods-nullable

Conversation

@mokevnin

Copy link
Copy Markdown
Member

Background

Stainless is winding down its hosted SDK generator, so this gem is no longer auto-regenerated from the Hexlet/cloudpayments-api TypeSpec spec — it is now hand-maintained. This PR does two things.

1. fix: nullable MaxPeriods in the subscription response model

The CloudPayments API returns "MaxPeriods": null for subscriptions created without a payment limit (unlimited recurring payments). The response model (CloudpaymentsRuby::Models::Subscription) typed max_periods as a non-nullable Integer, mismatching a value the API actually returns.

  • lib/.../models/subscription.rb: optional :max_periods, Integer, nil?: true
  • sig/.../models/subscription.rbs + rbi/.../models/subscription.rbi: max_periods writer / constructor / shape become nilable (readers were already nilable).

Scope: response model only. The create / update request params stay non-nullable — per the API docs maxPeriods is optional and "no limit" is expressed by omitting the field, not by sending null. (Matches the corresponding spec change: Hexlet/cloudpayments-api#2.)

2. ci: drop the Stainless build, add release-please

  • ci.yml: removed the build job (gated on the stainless-sdks/* mirror, uploaded artifacts to pkg.stainless.com) and the codegen/** / stl-preview-* branch plumbing. lint and test now run on normal pushes to main and on PRs.
  • release-please.yml (new): official googleapis/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; dropped prerelease mode and the Stainless-only ruby-readme updater (replaced with the standard generic README updater that understands the existing x-release-please-* markers).

A published GitHub release still triggers the existing publish-gem.yml → RubyGems.

Note: release-please runs under the default GITHUB_TOKEN. Releases it creates that way may not auto-trigger publish-gem.yml (GitHub's same-token cascade limitation) — in that case run Publish Gem via workflow_dispatch, or wire a PAT later.

Verification

Locally with the gem's own scripts: ./scripts/lint (Sorbet + RBS + RuboCop) clean, ./scripts/test green (84 runs, 0 failures). Workflow YAML and config JSON validated.

🤖 Generated with Claude Code

mokevnin and others added 2 commits June 26, 2026 12:30
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]>
@mokevnin mokevnin merged commit b7feae4 into main Jun 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant