Repository navigation
test(decision-model-lint): Probe the diff context (do not merge) #129449
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
akhilp117
wants to merge
7
commits into
master
Choose a base branch
from
akhilpindiprolu/test-decision-lint-diff
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+129
−4
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7d11718
ci(decision-model-lint): Add temporary warn-only API and security rules
akhilp117 ecea100
Merge branch 'master' into akhilpindiprolu/eng-8873-add-temporary-rul…
akhilp117 775e8c2
ci(decision-model-lint): Warn against breaking changes in rule reports
akhilp117 9f58a31
Merge remote-tracking branch 'origin/akhilpindiprolu/eng-8873-add-tem…
akhilp117 2532c6c
ci(decision-model-lint): Give API rules the PR diff so they skip exis…
akhilp117 f99ad99
Test cases for the diff context (don't merge)
akhilp117 ff2f443
Run with the old config for comparison (don't merge)
akhilp117 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Temporary file for testing decision-model-lint rules. Not for merging. | ||
| from rest_framework.request import Request | ||
| from rest_framework.response import Response | ||
|
|
||
| from sentry.api.api_owners import ApiOwner | ||
| from sentry.api.api_publish_status import ApiPublishStatus | ||
| from sentry.api.base import cell_silo_endpoint | ||
| from sentry.api.bases.organization import OrganizationEndpoint | ||
| from sentry.api.serializers import serialize | ||
| from sentry.models.organization import Organization | ||
| from sentry.models.project import Project | ||
|
|
||
|
|
||
| @cell_silo_endpoint | ||
| class OrganizationDecisionLintProbeEndpoint(OrganizationEndpoint): | ||
| owner = ApiOwner.UNOWNED | ||
| publish_status = {"GET": ApiPublishStatus.PRIVATE} | ||
|
|
||
| def get(self, request: Request, organization: Organization) -> Response: | ||
| # E. New endpoint returning a growing list without pagination -> INTRODUCED (comment) | ||
| projects = Project.objects.filter(organization_id=organization.id) | ||
| return Response(serialize(list(projects), request.user)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
guiderequired breaks the documented guide_id-only PUT path; keeprequired=Falseand enforce the either-or rule invalidate().Evidence
guide = serializers.CharField(required=True), so DRF rejects payloads missingguidebeforevalidate()runs.AssistantEndpoint.putdocuments request shape as'guide_id': <guide_id> - OR - 'guide': guide key.AssistantSerializer.validate()still early-returns when onlyguide_idis present and errors only when neither is provided.{"guide_id": <valid_id>, "status": "viewed"}previously accepted, now returns 400guide: This field is required.Identified by Warden · sentry-backend-bugs · MN9-U8U