ref(api): use token operationIds + summary for core + api endpoints#117337
Open
betegon wants to merge 8 commits into
Open
ref(api): use token operationIds + summary for core + api endpoints#117337betegon wants to merge 8 commits into
betegon wants to merge 8 commits into
Conversation
operationId->token migration, batch 1 of 3 (core + api endpoints, 83 ops). Move the human sentence into summary= and set operation_id to a short camelCase REST token for the @sentry/api SDK; docs title/slug stay identical (derived from summary). Ad-hoc overrides applied for path-driven awkwardness/consistency: - SCIM provision matches the CRUD scim names (provisionOrganizationScimV2User/Group) - symbol source detail ops singular (delete/updateProjectSymbolSource) - listOrganizationTraceItemAttributes (singular Item), listProjectDebugFiles
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 45cf4fc. Configure here.
shellmayr
reviewed
Jun 16, 2026
shellmayr
left a comment
Member
There was a problem hiding this comment.
Looks good overall - the bots are right about the non-unique ids though
The SCIM member PUT and PATCH both had operation_id="updateOrganizationScimV2User" (pre-existing: they shared the sentence operationId). PATCH is PUBLIC, PUT is EXPERIMENTAL, so the public api-docs build never caught it — but it's an invalid duplicate in the full schema. Give the experimental PUT a distinct id+summary (replaceOrganizationScimV2User / "Replace an Organization Member's Attributes"; PUT = SCIM full replace). Add tests/apidocs/test_operation_id_uniqueness.py: AST-scan every @extend_schema and assert operation_id and summary are each unique across src/sentry (duplicate summary = docs URL collision, since the reference slug derives from summary). Catches the recurrence regardless of publish status; pure file scan, no spec generation.
Used a context manager when reading source files; the bare open().read() leaked handles, which pytest surfaced as unraisable ResourceWarnings and flagged the test as flaky in CI.
The operationId uniqueness test was AST-based solely to scope the summary check away from OpenApiExample(summary=...). Split the two concerns: - operation_id uniqueness: a plain regex scan (operation_id= appears only as an @extend_schema kwarg). Handles both quote styles so apostrophes in un-migrated sentence-style values aren't truncated. - summary uniqueness: enforced in custom_postprocessing_hook, where each operation's real summary is directly available (no example nesting) and the check is correctly scoped to public/docs operations. Guards against docs-URL slug collisions; fails the api docs build.
- test_hooks.py: use module-level pytest functions for the summary checks (per tests/AGENTS.md 'use pytest, not unittest'); drop the dead setUp. - test_operation_id_uniqueness.py: scan via pathlib, matching the canonical source-scan precedent (tests/sentry/test_no_create_or_update_usage.py).
Match the surrounding test_hooks.py structure (EndpointServersTest, FixIssueRoutesTest) instead of bare module-level functions. Body keeps pytest.raises + plain asserts like its siblings.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Summary
operationId→token migration, batch 1 of 3 (core + api endpoints, 83 ops / 50 files). Moves the human sentence into
summaryand setsoperation_idto a short camelCase REST token so the generated@sentry/apiSDK gets clean names; docs titles/slugs stay byte-identical (derived fromsummary).Most are straight CRUD (
getOrganization,listProjectKeys,updateProject, …). Verb-corrected and ad-hoc overrides where the path couldn't express intent:addProjectTeam,addOrganizationMember,linkProjectRepository,registerProjectServiceHook,provisionOrganizationScimV2User/Groupget:getOrganizationProfilingFlamegraph,getOrganizationSessions,getOrganizationStatsSummary,getProjectEventSourceMapDebugdelete/updateProjectSymbolSource),listOrganizationTraceItemAttributes,listProjectDebugFilesTest plan
@extend_schemaresponse-type check).api docs testregenerates + validates the spec (--fail-on-warn); operations show token operationIds with the sentence preserved assummary.Related (operationId→token migration)
MailPluginandMailAdapterso that we can monitor the migration. #18322 (merged)