Skip to content

Add Strawberry GraphQL integration #2393

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

Merged
merged 44 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
80c33dc
add to tox.ini
sentrivana Sep 25, 2023
016218f
strawberry errors
sentrivana Sep 25, 2023
f97c8eb
wip
sentrivana Sep 25, 2023
408481f
tweaks
sentrivana Sep 26, 2023
e589eb2
more tests
sentrivana Sep 26, 2023
af1e23b
fixes
sentrivana Sep 26, 2023
fe036c1
better info message
sentrivana Sep 26, 2023
169ffd3
add graphql ops
sentrivana Sep 26, 2023
5ed4f4a
compat
sentrivana Sep 27, 2023
977965f
Merge branch 'master' into ivana/strawberry-integration
sentrivana Sep 27, 2023
f51e992
fixes, more tests
sentrivana Sep 27, 2023
0a97dc7
add breadcrumb
sentrivana Sep 27, 2023
cfba133
fix tests
sentrivana Sep 27, 2023
bdbf83e
more test fixes
sentrivana Sep 27, 2023
6e08308
some mypy fixes
sentrivana Sep 27, 2023
5894c6c
more mypy fixes
sentrivana Sep 27, 2023
30fd779
more mypy
sentrivana Sep 27, 2023
5d251c2
mypy?
sentrivana Sep 27, 2023
e4a868f
mypy?
sentrivana Sep 27, 2023
e2b3222
mypy pls
sentrivana Sep 27, 2023
e7e9677
more tests
sentrivana Sep 27, 2023
9787172
remove comment
sentrivana Sep 27, 2023
740a94c
Merge branch 'master' into ivana/strawberry-integration
sentrivana Sep 28, 2023
9ed948d
Merge branch 'master' into ivana/strawberry-integration
sentrivana Oct 2, 2023
2dc5fe5
Merge branch 'master' into ivana/strawberry-integration
sentrivana Oct 2, 2023
a1a7a37
use new strawberry hook
sentrivana Oct 3, 2023
ea69abe
temp: test with strawberry prerelease
sentrivana Oct 3, 2023
aa29575
Merge branch 'master' into ivana/strawberry-integration
sentrivana Oct 3, 2023
6ca7183
mypy fixes
sentrivana Oct 3, 2023
d9863ec
update strawberry version
sentrivana Oct 3, 2023
65a2bce
dont override the hook completely
sentrivana Oct 3, 2023
5c03e8f
Update sentry_sdk/integrations/strawberry.py
sentrivana Oct 10, 2023
ebed817
Update sentry_sdk/integrations/strawberry.py
sentrivana Oct 10, 2023
f862b3c
Update sentry_sdk/integrations/strawberry.py
sentrivana Oct 10, 2023
6d9f35d
review feedback, round 1
sentrivana Oct 10, 2023
8a75c2a
review feedback 2
sentrivana Oct 10, 2023
168fe8c
use fixtures in tests
sentrivana Oct 10, 2023
11013d6
Merge branch 'master' into ivana/strawberry-integration
sentrivana Oct 10, 2023
6334cd9
Merge branch 'master' into ivana/strawberry-integration
sentrivana Oct 10, 2023
7831520
handle event['request'] being none
sentrivana Oct 10, 2023
aed4cc9
introduce package_version helper
sentrivana Oct 10, 2023
3df7256
Revert "introduce package_version helper"
sentrivana Oct 10, 2023
2ccd1eb
change to try..except
sentrivana Oct 10, 2023
ed52750
alias for parametrize
sentrivana Oct 10, 2023
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
83 changes: 83 additions & 0 deletions .github/workflows/test-integration-strawberry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Test strawberry

on:
push:
branches:
- master
- release/**

pull_request:

# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

env:
BUILD_CACHE_KEY: ${{ github.sha }}
CACHED_BUILD_PATHS: |
${{ github.workspace }}/dist-serverless

jobs:
test:
name: strawberry, python ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
python-version: ["3.8","3.9","3.10","3.11"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"

- name: Test strawberry
uses: nick-fields/retry@v2
with:
timeout_minutes: 15
max_attempts: 2
retry_wait_seconds: 5
shell: bash
command: |
set -x # print commands that are executed
coverage erase

# Run tests
./scripts/runtox.sh "py${{ matrix.python-version }}-strawberry" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
coverage combine .coverage* &&
coverage xml -i

- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml


check_required_tests:
name: All strawberry tests passed or skipped
needs: test
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-20.04
steps:
- name: Check for failures
if: contains(needs.test.result, 'failure')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
7 changes: 7 additions & 0 deletions sentry_sdk/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ class OP:
FUNCTION = "function"
FUNCTION_AWS = "function.aws"
FUNCTION_GCP = "function.gcp"
GRAPHQL_EXECUTE = "graphql.execute"
GRAPHQL_MUTATION = "graphql.mutation"
GRAPHQL_PARSE = "graphql.parse"
GRAPHQL_RESOLVE = "graphql.resolve"
GRAPHQL_SUBSCRIPTION = "graphql.subscription"
GRAPHQL_QUERY = "graphql.query"
GRAPHQL_VALIDATE = "graphql.validate"
GRPC_CLIENT = "grpc.client"
GRPC_SERVER = "grpc.server"
HTTP_CLIENT = "http.client"
Expand Down
Loading