-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(api): Accept project slugs in organization filters #117446
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8c8a0ec
feat(api): Accept project slugs in organization filters
gricha 91ad37c
fix(api): Restore numeric project request helper
gricha 0ec2483
fix(api): Treat empty project ID overrides as absent
gricha d7ab61b
fix(api): Preserve slug filters for project callers
gricha 70c0278
docs(api): Remove legacy projectSlug parameter docs
gricha c10246b
docs(api): Hide project slug query docs
gricha 0ffcf7e
fix(api): Preserve mixed project slug filters
gricha ee0a3a9
docs(api): Document project query slugs
gricha 4842eb6
fix(api): Preserve grouped all-project stats scope
gricha 5082eb2
docs(api): Preserve project slug query schema
gricha 3b6f687
ref(api): Share project query normalization
gricha 2f18fba
docs(api): Preserve legacy project slug schema
gricha 6f2e2f8
ref(api): Split blank project query cleanup
gricha a9dcf02
docs(api): Type project filters as ID or slug
gricha 5f71b9f
fix(api): Preserve all-project notification actions
gricha 6bfe5cd
fix(api): Use array schema for project filters
gricha 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
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 |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| from drf_spectacular.utils import OpenApiParameter | ||
|
|
||
| from sentry import constants | ||
| from sentry.api.helpers.projects import PROJECT_ID_OR_SLUG_SCHEMA | ||
| from sentry.snuba.dataset import Dataset | ||
| from sentry.snuba.sessions import STATS_PERIODS | ||
|
|
||
|
|
@@ -44,7 +45,7 @@ class GlobalParams: | |
| ) | ||
| PROJECT_ID_OR_SLUG = OpenApiParameter( | ||
| name="project_id_or_slug", | ||
| description="The ID or slug of the project the resource belongs to.", | ||
| description="The ID or slug of the project the resource belongs to. Project slugs are unique within each organization.", | ||
| required=True, | ||
| type=str, | ||
| location="path", | ||
|
|
@@ -143,7 +144,18 @@ class OrganizationParams: | |
| required=False, | ||
| many=True, | ||
| type=str, | ||
| description="""The project slugs to filter by. Use `$all` to include all available projects. For example, the following are valid parameters: | ||
| description="""The legacy project slug filter. Prefer `project`, which accepts project IDs or slugs. Use `$all` to include all available projects. For example, the following are valid parameters: | ||
| - `/?projectSlug=$all` | ||
| - `/?projectSlug=android&projectSlug=javascript-react` | ||
| """, | ||
| ) | ||
| PROJECT_SLUG = OpenApiParameter( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we're intending to drop this it we can probably just remove this from the docs |
||
| name="projectSlug", | ||
| location="query", | ||
| required=False, | ||
| many=True, | ||
| type=str, | ||
| description="""The project slugs to filter by. This legacy parameter takes precedence over `project` if both are provided. Prefer `project`, which accepts project IDs or slugs. Use `$all` to include all available projects. For example, the following are valid parameters: | ||
| - `/?projectSlug=$all` | ||
| - `/?projectSlug=android&projectSlug=javascript-react` | ||
| """, | ||
|
|
@@ -153,10 +165,11 @@ class OrganizationParams: | |
| location="query", | ||
| required=False, | ||
| many=True, | ||
| type=int, | ||
| description="""The IDs of projects to filter by. `-1` means all available projects. | ||
| type=PROJECT_ID_OR_SLUG_SCHEMA, | ||
| description="""The IDs or slugs of projects to filter by. Project slugs are unique within each organization. Omit this parameter to include all accessible projects. `-1` is also accepted to include all accessible projects. | ||
| For example, the following are valid parameters: | ||
| - `/?project=1234&project=56789` | ||
| - `/?project=android&project=javascript-react` | ||
| - `/?project=-1` | ||
| """, | ||
| ) | ||
|
|
||
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.
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.
Uh oh!
There was an error while loading. Please reload this page.