Skip to content

feat(ssid): migrate to rails credentials, ssid multipart upload api#8328

Open
adi-herwana-nus wants to merge 2 commits intomasterfrom
adi/ssid-multipart-upload
Open

feat(ssid): migrate to rails credentials, ssid multipart upload api#8328
adi-herwana-nus wants to merge 2 commits intomasterfrom
adi/ssid-multipart-upload

Conversation

@adi-herwana-nus
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SsidAsyncApiService with SsidApiService, 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 rubyzip to ~> 3.0 and 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 similarly post) will call parse_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., return nil without parsing, or rescue TypeError).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/autoload/course/assessment/programming_package.rb
Comment thread lib/autoload/course/assessment/programming_package.rb
Comment thread spec/libraries/course/assessment/programming_package_spec.rb
@adi-herwana-nus adi-herwana-nus force-pushed the adi/ssid-multipart-upload branch from 6a97e03 to d20ebf5 Compare April 24, 2026 10:48
@adi-herwana-nus adi-herwana-nus force-pushed the adi/ssid-multipart-upload branch from d20ebf5 to e544b96 Compare April 24, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants