Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for beta #1514

Merged
merged 22 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
467e034
Update generated code for v1439
stripe-openapi[bot] Jan 10, 2025
463efa5
Update generated code for v1441
stripe-openapi[bot] Jan 10, 2025
da19166
pinned the ubuntu version in the Test action, to ensure support for j…
jar-stripe Jan 13, 2025
36b1c7c
ThinEvent reason and livemode (#1516)
jar-stripe Jan 13, 2025
80c41a7
Merge upstream and update generated code for v1441
stripe-openapi[bot] Jan 13, 2025
6e39505
Import global configuration for options not available on StripeClient…
helenye-stripe Jan 13, 2025
57dd25a
Bump version to 13.3.1
helenye-stripe Jan 13, 2025
7daac5c
Merge upstream and update generated code for v1442
stripe-openapi[bot] Jan 14, 2025
9d54b5c
Update generated code for v1443
stripe-openapi[bot] Jan 14, 2025
39283a3
Update generated code for v1444
stripe-openapi[bot] Jan 14, 2025
f21e023
Update generated code for v1446
stripe-openapi[bot] Jan 14, 2025
4c7a289
Update generated code for v1448
stripe-openapi[bot] Jan 15, 2025
ef7e6ee
added CONTRIBUTING.md file (#1515)
jar-stripe Jan 15, 2025
c1ca972
Merge upstream and update generated code for v1448
stripe-openapi[bot] Jan 15, 2025
7ec394e
Update generated code for v1449
stripe-openapi[bot] Jan 15, 2025
1402ac7
Update generated code for v1450
stripe-openapi[bot] Jan 15, 2025
08020d3
add justfile (#1513)
xavdid-stripe Jan 16, 2025
b03b022
Fixed typos in CONTRIBUTING.MD (#1519)
jar-stripe Jan 17, 2025
5304640
pipe rubocop output to devnull (#1521)
xavdid-stripe Jan 17, 2025
43e3ecd
Merge upstream and update generated code for v1453
stripe-openapi[bot] Jan 17, 2025
1e9681f
Update generated code for v1454
stripe-openapi[bot] Jan 17, 2025
d9118a2
added CONTRIBUTING.md
jar-stripe Jan 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ on:
jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
- name: Lint
run: bundle install && bundle exec rake rubocop
run: just lint
- name: Build
run: gem build stripe.gemspec
- name: 'Upload Artifact'
Expand All @@ -40,19 +41,21 @@ jobs:

test:
name: Test (${{ matrix.ruby-version }})
runs-on: ubuntu-latest
# this version of jruby isn't available in the new latest (24.04) so we have to pin (or update jruby)
runs-on: ubuntu-22.04
strategy:
matrix:
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]
steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- uses: stripe/openapi/actions/stripe-mock@master
- name: test
run: make ci-test
run: just test typecheck
env:
GITHUB_TOKEN: ${{ secrets.github_token }}

Expand All @@ -63,7 +66,7 @@ jobs:
startsWith(github.ref, 'refs/tags/v') &&
endsWith(github.actor, '-stripe')
needs: [build, test]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
* Add method parameter classes for all resources and service methods.
* 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.

## 13.3.1 - 2025-01-13
* [#1512](https://github.com/stripe/stripe-ruby/pull/1512) Import global configuration for options not available on StripeClient options
* Fixes bug where `StripeClient` was not falling back to global options for options that are not available to be set per-client
* [#1516](https://github.com/stripe/stripe-ruby/pull/1516) ThinEvent reason and livemode
- Add `livemode` and optional `reason` fields to ThinEvent
* [#1518](https://github.com/stripe/stripe-ruby/pull/1518) Pin ubuntu version in Test action
* [#1508](https://github.com/stripe/stripe-ruby/pull/1508) Added pull request template

## 13.3.0 - 2024-12-18
* [#1500](https://github.com/stripe/stripe-ruby/pull/1500) This release changes the pinned API version to `2024-12-18.acacia`.

Expand Down
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# Contributing

We welcome bug reports, feature requests, and code contributions in a pull request.

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://github.com/stripe/stripe-ruby/issues/new/choose).

## Contributor License Agreement

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.

## Generated code

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.

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`.

## Compatibility with supported language and runtime versions

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.

## Set up your dev environment

Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment.

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# NOTE: this file is deprecated and slated for deletion; prefer using the equivalent `just` commands.

.PHONY: update-version codegen-format test ci-test
update-version:
@echo "$(VERSION)" > VERSION
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1436
v1454
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,19 +362,22 @@ New features and bug fixes are released on the latest major version of the Strip

## Development

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):
[Contribution guidelines for this project](CONTRIBUTING.md)

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):

```sh
go install github.com/stripe/stripe-mock@latest
stripe-mock
```

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:

Run all tests:

```sh
bundle exec rake test
just test
# or: bundle exec rake test
```

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

```sh
bundle exec rake rubocop
just lint
# or: bundle exec rubocop
```

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

```sh
bundle exec rake update_certs
just update-certs
# or: bundle exec rake update_certs
```

Update the bundled [stripe-mock] by editing the version number found in
Expand Down
5 changes: 0 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ Rake::TestTask.new do |t|
t.pattern = "./test/**/*_test.rb"
end

if RUBY_VERSION >= "2.7.0"
require "rubocop/rake_task"
RuboCop::RakeTask.new
end

desc "Update bundled certs"
task :update_certs do
require "net/http"
Expand Down
43 changes: 43 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
set quiet

import? '../sdk-codegen/utils.just'

_default:
just --list --unsorted

install *args:
bundle install {{ if is_dependency() == "true" {"--quiet"} else {""} }} {{ args }}

# ⭐ run all unit tests
test: install
bundle exec rake test

# check linting / formatting status of files
format-check *args: install
bundle exec rubocop {{ args }}
alias lint-check := format-check

# ⭐ check style & formatting for all files, fixing what we can
lint: (format-check "--autocorrect")

# NOTE: "-o /dev/null" is vital - rubocop has super noisy output and codegen will crash when formatting ruby if everything gets printed
# so, we send all its output to the void
# copy of `lint` with less output
format: (format-check "-o /dev/null --autocorrect")

update-certs: install
bundle exec rake update_certs

# run sorbet to check type definitions
typecheck: install
{{ if semver_matches(`ruby -e "puts RUBY_VERSION"`, ">=2.7") == "true" { \
"bundle exec srb tc" \
} else { \
"echo \"Ruby version < 2.7, skipping srb tc\"" \
} }}

# called by tooling
[private]
update-version version:
echo "{{ version }}" > VERSION
perl -pi -e 's|VERSION = "[.\-\w\d]+"|VERSION = "{{ version }}"|' lib/stripe/version.rb
22 changes: 22 additions & 0 deletions lib/stripe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,28 @@ module Stripe
DEFAULT_UPLOAD_BASE = "https://files.stripe.com"
DEFAULT_METER_EVENTS_BASE = "https://meter-events.stripe.com"

# Options that can be configured globally by users
USER_CONFIGURABLE_GLOBAL_OPTIONS = Set.new(%i[
api_key
api_version
stripe_account
api_base
uploads_base
connect_base
meter_events_base
open_timeout
read_timeout
write_timeout
proxy
verify_ssl_certs
ca_bundle_path
log_level
logger
max_network_retries
enable_telemetry
client_id
])

@app_info = nil

@config = Stripe::StripeConfiguration.setup
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/api_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

module Stripe
module ApiVersion
CURRENT = "2024-12-18.acacia"
CURRENT = "2025-01-27.acacia"
end
end
Loading