Repository navigation
Simplify class imports error handling and responses - #1127
Open
zetter-rpf wants to merge 6 commits into
Open
zetter-rpf wants to merge 6 commits into
zetter-rpf wants to merge 6 commits into
Conversation
Test coverage94.17% line coverage reported by SimpleCov. |
zetter-rpf
force-pushed
the
async-import-prep
branch
from
November 20, 2026 15:20
a1b4c22 to
3bbe46b
Compare
zetter-rpf
marked this pull request as ready for review
November 20, 2026 15:25
raspberrypiherokubot
temporarily deployed
to
editor-api-p-async-impo-g0rssu
November 20, 2026 15:25
Inactive
Contributor
|
@macroscope-app review |
|
Manual reviews triggered for commit All prior checks · these links stay valid even if you push more commits. |
|
Review started; results will be posted as check runs. |
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — Class imports stop returning student and membership results, including partial-failure details, while continuing to create rosters. Confirm that current consumers can detect and reconcile incomplete imports without this feedback before removing it. Needs human approval because:
You can add or adjust custom eligibility rules. Learn more. |
These were just describing the methods on the following line which were already have good names
In the frontend we are ONLY using the `school_class` property so there is no benefit in returning students and class members. We aren't showing student creation errors either as there are no expected errors to show (but we are reporting them to sentry elsewhere). I've remove some test cases that cover the response params and updated others to check items are created in the database As part of this I have also stubbed at a lower level - I think generally feature tests should test as much as possible and only stub external APIs.
There is no point in carrying about these errors as they are never used or displayed. They are reported to sentry further down the stack. See previous commit for more
Don't know what these errors are or what we should do in this case. We already have a top level handler for all errors in the API controller. I've also removed the argument error and changed it so it returns an array - this simplifies callers if they know it always returns the same type of thing. Things like this are better validated in the controller when data enters your system. I've added params validation into the controller to catch possible errors sooner The feature spec that was removed is a bit confusing - it was testing that if no students were found at all it would raise an error.
As far as I can see these are unnecessary as the previous steps always return arrays. I've used casting to ensure the school students param is always an array, and added an early return to the profile API client to save us a HTTP request.
zetter-rpf
force-pushed
the
async-import-prep
branch
from
November 23, 2026 10:48
3bbe46b to
a599b26
Compare
The class members create operation used for both single and batch operations which have different validation needs. For the single one, we expect an error to be raised if no-one was created, but we don't expect this in the batch operation and aren't handling it.
zetter-rpf
force-pushed
the
async-import-prep
branch
from
November 23, 2026 11:00
a599b26 to
5ee43c0
Compare
cocomarine
approved these changes
Nov 23, 2026
This branch was successfully deployed
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.
Status
What's changed?
This is a refactor/simplifying of class imports and the create member class it uses.
To solve https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/2022 I plan on making creating students for imported classes async. To make that easier this:
See commits for more