Skip to content

docs(api): Update get team projects api to use drf/openapi #50676

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 5 commits into from
Jun 10, 2023

Conversation

schew2381
Copy link
Contributor

@schew2381 schew2381 commented Jun 9, 2023

Update GET team projects to use drf-spectacular. All that's changed is the example 200 response and permission scopes. The new response can be seen in this github gist

Before:
Screenshot 2023-06-09 at 1 57 52 PM

After:
Screenshot 2023-06-09 at 2 00 02 PM

@schew2381 schew2381 self-assigned this Jun 9, 2023
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 9, 2023
@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Merging #50676 (2caa047) into master (1ed1204) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #50676   +/-   ##
=======================================
  Coverage   81.17%   81.17%           
=======================================
  Files        4860     4861    +1     
  Lines      204027   204037   +10     
  Branches    11159    11159           
=======================================
+ Hits       165618   165629   +11     
+ Misses      38163    38162    -1     
  Partials      246      246           
Impacted Files Coverage Δ
.../apidocs/examples/discover_performance_examples.py 100.00% <ø> (ø)
...rc/sentry/apidocs/examples/issue_alert_examples.py 100.00% <ø> (ø)
...c/sentry/apidocs/examples/organization_examples.py 100.00% <ø> (ø)
src/sentry/apidocs/examples/project_examples.py 100.00% <ø> (ø)
src/sentry/apidocs/examples/scim_examples.py 100.00% <ø> (ø)
src/sentry/api/endpoints/team_projects.py 96.96% <100.00%> (+0.30%) ⬆️
src/sentry/api/serializers/models/project.py 97.54% <100.00%> (+<0.01%) ⬆️
src/sentry/apidocs/examples/team_examples.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@schew2381 schew2381 force-pushed the seiji/fix/update-get-team-projects-api branch from 356a349 to 060f76f Compare June 9, 2023 21:47
Comment on lines -96 to -98
"/api/0/teams/{organization_slug}/{team_slug}/projects/": {
"$ref": "paths/teams/projects.json"
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Delete path so both POST and GET can use drf-spectacular

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tested the GET but can be safely deleted b/c type checking is done through drf-spectacular

@schew2381 schew2381 requested a review from JoshFerge June 9, 2023 23:15
@schew2381 schew2381 marked this pull request as ready for review June 9, 2023 23:15
@schew2381 schew2381 requested a review from a team as a code owner June 9, 2023 23:15
@@ -231,6 +231,7 @@ class ProjectSerializerBaseResponse(_ProjectSerializerOptionalBaseResponse):
firstTransactionEvent: bool
access: List[str]
hasAccess: bool
hasMinifiedStackTrace: bool
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Project model typed dict was missing this field

@@ -37,11 +37,14 @@ class OrganizationExamples:
"hasSessions": True,
"hasProfiles": True,
"hasReplays": True,
"hasMinifiedStackTrace": False,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This had to be added to this OpenApiExample to comply with adding the field to the Project Model typed dict

@schew2381 schew2381 merged commit e393332 into master Jun 10, 2023
@schew2381 schew2381 deleted the seiji/fix/update-get-team-projects-api branch June 10, 2023 01:30
@schew2381 schew2381 requested a review from sentaur-athena June 20, 2023 19:17
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants