Skip to content

test(decision-model-lint): Probe the diff context (do not merge) - #129449

Draft
akhilp117 wants to merge 7 commits into
masterfrom
akhilpindiprolu/test-decision-lint-diff
Draft

akhilp117 wants to merge 7 commits into
masterfrom
akhilpindiprolu/test-decision-lint-diff

Conversation

@akhilp117

Copy link
Copy Markdown
Contributor

A PR to test if the added diff changes to decision-lint worked and is accurate

@github-actions github-actions Bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

decision-model-linter

api

src/sentry/api/endpoints/decision_lint_probe.py

  • warn returnsUnpaginatedList = TRUE (0.97): List endpoints should paginate with self.paginate(...) and a cursor parameter. This endpoint returns a list that can keep growing without paginating it. If the endpoint already exists, don't add pagination here: that changes what existing callers get back, so it's a breaking change that needs a deprecation plan.
  • warn returnsNumericIdAsInteger = TRUE (0.78): API responses should return numeric IDs as strings, for example str(obj.id). This file returns one as an integer. If the field already exists, don't change its type here, because callers expect a number. Only new fields should follow this rule.

src/sentry/api/serializers/models/exporteddata.py

  • warn returnsNumericIdAsInteger = TRUE (0.93): API responses should return numeric IDs as strings, for example str(obj.id). This file returns one as an integer. If the field already exists, don't change its type here, because callers expect a number. Only new fields should follow this rule.

src/sentry/flags/endpoints/logs.py

  • warn returnsNumericIdAsInteger = TRUE (0.85): API responses should return numeric IDs as strings, for example str(obj.id). This file returns one as an integer. If the field already exists, don't change its type here, because callers expect a number. Only new fields should follow this rule.

decision-model-linter: 17 calls on 6 files, 40,818 input tokens, $0.0017, model typesafe/jev-1.13-20260917


