Skip to content

Commit df2a1e4

Browse files
authored
Merge branch 'main' into store-emails-in-s3
2 parents 4102c57 + 063d825 commit df2a1e4

File tree

108 files changed

+3081
-934
lines changed

Some content is hidden

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

108 files changed

+3081
-934
lines changed

.github/workflows/build-frontend.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ jobs:
4242
sentry_auth_token=$(aws ssm get-parameter --output text --query Parameter.Value --with-decryption --name /pythonit/${{ inputs.tf_environment }}/common/sentry-auth-token)
4343
echo "::add-mask::$sentry_auth_token"
4444
echo "SENTRY_AUTH_TOKEN=$sentry_auth_token" >> "$GITHUB_OUTPUT"
45-
46-
posthog_key=$(aws ssm get-parameter --output text --query Parameter.Value --with-decryption --name /pythonit/${{ inputs.tf_environment }}/pycon-frontend/posthog-key)
47-
echo "::add-mask::$posthog_key"
48-
echo "POSTHOG_KEY=$posthog_key" >> "$GITHUB_OUTPUT"
4945
- name: Build and push
5046
uses: docker/build-push-action@v6
5147
with:
@@ -66,5 +62,4 @@ jobs:
6662
CONFERENCE_CODE=${{ steps.vars.outputs.conference_code }}
6763
GIT_HASH=${{ inputs.githash }}
6864
secrets: |
69-
sentry_auth_token=${{ steps.vars.outputs.sentry_auth_token }}
70-
posthog_key=${{ steps.vars.outputs.posthog_key }}
65+
"sentry_auth_token=${{ steps.vars.outputs.sentry_auth_token }}"

.github/workflows/claude.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Claude PR Assistant
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude-code-action:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
issues: read
25+
id-token: write
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 1
31+
32+
- name: Run Claude PR Action
33+
uses: anthropics/claude-code-action@beta
34+
with:
35+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
36+
# Or use OAuth token instead:
37+
# claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38+
timeout_minutes: "60"
39+
# mode: tag # Default: responds to @claude mentions
40+
# Optional: Restrict network access to specific domains only
41+
# experimental_allowed_domains: |
42+
# .anthropic.com
43+
# .github.com
44+
# api.github.com
45+
# .githubusercontent.com
46+
# bun.sh
47+
# registry.npmjs.org
48+
# .blob.core.windows.net

.github/workflows/frontend-lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,7 @@ jobs:
3434
run: pnpm install
3535
- name: Codegen
3636
run: pnpm run codegen
37+
env:
38+
API_URL_SERVER: https://pastaporto-admin.pycon.it
3739
- name: Run Biome
3840
run: biome ci .

backend/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ENV LIBRARY_PATH=/lib:/usr/lib LD_LIBRARY_PATH=/lib:/usr/lib
7272

7373
RUN apt-get update -y && apt-get install -y curl
7474

75-
RUN groupadd -r app && useradd -r -g app app && mkdir -p ${FUNCTION_DIR} && chown -R app:app ${FUNCTION_DIR}
75+
RUN groupadd -r app && useradd -r -g app app && mkdir -p ${FUNCTION_DIR} && chown -R app:app ${FUNCTION_DIR} && mkdir -p /tmp/pycon && chown -R app:app /tmp/pycon
7676

