Ap 722 copy files#78
Conversation
davezuckerman
left a comment
There was a problem hiding this comment.
I'm know versed enough in python to comment on any stylistic issues. For copying files (maybe in a round 2) we might want to use something like rsync where the checksum validation is baked in.
anarchivist
left a comment
There was a problem hiding this comment.
generally looks good; a few minor refactoring things to cleanup, and otherwise a few questions. i think this is pretty close, so i'll give it a r+wc / deciding how we're going to address the questions.
| relative_path = item.relative_to(source_path) | ||
| manifest.append( | ||
| { | ||
| "path": str(relative_path), |
There was a problem hiding this comment.
is there a reason why you're preferring relative path here? my inclination would be to use the absolute path to ensure there's a lack of ambiguity, but happy to hear your thoughts otherwise.
There was a problem hiding this comment.
I was thinking the manifest is intended to describe the directory tree being transferred (not necessarily an absolute location). I'm not married to the idea, I can change it if you think it would be better...or I can add the source root separately:
{
"source_root": "/the/root/directory",
"files": [
{
"path": "test4.txt",
"size": 5,
"sha256": "..."
},
{
"path": "otherother/test.txt",
"size": 4,
"sha256": "..."
}
]
}
Think I should make one of those changes now or next iteration?
There was a problem hiding this comment.
i'd add the source root info somewhere now - i think it's useful context to have in the manifest if we're trying to diagnose issues.
There was a problem hiding this comment.
Done - added "source_root":
{
"source_root": "tmp/source",
"files": [
{
"path": "test4.txt",
"size": 5,
"sha256": "b9cca56a720f2beee61f2e744ab3d20a95772a4315d18c5eee251a465f078012"
}
]
}
awilfox
left a comment
There was a problem hiding this comment.
Found a few small things, but overall looking really nice.
Co-authored-by: Anna Wilcox <AWilcox@Wilcox-Tech.com>
163e1aa to
b37c180
Compare
No description provided.