Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the SDK’s artifact downloading flow to stop relying on download_url from the artifact schema and instead resolve a presigned URL via the new GET /v1/runs/{run_id}/artifacts/{artifact_id}/file endpoint.
Changes:
- Added
Run.get_artifact_download_url()and updated run artifact downloads to resolve URLs via the new endpoint. - Updated application download logic to accept an optional
(run_id, artifact_id) -> urlresolver callback. - Updated the Launchpad run describe page to resolve URLs on-demand for preview/download actions, and added/updated unit tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/aignostics/platform/resources/runs.py |
Adds URL resolution helper and switches artifact downloads to use artifact IDs + file endpoint. |
src/aignostics/application/_download.py |
Adds optional URL resolver callback and threads resolved URL into download_item_artifact. |
src/aignostics/application/_service.py |
Wires a resolver callback into the application run download loop. |
src/aignostics/application/_gui/_page_application_run_describe.py |
Updates GUI preview/download buttons to resolve presigned URLs via the run endpoint. |
tests/aignostics/platform/resources/runs_test.py |
Adds tests for URL resolution + updated artifact download behavior. |
tests/aignostics/application/download_test.py |
Adds tests for resolver callback behavior and explicit URL handling in downloads. |
34a2d49 to
97eb372
Compare
Codecov Report❌ Patch coverage is
|
cd90866 to
f621afe
Compare
f621afe to
7f71a87
Compare
7f71a87 to
ae504bc
Compare
|
Claude finished @nahua-aignx's task in 7m 45s —— View job PR Review CompleteReviewing PR #507: Stop using download_url from artifact schema SummaryThis PR migrates artifact downloads from using the deprecated 🔴 BLOCKING ISSUES (Must Fix)1. Incomplete Exception Handling in
|
| Check | Status | Notes |
|---|---|---|
| Test Markers | ✅ | All new tests have @pytest.mark.unit |
| Test Coverage | ✅ | Comprehensive unit test coverage |
| Linting | 🔄 | Running... |
| Breaking Changes | Gradual migration - download_url fallback preserves compatibility |
|
| Security | ✅ | Proper token handling, no secrets exposed |
| Documentation | ✅ | Clear docstrings and inline comments |
| Exception Handling | 🔴 | Critical issue - see #1 above |
| E2E Test Failures | 🔴 | Caused by exception handling bug - see #1 |
🔧 REQUIRED ACTIONS
- FIX BLOCKING ISSUE chore(deps): Bump actions/upload-artifact from 4.6.1 to 4.6.2 #1: Add comprehensive exception handling in
get_artifact_download_url() - VERIFY: Run E2E tests after fix:
uv run pytest tests/aignostics/application/gui_test.py::test_gui_run_download -v uv run pytest tests/aignostics/qupath/gui_test.py::test_gui_run_qupath_install_to_inspect -v
- IMPLEMENT: Add logging (Suggestion chore(deps): update actions/upload-artifact action to v4.6.2 #2)
- CONSIDER: Suggestions chore(deps): update python docker tag to v3.13 - autoclosed #3 and Dependency Dashboard #4
📚 REFERENCES
- CLAUDE.md: Architecture compliance ✅
- Testing Requirements: 85% coverage maintained, proper markers ✅
- Copilot Review: Identified same exception handling issue
- SonarQube: Quality gate passed (with 6 new issues - review separately)
Recommendation: REQUEST CHANGES - Critical exception handling bug must be fixed before merge. The E2E test failures are not flaky - they're caused by unhandled requests exceptions escaping from get_artifact_download_url().
Once the blocking issue is fixed, this will be a solid migration that properly decouples the SDK from the deprecated download_url field.
ae504bc to
710ad74
Compare
710ad74 to
8b7b9ed
Compare
8b7b9ed to
f5382bd
Compare
062b5df to
41ac5cb
Compare
41ac5cb to
896c418
Compare
896c418 to
318bff8
Compare
|
Response to codecov/patch issue: The 23 uncovered lines in the GUI file are the bodies of _preview_tiff, _preview_csv, and _download_artifact — the async inner functions on the per-artifact buttons. Testing them properly requires NiceGUI's async test harness, mocking nicegui_run.io_bound, and simulating button clicks in the artifact expansion panels. That's significant test scaffolding for three functions that all follow identical structure (set loading → resolve URL → open → clear loading → notify on error). The e2e tests already exercise the critical start_download() path. |
318bff8 to
b3d3e55
Compare
a0ffee1 to
d2320f2
Compare
|



Gist of the PR