7777
COPY --chown=app:app --from=js-stage ${FUNCTION_DIR}/dist/*.html ${FUNCTION_DIR}/custom_admin/templates/astro/
7878
COPY --chown=app:app --from=js-stage ${FUNCTION_DIR}/dist/widgets/*.html ${FUNCTION_DIR}/custom_admin/templates/astro/widgets/
@@ -83,6 +83,8 @@ COPY --chown=app:app . ${FUNCTION_DIR}
8383

8484
USER app
8585

86+
VOLUME ["/tmp/pycon"]
87+
8688
RUN mkdir -p assets && .venv/bin/python manage.py collectstatic --noinput
8789

8890
ENTRYPOINT ["/home/app/.venv/bin/gunicorn"]

backend/api/billing/types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ class BillingAddress:
66
id: strawberry.ID
77
is_business: bool
88
company_name: str
9-
user_name: str
9+
user_given_name: str
10+
user_family_name: str
1011
zip_code: str
1112
city: str
1213
address: str
@@ -22,7 +23,8 @@ def from_django_model(cls, instance):
2223
id=instance.id,
2324
is_business=instance.is_business,
2425
company_name=instance.company_name,
25-
user_name=instance.user_name,
26+
user_given_name=instance.user_given_name,
27+
user_family_name=instance.user_family_name,
2628
zip_code=instance.zip_code,
2729
city=instance.city,
2830
address=instance.address,

backend/api/files_upload/permissions.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ def _check_proposal_material(self, user, input: "UploadFileInput") -> bool:
3737
conference_code = input.data.conference_code
3838

3939
try:
40-
proposal = Submission.objects.for_conference_code(
41-
conference_code
42-
).get_by_hashid(proposal_id)
40+
proposal = (
41+
Submission.objects.for_conference_code(conference_code)
42+
.filter(status=Submission.STATUS.accepted)
43+
.get_by_hashid(proposal_id)
44+
)
4345
except (Submission.DoesNotExist, IndexError):
4446
return False
4547

backend/api/files_upload/tests/mutations/test_upload_file.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22
from files_upload.models import File
3-
from submissions.tests.factories import SubmissionFactory
3+
from submissions.tests.factories import AcceptedSubmissionFactory, SubmissionFactory
44
from conferences.tests.factories import ConferenceFactory
55
from django.test import override_settings
66

@@ -64,7 +64,7 @@ def test_upload_participant_avatar_to_invalid_conf_fails(graphql_client, user):
6464

6565

6666
def test_upload_proposal_material_file(graphql_client, user):
67-
proposal = SubmissionFactory(speaker=user)
67+
proposal = AcceptedSubmissionFactory(speaker=user)
6868
graphql_client.force_login(user)
6969

7070
response = _upload_file(
@@ -88,7 +88,26 @@ def test_upload_proposal_material_file(graphql_client, user):
8888

8989

9090
def test_cannot_upload_proposal_material_file_if_not_speaker(graphql_client, user):
91-
proposal = SubmissionFactory()
91+
proposal = AcceptedSubmissionFactory()
92+
graphql_client.force_login(user)
93+
94+
response = _upload_file(
95+
graphql_client,
96+
{
97+
"proposalMaterial": {
98+
"filename": "test.txt",
99+
"proposalId": proposal.hashid,
100+
"conferenceCode": proposal.conference.code,
101+
}
102+
},
103+
)
104+
105+
assert not response["data"]
106+
assert response["errors"][0]["message"] == "You cannot upload files of this type"
107+
108+
109+
def test_cannot_upload_proposal_material_file_if_not_accepted(graphql_client, user):
110+
proposal = SubmissionFactory(status="proposed")
92111
graphql_client.force_login(user)
93112

94113
response = _upload_file(
@@ -129,7 +148,7 @@ def test_cannot_upload_proposal_material_file_with_invalid_proposal_id(
129148
def test_cannot_upload_proposal_material_file_with_invalid_proposal_id_for_conference(
130149
graphql_client, user
131150
):
132-
proposal = SubmissionFactory()
151+
proposal = AcceptedSubmissionFactory()
133152
graphql_client.force_login(user)
134153

135154
response = _upload_file(
@@ -151,7 +170,7 @@ def test_cannot_upload_proposal_material_file_with_invalid_proposal_id_for_confe
151170
"file_type", [File.Type.PARTICIPANT_AVATAR, File.Type.PROPOSAL_MATERIAL]
152171
)
153172
def test_superusers_can_upload_anything(graphql_client, admin_superuser, file_type):
154-
proposal = SubmissionFactory()
173+
proposal = AcceptedSubmissionFactory()
155174
graphql_client.force_login(admin_superuser)
156175

157176
req_input = {}

backend/api/job_board/schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ class JobBoardQuery:
1111
def job_listings(self, conference: str) -> list[JobListingType]:
1212
return [
1313
JobListingType.from_django_model(listing)
14-
for listing in JobListing.objects.filter(conference__code=conference).all()
14+
for listing in JobListing.objects.filter(conference__code=conference)
15+
.order_by("order")
16+
.all()
1517
]
1618

1719
@strawberry.field

backend/api/job_board/types.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
import strawberry
44

5-
from ..helpers.i18n import make_localized_resolver
6-
75

86
@strawberry.type
97
class JobListing:
108
id: strawberry.ID
11-
title: str = strawberry.field(resolver=make_localized_resolver("title"))
12-
slug: str = strawberry.field(resolver=make_localized_resolver("slug"))
13-
description: str = strawberry.field(resolver=make_localized_resolver("description"))
9+
title: str
10+
slug: str
11+
description: str
1412
company: str
1513
company_logo_url: strawberry.Private[Optional[str]]
1614
apply_url: str

backend/api/orders/mutations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def create_order(
4343
is_business=input.invoice_information.is_business,
4444
defaults={
4545
"company_name": input.invoice_information.company,
46-
"user_name": input.invoice_information.name,
46+
"user_given_name": input.invoice_information.given_name,
47+
"user_family_name": input.invoice_information.family_name,
4748
"zip_code": input.invoice_information.zipcode,
4849
"city": input.invoice_information.city,
4950
"address": input.invoice_information.street,

0 commit comments

Comments
 (0)