[Backend APIs] Implement Pending Reviews Dashboard Queue and Fast Aggregated Count APIs - #6674
Open
jcscottiii wants to merge 1 commit into
Open
Conversation
…regated Count APIs ## Summary Implements `GET /api/v0/summary-suggestions/pending-count` and `GET /api/v0/summary-suggestions/pending` for the release notes editorial dashboard review queue. Enforces site editor / reviewer permissions (`permissions.can_edit_any_feature`), cursor-based query pagination (`limit` default 25, max 100), and provides plain-text hover snippets for pending AI summary suggestions. ## Key Changes - **Controller (`api/summary_suggestion_api.py`)**: Adds `PendingSuggestionsCountAPI` for fast total count queries (`FeatureSummarySuggestion.query(status == PENDING).count()`) and `PendingSuggestionsQueueAPI` for cursor-paginated review queue retrieval. Performs batch `ndb.get_multi` lookups for parent `FeatureEntry` metadata and extracts plain-text hover snippets using `strip_markdown_hover_snippet`. - **Routes (`main.py`)**: Registers `/summary-suggestions/pending-count` and `/summary-suggestions/pending` before path-parameter routes. - **Testing (`api/summary_suggestion_api_test.py`)**: Added `PendingSuggestionsCountAPITest` and `PendingSuggestionsQueueAPITest` verifying authorized count retrieval, cursor pagination, invalid limit/cursor parameter handling (HTTP 400), and unauthorized access shielding (HTTP 403). TAG=agy CONV=86f63625-bdb5-4d50-ac8d-2f8ca5128ca9
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.
[Backend APIs] Implement Pending Reviews Dashboard Queue and Fast Aggregated Count APIs
Summary
Implements
GET /api/v0/summary-suggestions/pending-countandGET /api/v0/summary-suggestions/pendingfor the release notes editorial dashboard review queue.Enforces site editor / reviewer permissions (
permissions.can_edit_any_feature), cursor-based query pagination (limitdefault 25, max 100), and provides plain-text hover snippets for pending AI summary suggestions.Key Changes
api/summary_suggestion_api.py): AddsPendingSuggestionsCountAPIfor fast total count queries (FeatureSummarySuggestion.query(status == PENDING).count()) andPendingSuggestionsQueueAPIfor cursor-paginated review queue retrieval. Performs batchndb.get_multilookups for parentFeatureEntrymetadata and extracts plain-text hover snippets usingstrip_markdown_hover_snippet.main.py): Registers/summary-suggestions/pending-countand/summary-suggestions/pendingbefore path-parameter routes.api/summary_suggestion_api_test.py): AddedPendingSuggestionsCountAPITestandPendingSuggestionsQueueAPITestverifying authorized count retrieval, cursor pagination, invalid limit/cursor parameter handling (HTTP 400), and unauthorized access shielding (HTTP 403).TAG=agy
CONV=86f63625-bdb5-4d50-ac8d-2f8ca5128ca9