Skip to content
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

chore(issues): Publish PUT method of OrganizationGroupIndexEndpoint #88370

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

leeandher
Copy link
Member

@leeandher leeandher commented Mar 31, 2025

Relates to #88127, where most of the work was done.

Requires #88459 because of the allow_null on the substatus serializers.ChoicesField. For context see tfranzel/drf-spectacular#235 (comment)

Publishes the PUT method of the OrganizationGroupIndexEndpoint

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 31, 2025
Copy link

codecov bot commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #88370       +/-   ##
===========================================
+ Coverage   33.09%   87.82%   +54.73%     
===========================================
  Files        8465    10037     +1572     
  Lines      473001   568248    +95247     
  Branches    22301    22301               
===========================================
+ Hits       156517   499061   +342544     
+ Misses     316064    68767   -247297     
  Partials      420      420               

@leeandher leeandher force-pushed the leander/publish-put branch from 0d5d585 to a5b0fcd Compare April 1, 2025 14:42
@leeandher leeandher force-pushed the leander/publish-put branch from e876b96 to bda26a9 Compare April 1, 2025 17:05
@leeandher leeandher force-pushed the leander/publish-put branch from bda26a9 to ecf5416 Compare April 1, 2025 17:09
@leeandher leeandher force-pushed the leander/publish-put branch from ecf5416 to aa781aa Compare April 1, 2025 19:54
@leeandher leeandher changed the base branch from master to leander/upgrade-drf-spectacular April 1, 2025 19:56
leeandher added a commit that referenced this pull request Apr 2, 2025
Unblocks #88370

Uses the latest version from sentry's pypi.
Base automatically changed from leander/upgrade-drf-spectacular to master April 2, 2025 15:28
@leeandher leeandher force-pushed the leander/publish-put branch from aa781aa to 05eacfb Compare April 2, 2025 17:47
@leeandher leeandher marked this pull request as ready for review April 2, 2025 17:56
@leeandher leeandher requested a review from a team as a code owner April 2, 2025 17:56
@leeandher leeandher marked this pull request as draft April 2, 2025 18:03
@leeandher
Copy link
Member Author

CI is still broken, I'm going to double check that the fix actually works.

@leeandher leeandher force-pushed the leander/publish-put branch from 7cd4681 to bddde8f Compare April 2, 2025 22:00
@@ -40,7 +40,7 @@ build-js-po:

build-spectacular-docs:
@echo "--> Building drf-spectacular openapi spec (combines with deprecated docs)"
@OPENAPIGENERATE=1 sentry django spectacular --file tests/apidocs/openapi-spectacular.json --format openapi-json --validate --fail-on-warn
@OPENAPIGENERATE=1 sentry django spectacular --file tests/apidocs/openapi-spectacular.json --format openapi-json --validate
Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't feel great, but the warning about a duplicated enum is non addressable, since even adding it the ENUM_NAME_OVERRIDES key for DRF spectacular settings will then get removed because both choice lists hash to the same value, and then identifies them as a duplicate. This would be the only way to get around this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe this is discussed here, thought i may be misunderstanding tfranzel/drf-spectacular#790 (comment)

@@ -1531,7 +1531,7 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
"PARSER_WHITELIST": ["rest_framework.parsers.JSONParser"],
"POSTPROCESSING_HOOKS": [
"sentry.apidocs.hooks.custom_postprocessing_hook",
"drf_spectacular.hooks.postprocess_schema_enum_id_removal",
"drf_spectacular.hooks.postprocess_schema_enums",
Copy link
Member Author

Choose a reason for hiding this comment

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

This processing is necessary for the new endpoint to remove the null values from the enum being added, but also adds a lot more documentation to existing enum fields. The diff is too large to show all the changes though

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.

1 participant