Enhanced intermediate result upload response#162
Conversation
…UploadResponse` Since a file that is encrypted by node A is only decryptable with its own public key, the query parameter `remote_node_id` of the URL with that the encrypted file can be retrieved is directly set to the encrypting nodes ID.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughIntroduces a cached Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant FastAPI_Endpoint
participant get_node_id
participant CoreClient
participant URL_Generator
Client->>FastAPI_Endpoint: POST upload request
FastAPI_Endpoint->>get_node_id: Resolve dependency
get_node_id->>CoreClient: find_nodes(filter={client_id: configured_id})
CoreClient-->>get_node_id: nodes list
get_node_id-->>FastAPI_Endpoint: node.id (or raise HTTPException)
FastAPI_Endpoint->>URL_Generator: Build retrieval URL
URL_Generator->>URL_Generator: include_query_params(remote_node_id=node.id)
URL_Generator-->>FastAPI_Endpoint: retrieval URL with remote_node_id
FastAPI_Endpoint-->>Client: Response containing URL
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
project/dependencies.py (1)
223-223: Replace raw string withAuthFlow.clientenum for consistency.Line 223 uses a raw string comparison while the rest of the module compares against the
AuthFlowenum (e.g.,AuthFlow.passwordandAuthFlow.clientelsewhere). Align this check with the existing pattern.Suggested fix
- if settings.hub.auth.flow != "client": + if settings.hub.auth.flow != AuthFlow.client:🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@project/dependencies.py` at line 223, The code uses a raw string comparison at settings.hub.auth.flow != "client"; change it to use the AuthFlow enum for consistency by comparing settings.hub.auth.flow != AuthFlow.client, ensuring AuthFlow is imported or referenced the same way as other checks (see existing comparisons to AuthFlow.password and AuthFlow.client) so the module consistently uses the enum values.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@project/dependencies.py`:
- Around line 218-222: Remove the `@lru_cache` decorator from get_node_id because
it depends on per-request objects from get_core_client (so cache keys never
hit); update the function to accept settings and core_client as before but
without caching. Also replace the string literal "client" used in the auth flow
check with the AuthFlow.client enum value to ensure type-safety (refer to
AuthFlow and the get_node_id function and the get_core_client dependency to
locate the change).
---
Nitpick comments:
In `@project/dependencies.py`:
- Line 223: The code uses a raw string comparison at settings.hub.auth.flow !=
"client"; change it to use the AuthFlow enum for consistency by comparing
settings.hub.auth.flow != AuthFlow.client, ensuring AuthFlow is imported or
referenced the same way as other checks (see existing comparisons to
AuthFlow.password and AuthFlow.client) so the module consistently uses the enum
values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f4432cfc-54af-46be-a9d3-8d30be7fc7fd
📒 Files selected for processing (7)
project/dependencies.pyproject/routers/intermediate.pyproject/routers/local.pytests/conftest.pytests/test_intermediate.pytests/test_local.pytests/test_local_tagged.py
Summary by CodeRabbit
New Features
Tests