Skip to content

Commit d536268

Browse files
committed
Merge branch 'master' into feature/support-exists-context
2 parents 1828149 + fe4b88b commit d536268

File tree

234 files changed

+9035
-2115
lines changed

Some content is hidden

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

234 files changed

+9035
-2115
lines changed

.coveragerc36

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This is the coverage.py config for Python 3.6
2+
# The config for newer Python versions is in pyproject.toml.
3+
4+
[run]
5+
branch = true
6+
omit =
7+
/tmp/*
8+
*/tests/*
9+
*/.venv/*
10+
11+
12+
[report]
13+
exclude_lines =
14+
if TYPE_CHECKING:

.github/workflows/ci.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
timeout-minutes: 10
2525

2626
steps:
27-
- uses: actions/checkout@v4.1.7
27+
- uses: actions/checkout@v4.2.2
2828
- uses: actions/setup-python@v5
2929
with:
3030
python-version: 3.12
@@ -39,7 +39,7 @@ jobs:
3939
timeout-minutes: 10
4040

4141
steps:
42-
- uses: actions/checkout@v4.1.7
42+
- uses: actions/checkout@v4.2.2
4343
- uses: actions/setup-python@v5
4444
with:
4545
python-version: 3.12
@@ -54,7 +54,7 @@ jobs:
5454
timeout-minutes: 10
5555

5656
steps:
57-
- uses: actions/checkout@v4.1.7
57+
- uses: actions/checkout@v4.2.2
5858
- uses: actions/setup-python@v5
5959
with:
6060
python-version: 3.12
@@ -70,19 +70,22 @@ jobs:
7070
# This will also trigger "make dist" that creates the Python packages
7171
make aws-lambda-layer
7272
- name: Upload Python Packages
73-
uses: actions/upload-artifact@v3
73+
uses: actions/upload-artifact@v4
7474
with:
75-
name: ${{ github.sha }}
75+
name: artifact-build_lambda_layer
7676
path: |
7777
dist/*
78+
if-no-files-found: 'error'
79+
# since this artifact will be merged, compression is not necessary
80+
compression-level: '0'
7881

7982
docs:
8083
name: Build SDK API Doc
8184
runs-on: ubuntu-latest
8285
timeout-minutes: 10
8386

8487
steps:
85-
- uses: actions/checkout@v4.1.7
88+
- uses: actions/checkout@v4.2.2
8689
- uses: actions/setup-python@v5
8790
with:
8891
python-version: 3.12
@@ -91,7 +94,23 @@ jobs:
9194
make apidocs
9295
cd docs/_build && zip -r gh-pages ./
9396
94-
- uses: actions/[email protected]
97+
- uses: actions/upload-artifact@v4
98+
with:
99+
name: artifact-docs
100+
path: |
101+
docs/_build/gh-pages.zip
102+
if-no-files-found: 'error'
103+
# since this artifact will be merged, compression is not necessary
104+
compression-level: '0'
105+
106+
merge:
107+
name: Create Release Artifact
108+
runs-on: ubuntu-latest
109+
needs: [build_lambda_layer, docs]
110+
steps:
111+
- uses: actions/upload-artifact/merge@v4
95112
with:
113+
# Craft expects release assets from github to be a single artifact named after the sha.
96114
name: ${{ github.sha }}
97-
path: docs/_build/gh-pages.zip
115+
pattern: artifact-*
116+
delete-merged: true

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ on:
1717
- master
1818
- sentry-sdk-2.0
1919
pull_request:
20-
# The branches below must be a subset of the branches above
21-
branches:
22-
- master
23-
- sentry-sdk-2.0
2420
schedule:
2521
- cron: '18 18 * * 3'
2622

23+
# Cancel in progress workflows on pull_requests.
24+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
27+
cancel-in-progress: true
28+
2729
permissions:
2830
contents: read
2931

@@ -46,7 +48,7 @@ jobs:
4648

4749
steps:
4850
- name: Checkout repository
49-
uses: actions/checkout@v4.1.7
51+
uses: actions/checkout@v4.2.2
5052

5153
# Initializes the CodeQL tools for scanning.
5254
- name: Initialize CodeQL

.github/workflows/enforce-license-compliance.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ on:
88
- release/*
99
- sentry-sdk-2.0
1010
pull_request:
11-
branches:
12-
- master
13-
- main
14-
- sentry-sdk-2.0
11+
12+
# Cancel in progress workflows on pull_requests.
13+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1516

1617
jobs:
1718
enforce-license-compliance:
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Automation: Notify issues for release"
2+
on:
3+
release:
4+
types:
5+
- published
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: Which version to notify issues for
10+
required: false
11+
12+
# This workflow is triggered when a release is published
13+
jobs:
14+
release-comment-issues:
15+
runs-on: ubuntu-20.04
16+
name: Notify issues
17+
steps:
18+
- name: Get version
19+
id: get_version
20+
run: echo "version=${{ github.event.inputs.version || github.event.release.tag_name }}" >> $GITHUB_OUTPUT
21+
22+
- name: Comment on linked issues that are mentioned in release
23+
if: |
24+
steps.get_version.outputs.version != ''
25+
&& !contains(steps.get_version.outputs.version, 'a')
26+
&& !contains(steps.get_version.outputs.version, 'b')
27+
&& !contains(steps.get_version.outputs.version, 'rc')
28+
uses: getsentry/release-comment-issues-gh-action@v1
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
version: ${{ steps.get_version.outputs.version }}

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@ jobs:
1818
runs-on: ubuntu-latest
1919
name: "Release a new version"
2020
steps:
21-
- uses: actions/[email protected]
21+
- name: Get auth token
22+
id: token
23+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
2224
with:
23-
token: ${{ secrets.GH_RELEASE_PAT }}
25+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
26+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
27+
- uses: actions/[email protected]
28+
with:
29+
token: ${{ steps.token.outputs.token }}
2430
fetch-depth: 0
2531
- name: Prepare release
2632
uses: getsentry/action-prepare-release@v1
2733
env:
28-
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
34+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
2935
with:
3036
version: ${{ github.event.inputs.version }}
3137
force: ${{ github.event.inputs.force }}

.github/workflows/test-integrations-ai.yml

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
python-version: ["3.7","3.9","3.11","3.12"]
30+
python-version: ["3.7","3.9","3.11","3.12","3.13"]
3131
# python3.6 reached EOL and is no longer being supported on
3232
# new versions of hosted runners on Github Actions
3333
# ubuntu-20.04 is the last version that supported python3.6
3434
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3535
os: [ubuntu-20.04]
3636
steps:
37-
- uses: actions/checkout@v4.1.7
37+
- uses: actions/checkout@v4.2.2
3838
- uses: actions/setup-python@v5
3939
with:
4040
python-version: ${{ matrix.python-version }}
@@ -65,38 +65,48 @@ jobs:
6565
run: |
6666
set -x # print commands that are executed
6767
./scripts/runtox.sh "py${{ matrix.python-version }}-huggingface_hub-latest"
68+
- name: Generate coverage XML (Python 3.6)
69+
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
70+
run: |
71+
export COVERAGE_RCFILE=.coveragerc36
72+
coverage combine .coverage-sentry-*
73+
coverage xml --ignore-errors
6874
- name: Generate coverage XML
69-
if: ${{ !cancelled() }}
75+
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
7076
run: |
71-
coverage combine .coverage*
72-
coverage xml -i
77+
coverage combine .coverage-sentry-*
78+
coverage xml
7379
- name: Upload coverage to Codecov
7480
if: ${{ !cancelled() }}
75-
uses: codecov/codecov-action@v4.5.0
81+
uses: codecov/codecov-action@v5.0.7
7682
with:
7783
token: ${{ secrets.CODECOV_TOKEN }}
7884
files: coverage.xml
85+
# make sure no plugins alter our coverage reports
86+
plugin: noop
87+
verbose: true
7988
- name: Upload test results to Codecov
8089
if: ${{ !cancelled() }}
8190
uses: codecov/test-results-action@v1
8291
with:
8392
token: ${{ secrets.CODECOV_TOKEN }}
8493
files: .junitxml
94+
verbose: true
8595
test-ai-pinned:
8696
name: AI (pinned)
8797
timeout-minutes: 30
8898
runs-on: ${{ matrix.os }}
8999
strategy:
90100
fail-fast: false
91101
matrix:
92-
python-version: ["3.7","3.9","3.11","3.12"]
102+
python-version: ["3.8","3.9","3.11","3.12","3.13"]
93103
# python3.6 reached EOL and is no longer being supported on
94104
# new versions of hosted runners on Github Actions
95105
# ubuntu-20.04 is the last version that supported python3.6
96106
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
97107
os: [ubuntu-20.04]
98108
steps:
99-
- uses: actions/checkout@v4.1.7
109+
- uses: actions/checkout@v4.2.2
100110
- uses: actions/setup-python@v5
101111
with:
102112
python-version: ${{ matrix.python-version }}
@@ -127,25 +137,35 @@ jobs:
127137
run: |
128138
set -x # print commands that are executed
129139
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-huggingface_hub"
140+
- name: Generate coverage XML (Python 3.6)
141+
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
142+
run: |
143+
export COVERAGE_RCFILE=.coveragerc36
144+
coverage combine .coverage-sentry-*
145+
coverage xml --ignore-errors
130146
- name: Generate coverage XML
131-
if: ${{ !cancelled() }}
147+
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
132148
run: |
133-
coverage combine .coverage*
134-
coverage xml -i
149+
coverage combine .coverage-sentry-*
150+
coverage xml
135151
- name: Upload coverage to Codecov
136152
if: ${{ !cancelled() }}
137-
uses: codecov/codecov-action@v4.5.0
153+
uses: codecov/codecov-action@v5.0.7
138154
with:
139155
token: ${{ secrets.CODECOV_TOKEN }}
140156
files: coverage.xml
157+
# make sure no plugins alter our coverage reports
158+
plugin: noop
159+
verbose: true
141160
- name: Upload test results to Codecov
142161
if: ${{ !cancelled() }}
143162
uses: codecov/test-results-action@v1
144163
with:
145164
token: ${{ secrets.CODECOV_TOKEN }}
146165
files: .junitxml
166+
verbose: true
147167
check_required_tests:
148-
name: All AI tests passed
168+
name: All pinned AI tests passed
149169
needs: test-ai-pinned
150170
# Always run this, even if a dependent job failed
151171
if: always()

.github/workflows/test-integrations-aws-lambda.yml renamed to .github/workflows/test-integrations-aws.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Do not edit this file. This file is generated automatically by executing
22
# python scripts/split-tox-gh-actions/split-tox-gh-actions.py
3-
name: Test AWS Lambda
3+
name: Test AWS
44
on:
55
push:
66
branches:
@@ -32,7 +32,7 @@ jobs:
3232
name: permissions check
3333
runs-on: ubuntu-20.04
3434
steps:
35-
- uses: actions/checkout@v4.1.7
35+
- uses: actions/checkout@v4.2.2
3636
with:
3737
persist-credentials: false
3838
- name: Check permissions on PR
@@ -52,8 +52,8 @@ jobs:
5252
- name: Check permissions on repo branch
5353
if: github.event_name == 'push'
5454
run: true
55-
test-aws_lambda-pinned:
56-
name: AWS Lambda (pinned)
55+
test-aws-pinned:
56+
name: AWS (pinned)
5757
timeout-minutes: 30
5858
runs-on: ${{ matrix.os }}
5959
strategy:
@@ -67,7 +67,7 @@ jobs:
6767
os: [ubuntu-20.04]
6868
needs: check-permissions
6969
steps:
70-
- uses: actions/checkout@v4.1.7
70+
- uses: actions/checkout@v4.2.2
7171
with:
7272
ref: ${{ github.event.pull_request.head.sha || github.ref }}
7373
- uses: actions/setup-python@v5
@@ -84,31 +84,41 @@ jobs:
8484
run: |
8585
set -x # print commands that are executed
8686
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aws_lambda"
87+
- name: Generate coverage XML (Python 3.6)
88+
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
89+
run: |
90+
export COVERAGE_RCFILE=.coveragerc36
91+
coverage combine .coverage-sentry-*
92+
coverage xml --ignore-errors
8793
- name: Generate coverage XML
88-
if: ${{ !cancelled() }}
94+
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
8995
run: |
90-
coverage combine .coverage*
91-
coverage xml -i
96+
coverage combine .coverage-sentry-*
97+
coverage xml
9298
- name: Upload coverage to Codecov
9399
if: ${{ !cancelled() }}
94-
uses: codecov/codecov-action@v4.5.0
100+
uses: codecov/codecov-action@v5.0.7
95101
with:
96102
token: ${{ secrets.CODECOV_TOKEN }}
97103
files: coverage.xml
104+
# make sure no plugins alter our coverage reports
105+
plugin: noop
106+
verbose: true
98107
- name: Upload test results to Codecov
99108
if: ${{ !cancelled() }}
100109
uses: codecov/test-results-action@v1
101110
with:
102111
token: ${{ secrets.CODECOV_TOKEN }}
103112
files: .junitxml
113+
verbose: true
104114
check_required_tests:
105-
name: All AWS Lambda tests passed
106-
needs: test-aws_lambda-pinned
115+
name: All pinned AWS tests passed
116+
needs: test-aws-pinned
107117
# Always run this, even if a dependent job failed
108118
if: always()
109119
runs-on: ubuntu-20.04
110120
steps:
111121
- name: Check for failures
112-
if: contains(needs.test-aws_lambda-pinned.result, 'failure') || contains(needs.test-aws_lambda-pinned.result, 'skipped')
122+
if: contains(needs.test-aws-pinned.result, 'failure') || contains(needs.test-aws-pinned.result, 'skipped')
113123
run: |
114124
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

0 commit comments

Comments
 (0)