feat(ssid): migrate to rails credentials, ssid multipart upload api#8328
Open
adi-herwana-nus wants to merge 2 commits intomasterfrom
Open
feat(ssid): migrate to rails credentials, ssid multipart upload api#8328adi-herwana-nus wants to merge 2 commits intomasterfrom
adi-herwana-nus wants to merge 2 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the SSID integration from ENV-based configuration to Rails credentials, and updates the plagiarism submission upload flow to use a presigned (multipart/form-data) upload API. It also upgrades rubyzip to v3 and adjusts zip-handling code accordingly.
Changes:
- Replace
SsidAsyncApiServicewithSsidApiService, sourcing SSID URL/API key/whitelist from Rails credentials. - Update SSID plagiarism upload flow to request a presigned upload URL + fields, then POST the zip via multipart form.
- Upgrade
rubyzipto~> 3.0and update zip creation/extraction code paths to match the newer API.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
app/services/ssid_api_service.rb |
Introduces SsidApiService, credentials-backed config, and multipart posting support. |
app/services/course/assessment/submission/ssid_plagiarism_service.rb |
Switches plagiarism upload to presigned upload flow + URL whitelist enforcement. |
app/services/course/ssid_folder_service.rb |
Updates folder creation to use SsidApiService. |
spec/services/course/assessment/submission/ssid_plagiarism_service_spec.rb |
Updates stubs/spec flow for presigned upload + multipart POST. |
spec/services/course/ssid_folder_service_spec.rb |
Updates stubbing from old SSID service class to new one. |
spec/support/stubs/ssid/api_stubs.rb |
Adds presigned upload URL and multipart upload response stubs. |
spec/rails_helper.rb |
Removes SSID ENV defaulting in test bootstrap. |
Gemfile / Gemfile.lock |
Pins rubyzip to ~> 3.0 and updates dependent gem versions. |
app/services/course/material/zip_download_service.rb |
Updates zip creation API to create: true (rubyzip v3). |
app/services/course/assessment/submission/base_zip_download_service.rb |
Updates zip creation API to create: true (rubyzip v3). |
app/services/course/assessment/submission/ssid_zip_download_service.rb |
Updates zip creation API to create: true (rubyzip v3). |
lib/autoload/course/assessment/programming_package.rb |
Changes package initialization to accept File and updates extraction/opening logic for rubyzip v3. |
spec/libraries/course/assessment/programming_package_spec.rb |
Updates tests to pass a File object rather than an IO stream. |
config/credentials/development.yml.enc |
Updates development credentials (encrypted). |
Comments suppressed due to low confidence (1)
app/services/ssid_api_service.rb:30
post_multipart(and similarlypost) will callparse_response, which currently attempts to JSON-parse the response body. For expected 202/204 responses where the body is empty/nil (including the Faraday test stubs in this PR), this will raise (JSON.parse(nil)=>TypeError). Suggest updating the response parsing to gracefully handle nil/empty bodies (e.g., returnnilwithout parsing, or rescueTypeError).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6a97e03 to
d20ebf5
Compare
d20ebf5 to
e544b96
Compare
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.
No description provided.