class AssistantSerializer(serializers.Serializer):
guide = serializers.CharField(required=False)
guide = serializers.CharField(required=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

required=True on guide rejects documented guide_id-only requests

Making guide required breaks the documented guide_id-only PUT path; keep required=False and enforce the either-or rule in validate().

Evidence
  • Hunk sets guide = serializers.CharField(required=True), so DRF rejects payloads missing guide before validate() runs.
  • AssistantEndpoint.put documents request shape as 'guide_id': <guide_id> - OR - 'guide': guide key.
  • AssistantSerializer.validate() still early-returns when only guide_id is present and errors only when neither is provided.
  • Concrete failing input: {"guide_id": <valid_id>, "status": "viewed"} previously accepted, now returns 400 guide: This field is required.

Identified by Warden · sentry-backend-bugs · MN9-U8U

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Backend Test Failures

Failures on f254451 in this run:

tests/sentry/core/endpoints/test_organization_environments.py::OrganizationEnvironmentsTest::test_invalid_visibility — log
[gw0] linux -- Python 3.13.17 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/core/endpoints/test_organization_environments.py:59: in test_invalid_visibility
    assert response.data["detail"].startswith("Invalid value for 'visibility'")
E   assert False
E    +  where False = <built-in method startswith of ErrorDetail object at 0x7f4e431be6f0>("Invalid value for 'visibility'")
E    +    where <built-in method startswith of ErrorDetail object at 0x7f4e431be6f0> = ErrorDetail(string="Invalid 'visibility'. Valid values are: ['all', 'hidden', 'visible']", code='parse_error').startswith
tests/sentry/data_export/endpoints/test_data_export.py::DataExportTest::test_new_export — log
[gw0] linux -- Python 3.13.17 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/data_export/endpoints/test_data_export.py:122: in test_new_export
    assert response.data == {
E   AssertionError: assert {'id': 34, 'u...one.utc), ...} == {'id': 34, 'u...d': None, ...}
E     
E     Omitting 10 identical items, use -vv to show
E     Left contains 1 more item:
E     �[0m{�[33m'�[39;49;00m�[33morganizationId�[39;49;00m�[33m'�[39;49;00m: �[94m4559105894776848�[39;49;00m}�[90m�[39;49;00m
E     
E     Full diff:
E     �[0m�[90m �[39;49;00m {�[90m�[39;49;00m
E     �[90m �[39;49;00m     'id': 34,�[90m�[39;49;00m
E     �[90m �[39;49;00m     'user': {�[90m�[39;49;00m
E     �[90m �[39;49;00m         'id': '62',�[90m�[39;49;00m
E     �[90m �[39;49;00m         'email': 'user1@example.com',�[90m�[39;49;00m
E     �[90m �[39;49;00m         'username': 'user1@example.com',�[90m�[39;49;00m
E     �[90m �[39;49;00m     },�[90m�[39;49;00m
E     �[92m+     'organizationId': 4559105894776848,�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m     'dateCreated': datetime.datetime(2026, 11, 1, 18, 13, 46, 416326, tzinfo=datetime.timezone.utc),�[90m�[39;49;00m
E     �[90m �[39;49;00m     'dateFinished': None,�[90m�[39;49;00m
E     �[90m �[39;49;00m     'dateExpired': None,�[90m�[39;49;00m
E     �[90m �[39;49;00m     'query': {�[90m�[39;49;00m
E     �[90m �[39;49;00m         'type': 'Issues-by-Tag',�[90m�[39;49;00m
E     �[90m �[39;49;00m         'info': {�[90m�[39;49;00m
E     �[90m �[39;49;00m             'env': 'test',�[90m�[39;49;00m
E     �[90m �[39;49;00m             'project': [�[90m�[39;49;00m
E     �[90m �[39;49;00m                 4559105894776848,�[90m�[39;49;00m
E     �[90m �[39;49;00m             ],�[90m�[39;49;00m
E     �[90m �[39;49;00m         },�[90m�[39;49;00m
E     �[90m �[39;49;00m     },�[90m�[39;49;00m
E     �[90m �[39;49;00m     'status': <ExportStatus.Early: 'EARLY'>,�[90m�[39;49;00m
E     �[90m �[39;49;00m     'checksum': None,�[90m�[39;49;00m
E     �[92m+     'fileName': None,�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m     'export_format': 'csv',�[90m�[39;49;00m
E     �[91m-     'fileName': None,�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m }�[90m�[39;49;00m
tests/sentry/data_export/endpoints/test_data_export.py::DataExportTest::test_progress_export — log
[gw0] linux -- Python 3.13.17 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/data_export/endpoints/test_data_export.py:153: in test_progress_export
    assert response2.data == {
E   AssertionError: assert {'id': 41, 'u...one.utc), ...} == {'id': 41, 'u...d': None, ...}
E     
E     Omitting 10 identical items, use -vv to show
E     Left contains 1 more item:
E     �[0m{�[33m'�[39;49;00m�[33morganizationId�[39;49;00m�[33m'�[39;49;00m: �[94m4559105894842384�[39;49;00m}�[90m�[39;49;00m
E     
E     Full diff:
E     �[0m�[90m �[39;49;00m {�[90m�[39;49;00m
E     �[90m �[39;49;00m     'id': 41,�[90m�[39;49;00m
E     �[90m �[39;49;00m     'user': {�[90m�[39;49;00m
E     �[90m �[39;49;00m         'id': '69',�[90m�[39;49;00m
E     �[90m �[39;49;00m         'email': 'user1@example.com',�[90m�[39;49;00m
E     �[90m �[39;49;00m         'username': 'user1@example.com',�[90m�[39;49;00m
E     �[90m �[39;49;00m     },�[90m�[39;49;00m
E     �[92m+     'organizationId': 4559105894842384,�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m     'dateCreated': datetime.datetime(2026, 11, 1, 18, 13, 48, 49456, tzinfo=datetime.timezone.utc),�[90m�[39;49;00m
E     �[90m �[39;49;00m     'dateFinished': None,�[90m�[39;49;00m
E     �[90m �[39;49;00m     'dateExpired': None,�[90m�[39;49;00m
E     �[90m �[39;49;00m     'query': {�[90m�[39;49;00m
E     �[90m �[39;49;00m         'type': 'Issues-by-Tag',�[90m�[39;49;00m
E     �[90m �[39;49;00m         'info': {�[90m�[39;49;00m
E     �[90m �[39;49;00m             'env': 'test',�[90m�[39;49;00m
E     �[90m �[39;49;00m             'project': [�[90m�[39;49;00m
E     �[90m �[39;49;00m                 4559105894842384,�[90m�[39;49;00m
E     �[90m �[39;49;00m             ],�[90m�[39;49;00m
E     �[90m �[39;49;00m         },�[90m�[39;49;00m
E     �[90m �[39;49;00m     },�[90m�[39;49;00m
E     �[90m �[39;49;00m     'status': <ExportStatus.Early: 'EARLY'>,�[90m�[39;49;00m
E     �[90m �[39;49;00m     'checksum': None,�[90m�[39;49;00m
E     �[92m+     'fileName': None,�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m     'export_format': 'csv',�[90m�[39;49;00m
E     �[91m-     'fileName': None,�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m }�[90m�[39;49;00m

@akhilp117 akhilp117 changed the title Akhilpindiprolu/test decision lint diff test(decision-model-lint): Probe the diff context (do not merge) Nov 2, 2026

This branch has not been deployed

No deployments
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 Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant