Skip to content

Commit 6dba00f

Browse files
Merge pull request #1514 from stripe/latest-codegen-beta
Update generated code for beta
2 parents 17457e0 + d9118a2 commit 6dba00f

File tree

67 files changed

+1881
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1881
-115
lines changed

.github/workflows/ci.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ on:
2020
jobs:
2121
build:
2222
name: Build
23-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-22.04
2424

2525
steps:
26+
- uses: extractions/setup-just@v2
2627
- uses: actions/checkout@v3
2728
- name: Set up Ruby
2829
uses: ruby/setup-ruby@v1
2930
with:
3031
ruby-version: 3.1
3132
- name: Lint
32-
run: bundle install && bundle exec rake rubocop
33+
run: just lint
3334
- name: Build
3435
run: gem build stripe.gemspec
3536
- name: 'Upload Artifact'
@@ -40,19 +41,21 @@ jobs:
4041

4142
test:
4243
name: Test (${{ matrix.ruby-version }})
43-
runs-on: ubuntu-latest
44+
# this version of jruby isn't available in the new latest (24.04) so we have to pin (or update jruby)
45+
runs-on: ubuntu-22.04
4446
strategy:
4547
matrix:
4648
ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, '3.3', jruby-9.4.0.0, truffleruby-head]
4749
steps:
50+
- uses: extractions/setup-just@v2
4851
- uses: actions/checkout@v3
4952
- name: Set up Ruby
5053
uses: ruby/setup-ruby@v1
5154
with:
5255
ruby-version: ${{ matrix.ruby-version }}
5356
- uses: stripe/openapi/actions/stripe-mock@master
5457
- name: test
55-
run: make ci-test
58+
run: just test typecheck
5659
env:
5760
GITHUB_TOKEN: ${{ secrets.github_token }}
5861

@@ -63,7 +66,7 @@ jobs:
6366
startsWith(github.ref, 'refs/tags/v') &&
6467
endsWith(github.actor, '-stripe')
6568
needs: [build, test]
66-
runs-on: ubuntu-latest
69+
runs-on: ubuntu-22.04
6770
steps:
6871
- name: Download all workflow run artifacts
6972
uses: actions/download-artifact@v4

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
* Add method parameter classes for all resources and service methods.
1313
* These changes are NOT breaking and are purely additive. The method parameter classes are not required, we still accept hashes as well as the new `RequestParams` classes. Any additional gated parameters are still available to pass via hash. Resource fields define publicly documented fields and other deserialized fields are still accessible.
1414

