Skip to content

Commit 3440fbc

Browse files
GCLOUD2-18968 Enable breaking change detection
1 parent 11ddf30 commit 3440fbc

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,35 @@ jobs:
5050

5151
- name: Run tests
5252
run: ./scripts/test
53+
54+
detect_breaking_changes:
55+
name: detect-breaking-changes
56+
if: github.event_name == 'pull_request'
57+
# Don't try to detect breaking changes if linting fails with the change. That means it's already failing
58+
# and will likely fail at an earlier revision for the same reason, which doesn't indicate a breaking
59+
# change.
60+
needs: lint
61+
runs-on: ${{ github.repository == 'stainless-sdks/gcore-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
62+
steps:
63+
- name: Calculate fetch-depth
64+
run: |
65+
echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV
66+
67+
- uses: actions/checkout@v4
68+
with:
69+
# Ensure we can check out the pull request base in the script below.
70+
fetch-depth: ${{ env.FETCH_DEPTH }}
71+
72+
- name: Install Rye
73+
run: |
74+
curl -sSf https://rye.astral.sh/get | bash
75+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
76+
env:
77+
RYE_VERSION: '0.44.0'
78+
RYE_INSTALL_OPTION: '--yes'
79+
- name: Install dependencies
80+
run: |
81+
rye sync --all-features
82+
83+
- name: Detect breaking changes
84+
run: ./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 228
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-b76145629dcc7d96b116490429fbcb6fb4a9c12a3d0a738078a681973c14081d.yml
33
openapi_spec_hash: 92240813810f5bc1b57c044484ca978e
4-
config_hash: 0cda837de45a51a9b60246ffb22604e8
4+
config_hash: 4ce0219e37d7ed52a8e999f415c64cd6

scripts/detect-breaking-changes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
cd "$(dirname "$0")/.."
6+
7+
echo "==> Detecting breaking changes"
8+
git checkout "$1" -- tests/api_resources tests/test_client.py tests/test_response.py
9+
./scripts/lint

0 commit comments

Comments
 (0)