-
Notifications
You must be signed in to change notification settings - Fork 129
feat(SGE): API Rebase to 10.0.x #82
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
base: 10.0.x
Are you sure you want to change the base?
feat(SGE): API Rebase to 10.0.x #82
Conversation
A complete, tested rebase of the backend work completed on the new staff grant extension (SGE) feature. Co-authored-by: SahiruWithanage Co-authored-by: samindiii
|
@BrianDangDev could you please approve the test run workflows to kick off? |
rammakablecode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rebase is clearly documented by Steven,
The migration from the original 9.x implementation appears clean, and it’s good to see the functionality preserved while aligning with the current development architecture.
The PR clearly documents, sister branches, dependent PRs, and testing steps, which does make it easy to reproduce and verify the environment. Test coverage looks strong, with unit tests and RuboCop passing, and the manual API testing steps are clear and reproducible.
Regarding related PRs
-
StaffGrantExtensionApi is clearly documented, uses strong parameter validation, and enforces authentication and authorization up front. The transactional handling for bulk grants is particularly solid and aligns well with the stated atomicity guarantees.
-
Extracting shared logic into ExtensionService removes duplication from the student-initiated endpoint and provides a clean, testable abstraction for both staff and student flows.
-
Notification support is comprehensive:
In-system notifications via the Notification model and API.
Email notifications with clear separation between staff summaries and student notifications. -
The API tests cover success paths, authorization failures, validation errors, rollback behavior, and edge cases. Mailer tests are thorough and validate both content and headers.
The API root and permission updates in Unit and User are minimal and appropriate, and the addition of :grant_extensions is consistent with existing permission patterns.
No issues from a review perspective
|
@rammakablecode could I get you to change your review into an "approving review"?
|
rammakablecode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed above

Description
This pull request is a complete rebase of the Staff Grant Extension (SGE) API functionality introduced in #77. The initial feature was built on
9.x, and this PR migrates the feature to the new10.0.xdevelopment branch.All credit for development of the feature API goes to @samindiii and @SahiruWithanage.
Sister branches
Run OnTrack with the latest version of these branches to recreate the environment.
Sister Pull Requests
Repo cleanup
Merging this PR should be followed by closing the following open PRs with a comment that they have been merged into
10.0.x:Type of change
How Has This Been Tested?
Test A
While the development container is running, connect and run
rails testfrom the directory/workspace/doubtfire-api. This runs all unit tests. For the last successful GitHub Action run of this branch, see here.Test B
To strictly test the API, head to localhost's API docs while your Docker server is running.
Open "auth : Operations about auths" and go to "POST /api/auth". Enter the following JSON for the
postApiAuthvalue:{"username": "aconvenor", "password":"password"}Then click "Try it out!". From the response, grab the
auth_tokenvalue.Open "units : Operations about units" further down the page then go to "POST /api/units/{unit_id}/staff-grant-extension". Enter the following values for each parameter:
unit_id: 1Username: aconvenorAuth_token: (The one you received from POST /api/auth)postApiUnitsUnitIdStaffGrantExtension:{ "student_ids": [ 24 ], "task_definition_id": 1, "weeks_requested": 1, "comment": "string" }You should receive a "
successful" result in the Response Body.Checklist: