feat: add custom results methods to Project#186
Closed
tchordia wants to merge 3 commits into
Closed
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <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.

Summary
(to be filled in)
Claude Notes
Adds four
Projectclassmethods to manage a project's custom HTML results file via the newapi_externalcustom-results endpoints (backend PR: surge-ai/gondor#36742). Uses a presigned-URL upload (no multipart).Project.upload_custom_results(project_id, file)— POSTs for a presigned PUT URL, then PUTs the file (path or file-like) to S3 withContent-Type: text/html. Re-upload overwrites (fixed key).Project.get_custom_results_url(project_id)— returns a presigned download URL.Project.download_custom_results(project_id)— downloads and returns the HTML content.Project.delete_custom_results(project_id)— deletes the file.The two read methods are intentionally separate (URL vs. content). All read methods sit on the single
GETendpoint, which 404s when absent (raisingSurgeRequestError).Test plan
pytest tests/test_projects.py— 5 new tests + all pre-existing pass (15 total)Content-Type: text/html), get-url, download (utf-8 decode), deletesurge/projects.pyis clean)