Skip to content

Conversation

@liuirene256
Copy link
Member

@liuirene256 liuirene256 commented Nov 19, 2025

ECO 1200 and ECO 1269

@liuirene256 liuirene256 requested review from a team as code owners November 19, 2025 00:16
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 19, 2025
@codecov
Copy link

codecov bot commented Nov 19, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
29884 2 29882 245
View the top 2 failed test(s) by shortest run time
tests.sentry.integrations.api.serializers.rest_framework.test_data_forwarder.DataForwarderSerializerTest::test_required_fields
Stack Traces | 0.977s run time
#x1B[1m#x1B[.../serializers/rest_framework/test_data_forwarder.py#x1B[0m:80: in test_required_fields
    assert not serializer.is_valid()
#x1B[1m#x1B[31mE   AssertionError: assert not True#x1B[0m
#x1B[1m#x1B[31mE    +  where True = <bound method BaseSerializer.is_valid of DataForwarderSerializer(data={'organization_id': 4557141661450240, 'provider'...s 'dict'>)\n    project_ids = ListField(allow_empty=True, child=IntegerField(), default=<class 'list'>, required=False)>()#x1B[0m
#x1B[1m#x1B[31mE    +    where <bound method BaseSerializer.is_valid of DataForwarderSerializer(data={'organization_id': 4557141661450240, 'provider'...s 'dict'>)\n    project_ids = ListField(allow_empty=True, child=IntegerField(), default=<class 'list'>, required=False)> = DataForwarderSerializer(data={'organization_id': 4557141661450240, 'provider': <DataForwarderProviderSlug.SEGMENT: 'se...ss 'dict'>)\n    project_ids = ListField(allow_empty=True, child=IntegerField(), default=<class 'list'>, required=False).is_valid#x1B[0m
tests.sentry.integrations.api.endpoints.test_data_forwarding.DataForwardingIndexPostTest::test_create_without_project_ids
Stack Traces | 1.39s run time
#x1B[1m#x1B[.../api/endpoints/test_data_forwarding.py#x1B[0m:359: in test_create_without_project_ids
    assert data_forwarder.project.count() == 0
#x1B[1m#x1B[31mE   AttributeError: 'DataForwarder' object has no attribute 'project'. Did you mean: 'projects'?#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.

Copy link
Member

@leeandher leeandher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, may just want a test for the new models to prevent a regression


def validate_config(self, config) -> SQSConfig | SegmentConfig | SplunkConfig:
# Filter out empty string values (cleared optional fields)
config = {k: v for k, v in config.items() if v != ""}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Config filter permits whitespace-only credential values

The filter removes empty string values but allows whitespace-only strings like " " to pass through. Since allow_blank=True was added to the config field, values that are only spaces now pass the filter and reach validation without being rejected. This allows invalid credentials (whitespace-only access_key or secret_key) to pass serializer validation and fail later at runtime. The filter should check for stripped-empty values.

Fix in Cursor Fix in Web

assert response.data["provider"] == DataForwarderProviderSlug.SEGMENT

data_forwarder = DataForwarder.objects.get(id=response.data["id"])
assert data_forwarder.project.count() == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Test accesses wrong related_name for data_forwarder

The test accesses data_forwarder.project.count() but the DataForwarderProject model defines the reverse relationship with related_name="projects". This should be data_forwarder.projects.count() to correctly reference the related manager and avoid an AttributeError at runtime.

Fix in Cursor Fix in Web

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.

3 participants