[Backend APIs] Implement Milestone Editorial Curation Workflow API (GET/PATCH /milestone-curation) - #6675
Open
jcscottiii wants to merge 1 commit into
Conversation
…ET/PATCH /milestone-curation) ## Summary Implements `GET /api/v0/milestone-curation/<int:milestone>` and `PATCH /api/v0/milestone-curation/<int:milestone>` tracking editorial milestone status (`PENDING`, `IN_REVIEW`, `COMPLETED`) and curator assignments. Enforces Datastore entity key alignment (`id=str(milestone)`), site editor permissions (`permissions.can_edit_any_feature`), status enum validation, and timezone-aware UTC timestamps. ## Key Changes - **Controller (`api/milestone_curation_api.py`)**: Implements `MilestoneCurationAPI` handling `do_get` (retrieving or defaulting `MilestoneCuration` entities using string milestone keys `id=str(milestone)`) and `do_patch` (updating `status`, `curator_emails`, and timezone-aware `updated` timestamps). - **Routes (`main.py`)**: Registers `/milestone-curation/<int:milestone>` route. - **Testing (`api/milestone_curation_api_test.py`)**: Added `MilestoneCurationAPITest` unit test suite covering default state creation, stored state retrieval, non-positive milestone validation (HTTP 400), unauthorized access shielding (HTTP 403), invalid status/curator_emails payloads (HTTP 400), and entity persistence. 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 Milestone Editorial Curation Workflow API (GET/PATCH /milestone-curation)
Summary
Implements
GET /api/v0/milestone-curation/<int:milestone>andPATCH /api/v0/milestone-curation/<int:milestone>tracking editorial milestone status (PENDING,IN_REVIEW,COMPLETED) and curator assignments.Enforces Datastore entity key alignment (
id=str(milestone)), site editor permissions (permissions.can_edit_any_feature), status enum validation, and timezone-aware UTC timestamps.Key Changes
api/milestone_curation_api.py): ImplementsMilestoneCurationAPIhandlingdo_get(retrieving or defaultingMilestoneCurationentities using string milestone keysid=str(milestone)) anddo_patch(updatingstatus,curator_emails, and timezone-awareupdatedtimestamps).main.py): Registers/milestone-curation/<int:milestone>route.api/milestone_curation_api_test.py): AddedMilestoneCurationAPITestunit test suite covering default state creation, stored state retrieval, non-positive milestone validation (HTTP 400), unauthorized access shielding (HTTP 403), invalid status/curator_emails payloads (HTTP 400), and entity persistence.TAG=agy
CONV=86f63625-bdb5-4d50-ac8d-2f8ca5128ca9