Skip to content

Commit

Permalink
Merge pull request #44 from siemens/feat/sentry-202402
Browse files Browse the repository at this point in the history
feat: upgrade to sentry 2024.02 and bump python to 3.11
  • Loading branch information
max-wittig committed Feb 26, 2024
2 parents 5371ff5 + 8d69e57 commit f2e256d
Show file tree
Hide file tree
Showing 11 changed files with 291 additions and 268 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.11"
- uses: abatilo/actions-poetry@v2
- name: Publish package
run: |
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.11"
- uses: psf/black@stable
with:
options: "--check ."
Expand All @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14.5
image: postgres:14.11
env:
POSTGRES_HOST_AUTH_METHOD: trust
# Set health checks to wait until postgres has started
Expand All @@ -45,28 +45,26 @@ jobs:
ports:
- 5432:5432
memcached:
image: memcached:1.6.21-alpine
image: memcached:1.6.23-alpine
ports:
- 11211:11211
redis:
image: redis:6.2.12-alpine
image: redis:6.2.14-alpine
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.11"
- uses: abatilo/actions-poetry@v2
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'
- name: Setup required upstream yarn version
run: yarn set version 1.22.5
run: yarn set version 1.22.21
- run: |
sudo apt-get update && sudo apt-get install -y libxmlsec1-dev libmaxminddb-dev
python3 -m venv venv
. venv/bin/activate
venv/bin/pip3 install -U wheel
make develop
make test
poetry install --with test
make deps
poetry run pytest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ venv
.venv
.coverage
.vscode/
# Fetched from upstream
requirements-sentry.txt
tests/conftest.py
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8.13
3.11.8
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
SENTRY_VERSION := 22.8.0
SENTRY_VERSION := 24.2.0

.PHONY: clean develop test
.PHONY: clean deps

develop:
pip3 install -e git+https://github.com/getsentry/sentry.git@$(SENTRY_VERSION)#egg=sentry[dev]
poetry install -n --no-dev
poetry build && pip3 install -U dist/*.whl
pip3 install -U codecov pytest freezegun fixtures

test:
@echo "--> Running Python tests"
python -m pytest tests || exit 1
@echo ""
# Upstream no longer tracks its own dependencies in the package as dev extras,
# so we cannot resolve them here as transitive dependencies. Instead we fetch
# their locked development dependencies.
# Likewise, their root-level conftest is not provided as a pytest plugin for
# use outside their own tests, but we need their fixtures. We fetch them into
# our own namespace here.
deps:
curl -L -o requirements-sentry.txt https://github.com/getsentry/sentry/raw/$(SENTRY_VERSION)/requirements-dev-frozen.txt
curl -L -o tests/conftest.py https://github.com/getsentry/sentry/raw/$(SENTRY_VERSION)/tests/conftest.py
poetry run pip install -r requirements-sentry.txt

clean:
rm -rf *.egg-info src/*.egg-info
Expand Down
8 changes: 0 additions & 8 deletions conftest.py

This file was deleted.

21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
postgres:
image: postgres:14.11
environment:
POSTGRES_HOST_AUTH_METHOD: trust
# Set health checks to wait until postgres has started
healthcheck:
test: ["CMD-SHELL", “pg_isready”]
interval: 10s
timeout: 5s
retries: 5
ports:
- 5432:5432
memcached:
image: memcached:1.6.23-alpine
ports:
- 11211:11211
redis:
image: redis:6.2.14-alpine
ports:
- 6379:6379
12 changes: 3 additions & 9 deletions oidc/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,20 @@ def get_configure_view(self):

def get_auth_pipeline(self):
return [
OIDCLogin(self.get_client_id(), domains=self.domains),
OIDCLogin(domains=self.domains, client_id=self.get_client_id()),
OAuth2Callback(
access_token_url=TOKEN_ENDPOINT,
client_id=self.get_client_id(),
client_secret=self.get_client_secret(),
),
FetchUser(
domains=self.domains,
version=self.version,
),
FetchUser(domains=self.domains, version=self.version),
]

def get_refresh_token_url(self):
return TOKEN_ENDPOINT

def build_config(self, state):
return {
"domains": [state["domain"]],
"version": DATA_VERSION,
}
return {"domains": [state["domain"]], "version": DATA_VERSION}

def get_user_info(self, bearer_token):
endpoint = USERINFO_ENDPOINT
Expand Down
Loading

0 comments on commit f2e256d

Please sign in to comment.