Skip to content

Commit f2e256d

Browse files
authored
Merge pull request #44 from siemens/feat/sentry-202402
feat: upgrade to sentry 2024.02 and bump python to 3.11
2 parents 5371ff5 + 8d69e57 commit f2e256d

File tree

11 files changed

+291
-268
lines changed

11 files changed

+291
-268
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616
- uses: actions/setup-python@v4
1717
with:
18-
python-version: "3.8"
18+
python-version: "3.11"
1919
- uses: abatilo/actions-poetry@v2
2020
- name: Publish package
2121
run: |

.github/workflows/test.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@v4
1919
- uses: actions/setup-python@v4
2020
with:
21-
python-version: "3.8"
21+
python-version: "3.11"
2222
- uses: psf/black@stable
2323
with:
2424
options: "--check ."
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ubuntu-latest
3434
services:
3535
postgres:
36-
image: postgres:14.5
36+
image: postgres:14.11
3737
env:
3838
POSTGRES_HOST_AUTH_METHOD: trust
3939
# Set health checks to wait until postgres has started
@@ -45,28 +45,26 @@ jobs:
4545
ports:
4646
- 5432:5432
4747
memcached:
48-
image: memcached:1.6.21-alpine
48+
image: memcached:1.6.23-alpine
4949
ports:
5050
- 11211:11211
5151
redis:
52-
image: redis:6.2.12-alpine
52+
image: redis:6.2.14-alpine
5353
ports:
5454
- 6379:6379
5555
steps:
5656
- uses: actions/checkout@v4
5757
- uses: actions/setup-python@v4
5858
with:
59-
python-version: "3.8"
59+
python-version: "3.11"
6060
- uses: abatilo/actions-poetry@v2
6161
- uses: actions/setup-node@v3
6262
with:
63-
node-version: '16'
63+
node-version: '18'
6464
- name: Setup required upstream yarn version
65-
run: yarn set version 1.22.5
65+
run: yarn set version 1.22.21
6666
- run: |
6767
sudo apt-get update && sudo apt-get install -y libxmlsec1-dev libmaxminddb-dev
68-
python3 -m venv venv
69-
. venv/bin/activate
70-
venv/bin/pip3 install -U wheel
71-
make develop
72-
make test
68+
poetry install --with test
69+
make deps
70+
poetry run pytest

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ venv
77
.venv
88
.coverage
99
.vscode/
10+
# Fetched from upstream
11+
requirements-sentry.txt
12+
tests/conftest.py

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.13
1+
3.11.8

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
SENTRY_VERSION := 22.8.0
1+
SENTRY_VERSION := 24.2.0
22

3-
.PHONY: clean develop test
3+
.PHONY: clean deps
44

5-
develop:
6-
pip3 install -e git+https://github.com/getsentry/sentry.git@$(SENTRY_VERSION)#egg=sentry[dev]
7-
poetry install -n --no-dev
8-
poetry build && pip3 install -U dist/*.whl
9-
pip3 install -U codecov pytest freezegun fixtures
10-
11-
test:
12-
@echo "--> Running Python tests"
13-
python -m pytest tests || exit 1
14-
@echo ""
5+
# Upstream no longer tracks its own dependencies in the package as dev extras,
6+
# so we cannot resolve them here as transitive dependencies. Instead we fetch
7+
# their locked development dependencies.
8+
# Likewise, their root-level conftest is not provided as a pytest plugin for
9+
# use outside their own tests, but we need their fixtures. We fetch them into
10+
# our own namespace here.
11+
deps:
12+
curl -L -o requirements-sentry.txt https://github.com/getsentry/sentry/raw/$(SENTRY_VERSION)/requirements-dev-frozen.txt
13+
curl -L -o tests/conftest.py https://github.com/getsentry/sentry/raw/$(SENTRY_VERSION)/tests/conftest.py
14+
poetry run pip install -r requirements-sentry.txt
1515

1616
clean:
1717
rm -rf *.egg-info src/*.egg-info

conftest.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

docker-compose.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
services:
2+
postgres:
3+
image: postgres:14.11
4+
environment:
5+
POSTGRES_HOST_AUTH_METHOD: trust
6+
# Set health checks to wait until postgres has started
7+
healthcheck:
8+
test: ["CMD-SHELL", “pg_isready”]
9+
interval: 10s
10+
timeout: 5s
11+
retries: 5
12+
ports:
13+
- 5432:5432
14+
memcached:
15+
image: memcached:1.6.23-alpine
16+
ports:
17+
- 11211:11211
18+
redis:
19+
image: redis:6.2.14-alpine
20+
ports:
21+
- 6379:6379

oidc/provider.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,20 @@ def get_configure_view(self):
6868

6969
def get_auth_pipeline(self):
7070
return [
71-
OIDCLogin(self.get_client_id(), domains=self.domains),
71+
OIDCLogin(domains=self.domains, client_id=self.get_client_id()),
7272
OAuth2Callback(
7373
access_token_url=TOKEN_ENDPOINT,
7474
client_id=self.get_client_id(),
7575
client_secret=self.get_client_secret(),
7676
),
77-
FetchUser(
78-
domains=self.domains,
79-
version=self.version,
80-
),
77+
FetchUser(domains=self.domains, version=self.version),
8178
]
8279

8380
def get_refresh_token_url(self):
8481
return TOKEN_ENDPOINT
8582

8683
def build_config(self, state):
87-
return {
88-
"domains": [state["domain"]],
89-
"version": DATA_VERSION,
90-
}
84+
return {"domains": [state["domain"]], "version": DATA_VERSION}
9185

9286
def get_user_info(self, bearer_token):
9387
endpoint = USERINFO_ENDPOINT

0 commit comments

Comments
 (0)