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

Next tracking branch #526

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9dbe435
Squashed commit of the following:
mzeitlin11 Mar 20, 2024
854d34f
Make workflows run on next
mzeitlin11 Mar 20, 2024
32b0b1d
try bumping msrv
mzeitlin11 Mar 20, 2024
1b02be8
try bumping msrv
mzeitlin11 Mar 20, 2024
e7b7da3
more post merge changes
mzeitlin11 Mar 20, 2024
00aa897
Remove default derive for id
mzeitlin11 Mar 20, 2024
d295678
Merge pull request #452 from mzeitlin11/codegen_revamp
arlyon Apr 4, 2024
5f1e0fc
Remove some client allocations
mzeitlin11 Apr 5, 2024
816b9f8
Simplify webhook signature parse
mzeitlin11 Apr 5, 2024
cff37d3
Fix openapi clippy
mzeitlin11 Apr 5, 2024
562c493
Merge pull request #528 from mzeitlin11/client_cleanups
arlyon Apr 6, 2024
3adceac
Remove prefix validation from ids
mzeitlin11 Apr 8, 2024
7686a0b
Merge pull request #530 from mzeitlin11/remove_id_prefixes
mzeitlin11 Apr 10, 2024
f568feb
Implement miniserde-based deserialization
mzeitlin11 Apr 10, 2024
020065b
Merge pull request #523 from mzeitlin11/miniserde_exp
mzeitlin11 Apr 10, 2024
fe4d659
Implement Expandable::into_id
mzeitlin11 Apr 11, 2024
001d7dd
FromStr improvements
mzeitlin11 Apr 11, 2024
4f29e69
Merge pull request #536 from mzeitlin11/expandable_into_id
mzeitlin11 May 4, 2024
ba6f20d
Merge pull request #537 from mzeitlin11/from_str_tweaks
mzeitlin11 May 4, 2024
aa89448
Client split (#525)
mzeitlin11 Jul 24, 2024
0d171ba
fix: add some sanity checks to secret keys
arlyon Jul 23, 2024
2b918fe
Merge pull request #576 from arlyon/arlyon/sk-sanity-checks
arlyon Jul 25, 2024
519da4d
fix(client-core): add tracing dependency
augustoccesar Jul 29, 2024
c81b7e3
chore(openapi): bump tracing 0.1.36 -> 0.1.40
augustoccesar Jul 29, 2024
54553bf
Merge pull request #581 from augustoccesar/client-core/add-tracing
arlyon Jul 29, 2024
5f24efb
fix: doc_lazy_continuation linting issue
augustoccesar Jul 29, 2024
6791e55
fix: indentation for long lines that are list items
augustoccesar Jul 29, 2024
fae2763
fix(webhook): linting issues with incomplete Cargo.toml
augustoccesar Jul 29, 2024
e4db632
chore: run openapi for current version
augustoccesar Jul 29, 2024
1b938a9
fix(webhook): use correct feature flag for testing
augustoccesar Jul 30, 2024
48d4653
Merge pull request #582 from augustoccesar/fix/linting-issues-from-1.80
arlyon Jul 31, 2024
d7759d6
Avoid ?
mzeitlin11 Sep 1, 2024
fba30c3
Pin stripe mock
mzeitlin11 Sep 1, 2024
d14a43b
Merge pull request #602 from mzeitlin11/comp-time
arlyon Sep 3, 2024
0124c6c
fix enum serialization
lasantosr Sep 3, 2024
090006f
add test
lasantosr Sep 3, 2024
0306091
Merge pull request #605 from lasantosr/fix-enums
mzeitlin11 Sep 3, 2024
6c7486a
feat: owned types on requests
lasantosr Aug 26, 2024
df8a348
Merge pull request #597 from lasantosr/owned-requests
arlyon Sep 7, 2024
8b5a6ee
feat: parse a webhook event without the secret
lasantosr Sep 17, 2024
aca76f2
Merge pull request #611 from lasantosr/feature/webhook-insecure
arlyon Sep 24, 2024
595d28c
feat: allows to serialize and deserialize webhook events
lasantosr Oct 7, 2024
cf8f958
expose webhook event data
lasantosr Oct 24, 2024
e246db4
Merge pull request #625 from lasantosr/feature/expose-webhook-event-data
mzeitlin11 Oct 26, 2024
1af8bc9
Merge pull request #620 from lasantosr/webhook-event-serde
mzeitlin11 Oct 26, 2024
feb39af
feat: keep original string on unknown variants
lasantosr Sep 17, 2024
40caf23
Merge pull request #612 from lasantosr/feature/keep-unknown-variants
mzeitlin11 Nov 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: Create a report to help us improve
labels: ["bug"]
labels: [ "bug" ]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -51,7 +51,7 @@ body:
id: language-version
attributes:
label: Rust version
placeholder: Our MSRV is 1.68.0
placeholder: Our MSRV is 1.75.0
validations:
required: true
- type: input
Expand Down
224 changes: 136 additions & 88 deletions .github/workflows/async-stripe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,135 +3,183 @@ on:
push:
branches:
- master
- next
pull_request:
branches:
- master
- next

env:
RUSTFLAGS: -Dwarnings
rust_min: 1.75

jobs:
format:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- name: Checkout sources
uses: actions/checkout@v3

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: nightly
components: rustfmt
- uses: davidB/rust-cargo-make@v1
- name: regenerate openapi
uses: actions-rs/cargo@v1
with:
command: make
args: check

verify-codegen:
runs-on: ubuntu-20.04
- name: Check formatting for workspace
run: cargo fmt --all -- --check

verify-codegen-crate:
runs-on: ubuntu-latest
defaults:
run:
working-directory: openapi

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- name: Checkout sources
uses: actions/checkout@v3

- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: nightly
components: rustfmt
- uses: davidB/rust-cargo-make@v1
- name: regenerate openapi
uses: actions-rs/cargo@v1

- name: Check formatting
run: cargo +nightly fmt -- --check

- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
command: make
args: openapi-install
- name: ensure generated files unchanged
components: clippy

- name: Run clippy
run: cargo clippy

- name: Run codegen
run: cargo run --release -- --fetch current

- name: Ensure generated files unchanged
uses: tj-actions/[email protected]
id: verify-changed-files
with:
files: |
**/*.rs
- name: report changed files

- name: Report changed files
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
echo "Some files changed after code generation: ${{ steps.verify-changed-files.outputs.changed_files }}"
exit 1

clippy:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
runtime:
features:
[
default-tls,
rustls-tls-webpki-roots,
rustls-tls-native,
async-std-surf,
tokio-hyper,
tokio-hyper-rustls,
tokio-hyper-rustls-webpki,
blocking,
blocking-rustls,
blocking-rustls-webpki,
]

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- name: Checkout sources
uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
toolchain: ${{ env.rust_min }}
components: clippy
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-clippy-${{ matrix.runtime }}-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
with:
command: clippy
args: >
--no-default-features
--features runtime-${{ matrix.runtime }}
test:
runs-on: ubuntu-20.04
env:
RUSTFLAGS: -D warnings

- uses: Swatinem/rust-cache@v2

- name: Run clippy
run: cargo clippy --no-default-features --features "full serialize deserialize ${{ matrix.features }}"

test-clients:
name: Test Clients
runs-on: ubuntu-latest
strategy:
matrix:
runtime:
features:
[
default-tls,
rustls-tls-webpki-roots,
rustls-tls-native,
async-std-surf,
tokio-hyper,
tokio-hyper-rustls,
tokio-hyper-rustls-webpki,
blocking,
blocking-rustls,
blocking-rustls-webpki,
]

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_min }}
components: clippy

- uses: Swatinem/rust-cache@v2

- name: Run tests
run: cargo test --no-default-features --features "full serialize deserialize ${{ matrix.features }}"

stripe-mock-tests:
name: Stripe Mock Tests
runs-on: ubuntu-latest
strategy:
matrix:
features:
[
default-tls,
rustls-tls-webpki-roots,
rustls-tls-native,
]
services:
stripe-mock:
image: stripe/stripe-mock
image: stripe/stripe-mock:v0.185.0
ports:
- 12111:12111
- 12112:12112
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: "1.68.0"
override: true
- uses: actions/cache@v2
- uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-test-${{ matrix.runtime }}-${{ hashFiles('**/Cargo.lock') }}
- name: Test
run: cargo test --features runtime-${{ matrix.runtime }}
# - uses: taiki-e/install-action@cargo-llvm-cov
# - name: Test and gather coverage
# run: cargo llvm-cov --lcov --output-path lcov.info --features runtime-${{ matrix.runtime }}
# - name: Upload to codecov.io
# uses: codecov/[email protected]
# with:
# token: ${{secrets.CODECOV_TOKEN}}
# files: lcov.info
# - name: Archive code coverage results
# uses: actions/upload-artifact@v1
# with:
# name: code-coverage-report
# path: lcov.info
toolchain: ${{ env.rust_min }}

- uses: Swatinem/rust-cache@v2
- name: Run stripe mock tests
run: cargo test -p async-stripe-tests --no-default-features --features ${{ matrix.features }}


docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Build Documentation
run: cargo doc --lib --no-deps --features "full serialize deserialize"

# Examples tested separately so that we can use crates which don't match our MSRV
examples:
name: Check Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Check examples
run: cargo clippy --workspace
49 changes: 9 additions & 40 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,24 @@ jobs:
update-openapi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install minimal nightly with rustfmt
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3

- name: Install Rust with rustfmt
uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: nightly
components: rustfmt
- uses: davidB/rust-cargo-make@v1
- name: regenerate openapi
uses: actions-rs/cargo@v1
with:
command: make
args: openapi-install-latest
- name: verify
id: verify
# currently waiting for https://github.com/actions-rs/cargo/pull/206
# so we use this in the mean time
uses: arlyon/[email protected]
with:
command: make
args: verify
- name: duplicates
id: duplicates
# currently waiting for https://github.com/actions-rs/cargo/pull/206
# so we use this in the mean time
uses: arlyon/[email protected]
with:
command: make
args: duplicates

- name: Run Codegen
run: cargo run --release -- --fetch latest

- name: create pull request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.REPO_SCOPED_TOKEN }}
commit-message: "feat: generate latest changes from OpenApi spec"
commit-message: Generate latest changes from OpenApi spec
title: Generate latest changes from OpenApi spec
body: |
This is an automated PR that tries to build the latest changes generated from the [Stripe OpenApi spec](https://github.com/stripe/openapi).

Here are the missing exports:

```
${{ steps.verify.outputs.stdout }}
```

Here are the duplicate exports:

```
${{ steps.duplicates.outputs.stdout }}
```
branch: openapi
branch-suffix: timestamp
reviewers: arlyon
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Cargo.lock

# Test artifacts
stripe-mock/
lcov.info

# IDE artifacts
.DS_Store
Expand Down
Loading
Loading