HTTP: return relative path for downloaded file#1951
Open
lvoloshyn-sekoia wants to merge 1 commit intodevelopfrom
Open
HTTP: return relative path for downloaded file#1951lvoloshyn-sekoia wants to merge 1 commit intodevelopfrom
lvoloshyn-sekoia wants to merge 1 commit intodevelopfrom
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR updates the HTTP module’s download action to return a path relative to the module’s data directory instead of an absolute path, and bumps the module version and changelog accordingly. Class diagram for updated HTTP download file actionclassDiagram
class DownloadFileAction {
+Path data_path
-dict _save_file(Response response)
}
Flow diagram for saving downloaded file and returning relative pathflowchart TD
A["HTTP response received"] --> B["Determine filename from Response"]
B --> C["Build absolute file_path = data_path / uuid / filename"]
C --> D["Create parent directory for file_path"]
D --> E["Write response content to file_path"]
E --> F["Compute result_path = file_path relative to data_path"]
F --> G["Return { file_path: str(result_path) }"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Double-check the use of
self.data_pathvsself._data_pathin this class/module to keep attribute access consistent and avoid potential attribute errors at runtime. - Since the return value for
file_pathis now relative, consider updating any in-code comments or variable names in this action that still imply an absolute path to reduce confusion for future maintainers.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Double-check the use of `self.data_path` vs `self._data_path` in this class/module to keep attribute access consistent and avoid potential attribute errors at runtime.
- Since the return value for `file_path` is now relative, consider updating any in-code comments or variable names in this action that still imply an absolute path to reduce confusion for future maintainers.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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 by Sourcery
Return a relative path for downloaded HTTP files and bump the module version.
Bug Fixes:
Documentation: