Skip to content

Drop EventAttachment.file_id, part 2 #93808

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

Draft
wants to merge 3 commits into
base: swatinem/rm-eventattachment-fileid-part2
Choose a base branch
from

Conversation

Swatinem
Copy link
Member

Fully drops the columns.

Swatinem added 3 commits June 18, 2025 15:25
Already 17 months ago in #62318, I switched the `EventAttachment` code over from using the `file_id` and django `File`-models to storing things in filestore (the go service) directly via the `blob_path`.

As attachments have a 30 day TTL, it is high time to remove the backwards compatibility code.
First part of dropping the column, marking it as pending.
Fully drops the columns.
@Swatinem Swatinem requested a review from a team June 18, 2025 13:40
@Swatinem Swatinem self-assigned this Jun 18, 2025
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 18, 2025
Copy link

codecov bot commented Jun 18, 2025

❌ 26 Tests Failed:

Tests completed Failed Passed Skipped
26282 26 26256 210
View the top 3 failed test(s) by shortest run time
tests.sentry.api.endpoints.test_group_attachments.GroupEventAttachmentsTest::test_date_range_filter
Stack Traces | 3.02s run time
#x1B[1m#x1B[.../api/endpoints/test_group_attachments.py#x1B[0m:139: in test_date_range_filter
    old_attachment = self.create_attachment(event_id="b" * 32)
#x1B[1m#x1B[.../api/endpoints/test_group_attachments.py#x1B[0m:21: in create_attachment
    self.attachment = EventAttachment.objects.create(
#x1B[1m#x1B[.../sentry/silo/base.py#x1B[0m:158: in override
    return original_method(*args, **kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/models/manager.py#x1B[0m:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
#x1B[1m#x1B[.../sentry/silo/base.py#x1B[0m:158: in override
    return original_method(*args, **kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/models/query.py#x1B[0m:661: in create
    obj = self.model(**kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/models/base.py#x1B[0m:569: in __init__
    raise TypeError(
#x1B[1m#x1B[31mE   TypeError: EventAttachment() got unexpected keyword arguments: 'file_id'#x1B[0m
tests.sentry.api.endpoints.test_event_attachments.EventAttachmentsTest::test_is_screenshot
Stack Traces | 3.12s run time
#x1B[1m#x1B[.../api/endpoints/test_event_attachments.py#x1B[0m:86: in test_is_screenshot
    EventAttachment.objects.create(
#x1B[1m#x1B[.../sentry/silo/base.py#x1B[0m:158: in override
    return original_method(*args, **kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/models/manager.py#x1B[0m:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
#x1B[1m#x1B[.../sentry/silo/base.py#x1B[0m:158: in override
    return original_method(*args, **kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/models/query.py#x1B[0m:661: in create
    obj = self.model(**kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/models/base.py#x1B[0m:569: in __init__
    raise TypeError(
#x1B[1m#x1B[31mE   TypeError: EventAttachment() got unexpected keyword arguments: 'file_id'#x1B[0m
tests.sentry.api.endpoints.test_group_attachments.GroupEventAttachmentsTest::test_without_feature
Stack Traces | 3.15s run time
#x1B[1m#x1B[.../api/endpoints/test_group_attachments.py#x1B[0m:101: in test_without_feature
    self.create_attachment()
#x1B[1m#x1B[.../api/endpoints/test_group_attachments.py#x1B[0m:21: in create_attachment
    self.attachment = EventAttachment.objects.create(
#x1B[1m#x1B[.../sentry/silo/base.py#x1B[0m:158: in override
    return original_method(*args, **kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/models/manager.py#x1B[0m:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
#x1B[1m#x1B[.../sentry/silo/base.py#x1B[0m:158: in override
    return original_method(*args, **kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/models/query.py#x1B[0m:661: in create
    obj = self.model(**kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/models/base.py#x1B[0m:569: in __init__
    raise TypeError(
#x1B[1m#x1B[31mE   TypeError: EventAttachment() got unexpected keyword arguments: 'file_id'#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@Swatinem Swatinem force-pushed the swatinem/rm-eventattachment-fileid-part2 branch 3 times, most recently from 1630998 to f99f0b1 Compare June 18, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant