Skip to content

Commit

Permalink
Build fixes (#65)
Browse files Browse the repository at this point in the history
* Switch to building psycopg2. The binary wheels don't work well with docker + apple silicon
* Update issue URL to work with multi-region
* Fix test
* Fix lint
  • Loading branch information
markstory authored Dec 7, 2023
1 parent 238068e commit c25225c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions backend-py/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM python:3.9-slim as backend-py

RUN apt update && \
apt install -y python3-dev gcc libpq-dev

WORKDIR /backend-py
# Re-create the requirements layer if the requirements change
COPY requirements.txt .
Expand Down
2 changes: 1 addition & 1 deletion backend-py/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ packaging==21.3
pathspec==0.9.0
platformdirs==2.5.1
pluggy==1.0.0
psycopg2-binary==2.9.3
psycopg2==2.9.3
py==1.11.0
pycodestyle==2.8.0
pyflakes==2.4.0
Expand Down
4 changes: 3 additions & 1 deletion backend-py/src/api/endpoints/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def add_sentry_api_data(
for item in items:
if item["sentryId"]:
# Use the numerical ID to fetch the short ID
sentry_data = sentry.get(f"/issues/{item['sentryId']}/")
sentry_data = sentry.get(
f"/organizations/{organization.external_slug}/issues/{item['sentryId']}/"
)
short_id = sentry_data.json().get("shortId")
# Replace the numerical ID with the short ID
if short_id:
Expand Down
4 changes: 2 additions & 2 deletions backend-py/tests/api/items/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_index_with_sentry_api(self):

responses.add(
responses.GET,
f"{SENTRY_URL}/api/0/issues/{sentry_id}/",
f"{SENTRY_URL}/api/0/organizations/organization/issues/{sentry_id}/",
body=json.dumps({"shortId": short_id}),
)

Expand All @@ -57,7 +57,7 @@ def test_index_with_failing_sentry_api(self):

responses.add(
responses.GET,
f"{SENTRY_URL}/api/0/issues/{sentry_id}/",
f"{SENTRY_URL}/api/0/organizations/organization/issues/{sentry_id}/",
body=json.dumps({}),
)

Expand Down

0 comments on commit c25225c

Please sign in to comment.