Extract Pensive assignment platform integration logic from legacy repository - #572
Open
cycomachead wants to merge 1 commit into
Open
Extract Pensive assignment platform integration logic from legacy repository#572cycomachead wants to merge 1 commit into
cycomachead wants to merge 1 commit into
Conversation
Extract and implement Pensieve assignment platform integration logic from the legacy extensions repository, enabling course syncing, extension requests, and API communication via the Pensieve external-client API. https://www.superconductor.com/tickets/hDh9FH7DgNTw/implementations/RMTnmfHnNNTP#message_q6JBjRTHrcK8 Co-authored-by: Claude Code <noreply@anthropic.com>
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.
General Info
Changes
Extracts and implements Pensieve assignment platform integration, ported from the legacy
berkeley-cdss/extensionsrepo, following the existing Gradescope facade pattern end to end. Adds a new LMS row/facade, DB fields, and course settings UI so extensions can be posted to Pensieve.Lmsrow id 3 ("Pensieve") — newPENSIEVE_LMS_IDconstant, seed,Lms.PENSIEVE_LMS, andLms.facade_classmapping. Migration addsenable_pensieveandpensieve_course_urltocourse_settings.app/facades/pensieve_facade.rbwithget_all_assignments,provision_extension,from_user,assignment_url, backed bylib/lmss/pensieve/(JSONClientplusAssignment/Overridevalue objects), configured via newPENSIEVE_API_TOKENenv var.Request#approvenow handlesPensieveFacade(course URL + student email). Since Pensieve only accepts whole days past the original deadline, the facade converts the approved due date intonum_daysrelative to the synced assignment's due date, and refuses to post if the assignment can't be found or the request grants zero days.external_course_idand assignment URLs asexternal_assignment_id.docs/integrations.mdand.env.exampleentry forPENSIEVE_API_TOKEN.Known gaps / open questions for Pensieve
The old system (
src/pensieve.py) only supported a single API call (grant-extension) — there was no assignment sync; staff manually entered Pensieve URLs. To fully support sync, we need from Pensieve:PENSIEVE_API_TOKEN, Bearer auth) — the only credential currently used.get_all_assignmentsis wired to a proposed, unconfirmed endpoint (GET /api/b2s/v1/external-client/assignments, flagged inlib/lmss/pensieve/client.rb). Until Pensieve confirms a real endpoint/shape, sync is a safe no-op (returns[]; the sync job does not disable existing assignments on empty response).Other semantic limitations to be aware of: extensions are granted in whole days (time-of-day is lost), there's no late/hard due date support (parameter ignored), and extensions can't be read back or revoked via the API (
get_assignment_overridesreturns[];external_extension_idis only populated if Pensieve happens to return one).Testing
Added specs for
PensieveFacadeandLmss::Pensieve::Client, plus coverage inlms,course_settings, andrequestspecs (approval flow, link creation/update, URL validation). Full suite (749 specs) passes and RuboCop is clean.Documentation
Added a "Pensieve" section to
docs/integrations.mdcovering setup (API token + course URL) and known limitations (whole-day extensions, no separate late due date).Checklist
Superconductor Ticket Implementation | App Preview | Guided Review