15+
## 13.3.1 - 2025-01-13
16+
* [#1512](https://github.com/stripe/stripe-ruby/pull/1512) Import global configuration for options not available on StripeClient options
17+
* Fixes bug where `StripeClient` was not falling back to global options for options that are not available to be set per-client
18+
* [#1516](https://github.com/stripe/stripe-ruby/pull/1516) ThinEvent reason and livemode
19+
- Add `livemode` and optional `reason` fields to ThinEvent
20+
* [#1518](https://github.com/stripe/stripe-ruby/pull/1518) Pin ubuntu version in Test action
21+
* [#1508](https://github.com/stripe/stripe-ruby/pull/1508) Added pull request template
22+
1523
## 13.3.0 - 2024-12-18
1624
* [#1500](https://github.com/stripe/stripe-ruby/pull/1500) This release changes the pinned API version to `2024-12-18.acacia`.
1725

CONTRIBUTING.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# Contributing
3+
4+
We welcome bug reports, feature requests, and code contributions in a pull request.
5+
6+
For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-ruby/issues/new/choose).
7+
8+
## Contributor License Agreement
9+
10+
All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant.
11+
12+
## Generated code
13+
14+
This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution.
15+
16+
To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`.
17+
18+
## Compatibility with supported language and runtime versions
19+
20+
This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward.
21+
22+
## Set up your dev environment
23+
24+
Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment.
25+

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# NOTE: this file is deprecated and slated for deletion; prefer using the equivalent `just` commands.
2+
13
.PHONY: update-version codegen-format test ci-test
24
update-version:
35
@echo "$(VERSION)" > VERSION

OPENAPI_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1436
1+
v1454

README.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -362,19 +362,22 @@ New features and bug fixes are released on the latest major version of the Strip
362362

363363
## Development
364364

365-
The test suite depends on [stripe-mock], so make sure to fetch and run it from a
366-
background terminal ([stripe-mock's README][stripe-mock] also contains
367-
instructions for installing via Homebrew and other methods):
365+
[Contribution guidelines for this project](CONTRIBUTING.md)
366+
367+
The test suite depends on [stripe-mock], so make sure to fetch and run it from a background terminal ([stripe-mock's README][stripe-mock] also contains instructions for installing via Homebrew and other methods):
368368

369369
```sh
370370
go install github.com/stripe/stripe-mock@latest
371371
stripe-mock
372372
```
373373

374+
We use [just](https://github.com/casey/just) for common development tasks. You can install it or run the underlying commands directly (by copying them from the `justfile`). Common tasks include:
375+
374376
Run all tests:
375377

376378
```sh
377-
bundle exec rake test
379+
just test
380+
# or: bundle exec rake test
378381
```
379382

380383
Run a single test suite:
@@ -392,13 +395,15 @@ bundle exec ruby -Ilib/ test/stripe/util_test.rb -n /should.convert.names.to.sym
392395
Run the linter:
393396

394397
```sh
395-
bundle exec rake rubocop
398+
just lint
399+
# or: bundle exec rubocop
396400
```
397401

398402
Update bundled CA certificates from the [Mozilla cURL release][curl]:
399403

400404
```sh
401-
bundle exec rake update_certs
405+
just update-certs
406+
# or: bundle exec rake update_certs
402407
```
403408

404409
Update the bundled [stripe-mock] by editing the version number found in

Rakefile

-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ Rake::TestTask.new do |t|
88
t.pattern = "./test/**/*_test.rb"
99
end
1010

11-
if RUBY_VERSION >= "2.7.0"
12-
require "rubocop/rake_task"
13-
RuboCop::RakeTask.new
14-
end
15-
1611
desc "Update bundled certs"
1712
task :update_certs do
1813
require "net/http"

justfile

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
set quiet
2+
3+
import? '../sdk-codegen/utils.just'
4+
5+
_default:
6+
just --list --unsorted
7+
8+
install *args:
9+
bundle install {{ if is_dependency() == "true" {"--quiet"} else {""} }} {{ args }}
10+
11+
# ⭐ run all unit tests
12+
test: install
13+
bundle exec rake test
14+
15+
# check linting / formatting status of files
16+
format-check *args: install
17+
bundle exec rubocop {{ args }}
18+
alias lint-check := format-check
19+
20+
# ⭐ check style & formatting for all files, fixing what we can
21+
lint: (format-check "--autocorrect")
22+
23+
# NOTE: "-o /dev/null" is vital - rubocop has super noisy output and codegen will crash when formatting ruby if everything gets printed
24+
# so, we send all its output to the void
25+
# copy of `lint` with less output
26+
format: (format-check "-o /dev/null --autocorrect")
27+
28+
update-certs: install
29+
bundle exec rake update_certs
30+
31+
# run sorbet to check type definitions
32+
typecheck: install
33+
{{ if semver_matches(`ruby -e "puts RUBY_VERSION"`, ">=2.7") == "true" { \
34+
"bundle exec srb tc" \
35+
} else { \
36+
"echo \"Ruby version < 2.7, skipping srb tc\"" \
37+
} }}
38+
39+
# called by tooling
40+
[private]
41+
update-version version:
42+
echo "{{ version }}" > VERSION
43+
perl -pi -e 's|VERSION = "[.\-\w\d]+"|VERSION = "{{ version }}"|' lib/stripe/version.rb

lib/stripe.rb

+22
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,28 @@ module Stripe
7777
DEFAULT_UPLOAD_BASE = "https://files.stripe.com"
7878
DEFAULT_METER_EVENTS_BASE = "https://meter-events.stripe.com"
7979

80+
# Options that can be configured globally by users
81+
USER_CONFIGURABLE_GLOBAL_OPTIONS = Set.new(%i[
82+
api_key
83+
api_version
84+
stripe_account
85+
api_base
86+
uploads_base
87+
connect_base
88+
meter_events_base
89+
open_timeout
90+
read_timeout
91+
write_timeout
92+
proxy
93+
verify_ssl_certs
94+
ca_bundle_path
95+
log_level
96+
logger
97+
max_network_retries
98+
enable_telemetry
99+
client_id
100+
])
101+
80102
@app_info = nil
81103

82104
@config = Stripe::StripeConfiguration.setup

lib/stripe/api_version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
module Stripe
55
module ApiVersion
6-
CURRENT = "2024-12-18.acacia"
6+
CURRENT = "2025-01-27.acacia"
77
end
88
end

0 commit comments

Comments
 (0)