Skip to content

Commit 6904039

Browse files
stripe-openapi[bot]jar-stripexavdid-stripe
authored
Update generated code for beta (#1803)
* Update generated code (#1793) * Update generated code for v1399 * Update generated code for v1409 * Update generated code for v1412 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> * Bump version to 16.4.0 * Added pull request template (#1797) * Add justfile, remove coveralls, and fix AUTOLOAD in CI (#1801) * add justfile and tweak CI + readme * debug test * Debugging * further debugging * restore original composer json * add more logging * maybe fix ci * Fix typo * fix test naming and pass autoload directly to recipe as arugment * Remove unused logline and fix typo * restore composer * remove extra log line * update justfile * add comments * update ci * revert to gh action * ensure dependencies are installed for format and test recipes (#1802) * Update generated code for v1439 * Update generated code for v1441 * Update generated code for v1441 * Update generated code for v1442 * Update generated code for v1443 * Update generated code for v1445 * Update generated code for v1446 * Update generated code for v1448 * Update generated code for v1449 * Update generated code for v1450 * Added CONTRIBUTING.md file (#1806) * minor justfile fixes (#1807) * made v2 event class concrete, and changed convertToStripeObject to use it if we cannot find the identified event subclass (#1805) * Update generated code for v1454 * added CONTRIBUTING.md * Update generated code for v1456 * Update generated code for v1457 * Update generated code for v1460 --------- Co-authored-by: stripe-openapi[bot] <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Jesse Rosalia <[email protected]> Co-authored-by: David Brownman <[email protected]>
1 parent 4dbdcc0 commit 6904039

36 files changed

+174
-87
lines changed

.github/workflows/ci.yml

+14-26
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
php-cs-fixer:
2323
name: PHP-CS-Fixer
2424

25-
runs-on: ubuntu-latest
25+
runs-on: "ubuntu-24.04"
2626

2727
steps:
2828
- uses: actions/checkout@v3
@@ -35,20 +35,16 @@ jobs:
3535
phpstan:
3636
name: PHPStan
3737

38-
runs-on: ubuntu-latest
39-
40-
strategy:
41-
matrix:
42-
php-version:
43-
- "8.2"
38+
runs-on: "ubuntu-24.04"
4439

4540
steps:
41+
- uses: extractions/setup-just@v2
4642
- uses: actions/checkout@v3
4743

4844
- name: Setup PHP
4945
uses: shivammathur/setup-php@v2
5046
with:
51-
php-version: ${{ matrix.php-version }}
47+
php-version: "8.2"
5248

5349
- name: Get Composer Cache Directory
5450
id: composer-cache
@@ -69,19 +65,17 @@ jobs:
6965
run: composer install --prefer-dist --no-progress
7066

7167
- name: Run phpstan
72-
run: make phpstan
68+
run: just lint
7369

7470
tests:
75-
name: Tests
76-
77-
runs-on: ubuntu-latest
71+
runs-on: "ubuntu-24.04"
7872

7973
strategy:
8074
fail-fast: false
8175
matrix:
82-
env:
83-
- AUTOLOAD=0
84-
- AUTOLOAD=1
76+
autoload:
77+
- "0"
78+
- "1"
8579
php-version:
8680
- "5.6"
8781
- "7.0"
@@ -92,15 +86,16 @@ jobs:
9286
- "8.0"
9387
- "8.1"
9488
- "8.2"
89+
name: Tests (php@${{ matrix.php-version }}, AUTOLOAD=${{ matrix.autoload }})
9590

9691
steps:
92+
- uses: extractions/setup-just@v2
9793
- uses: actions/checkout@v3
9894

9995
- name: Setup PHP
10096
uses: shivammathur/setup-php@v2
10197
with:
10298
php-version: ${{ matrix.php-version }}
103-
coverage: xdebug
10499

105100
- name: Get Composer Cache Directory
106101
id: composer-cache
@@ -125,17 +120,10 @@ jobs:
125120
- uses: stripe/openapi/actions/stripe-mock@master
126121

127122
- name: Run test suite
123+
# --yes skips the confirmation dialogue for the CI test, which modifies files
128124
run: |
129125
php --version
130-
make ci-test
131-
132-
- name: Coveralls
133-
if: matrix.php-version == '8.2' && matrix.env == 'AUTOLOAD=1'
134-
uses: coverallsapp/github-action@v2
135-
with:
136-
files: clover.xml
137-
flag-name: php-${{ matrix.php-version }}-${{ matrix.env }}
138-
github-token: ${{ secrets.GITHUB_TOKEN }}
126+
just --yes ci-test ${{ matrix.autoload }}
139127
140128
publish:
141129
# Doesn't actually publish. The publish happens via a packagist webhook configured in the Github UI. But we still display a message here
@@ -144,7 +132,7 @@ jobs:
144132
(github.event_name == 'workflow_dispatch' || github.event_name == 'push') &&
145133
startsWith(github.ref, 'refs/tags/v') &&
146134
endsWith(github.actor, '-stripe')
147-
runs-on: ubuntu-latest
135+
runs-on: "ubuntu-24.04"
148136
steps:
149137
- uses: actions/checkout@v2
150138
- uses: stripe/openapi/actions/notify-release@master

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ build/*
1313
# If the vendor directory isn't being commited the composer.lock file should also be ignored
1414
composer.lock
1515

16-
# Ignore PHPUnit coverage file
17-
clover.xml
18-
1916
# Ignore IDE's configuration files
2017
.idea
2118

Makefile

+3
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
export PHPDOCUMENTOR_VERSION := v3.0.0
24

35
vendor: composer.json
@@ -12,6 +14,7 @@ test: vendor
1214
.PHONY: test
1315

1416
ci-test: vendor
17+
echo "calling build with $$AUTOLOAD"
1518
./build.php $$AUTOLOAD
1619
.PHONY: ci-test
1720

OPENAPI_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1437
1+
v1460

README.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
[![Latest Stable Version](https://poser.pugx.org/stripe/stripe-php/v/stable.svg)](https://packagist.org/packages/stripe/stripe-php)
55
[![Total Downloads](https://poser.pugx.org/stripe/stripe-php/downloads.svg)](https://packagist.org/packages/stripe/stripe-php)
66
[![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php)
7-
[![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master)
87

98
The Stripe PHP library provides convenient access to the Stripe API from
109
applications written in the PHP language. It includes a pre-defined set of
@@ -249,7 +248,11 @@ New features and bug fixes are released on the latest major version of the Strip
249248

250249
## Development
251250

252-
Get [Composer][composer]. For example, on Mac OS:
251+
[Contribution guidelines for this project](CONTRIBUTING.md)
252+
253+
We use [just](https://github.com/casey/just) for conveniently running development tasks. You can use them directly, or copy the commands out of the `justfile`. To our help docs, run `just`.
254+
255+
To get started, install [Composer][composer]. For example, on Mac OS:
253256

254257
```bash
255258
brew install composer
@@ -258,7 +261,8 @@ brew install composer
258261
Install dependencies:
259262

260263
```bash
261-
composer install
264+
just install
265+
# or: composer install
262266
```
263267

264268
The test suite depends on [stripe-mock], so make sure to fetch and run it from a
@@ -273,13 +277,15 @@ stripe-mock
273277
Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite:
274278

275279
```bash
276-
./vendor/bin/phpunit
280+
just test
281+
# or: ./vendor/bin/phpunit
277282
```
278283

279284
Or to run an individual test file:
280285

281286
```bash
282-
./vendor/bin/phpunit tests/Stripe/UtilTest.php
287+
just test tests/Stripe/UtilTest.php
288+
# or: ./vendor/bin/phpunit tests/Stripe/UtilTest.php
283289
```
284290

285291
Update bundled CA certificates from the [Mozilla cURL release][curl]:
@@ -291,7 +297,8 @@ Update bundled CA certificates from the [Mozilla cURL release][curl]:
291297
The library uses [PHP CS Fixer][php-cs-fixer] for code formatting. Code must be formatted before PRs are submitted, otherwise CI will fail. Run the formatter with:
292298

293299
```bash
294-
./vendor/bin/php-cs-fixer fix -v .
300+
just format
301+
# or: ./vendor/bin/php-cs-fixer fix -v .
295302
```
296303

297304
## Attention plugin developers

justfile

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
set quiet
2+
3+
import? '../sdk-codegen/utils.just'
4+
5+
# make vendored executables callable directly
6+
export PATH := "vendor/bin:" + env_var('PATH')
7+
8+
_default:
9+
just --list --unsorted
10+
11+
# install vendored dependencies
12+
install *args:
13+
composer install {{ if is_dependency() == "true" {"--quiet"} else {""} }} {{ args }}
14+
15+
# ⭐ run full unit test suite; needs stripe-mock
16+
[no-exit-message]
17+
test *args: install
18+
phpunit {{ args }}
19+
20+
# run tests in CI; can use autoload mode (or not)
21+
[confirm("This will modify local files and is intended for use in CI; do you want to proceed?")]
22+
ci-test autoload:
23+
./build.php {{ autoload }}
24+
25+
# ⭐ format all files
26+
format *args: install
27+
PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix -v --using-cache=no {{ args }}
28+
29+
# check formatting for, but don't modify, files
30+
format-check: (format "--dry-run")
31+
32+
# ⭐ statically analyze code
33+
lint *args:
34+
php -d memory_limit=512M vendor/bin/phpstan analyse lib tests {{args}}
35+
36+
# for backwards compatibility; ideally removed later
37+
[private]
38+
alias phpstan := lint
39+
40+
# called by tooling
41+
[private]
42+
update-version version:
43+
echo "{{ version }}" > VERSION
44+
perl -pi -e 's|VERSION = '\''[.\-\w\d]+'\''|VERSION = '\''{{ version }}'\''|' lib/Stripe.php
45+
46+
47+
PHPDOCUMENTOR_VERSION := "v3.0.0"
48+
# generates docs; currently broken? can unhide if working
49+
[private]
50+
phpdoc:
51+
#!/usr/bin/env bash
52+
set -euo pipefail
53+
54+
if [ ! -f vendor/bin/phpdoc ]; then
55+
curl -sfL https://github.com/phpDocumentor/phpDocumentor/releases/download/{{ PHPDOCUMENTOR_VERSION }}/phpDocumentor.phar -o vendor/bin/phpdoc
56+
chmod +x vendor/bin/phpdoc
57+
fi
58+
59+
phpdoc

0 commit comments

Comments
 (0)