Conversation
…ements to the logging, some new cache key support, and some tests that ostensibly check that they work, but it's not obvious they do.
…and the bucket issue is fixed. This should close #21
|
Hmm. Despite being a branch off main, this seems to be mixing pull requests. Don't rush to look at it til I understand what has gone on. |
There was a problem hiding this comment.
Pull request overview
This pull request fixes a caching issue in S3 repository navigation (Issue #21) by adding path information to the OutputHandler cache signature. Previously, cache hits occurred when navigating between different paths with the same command and arguments, causing stale data to be displayed. The PR also adds piping functionality between commands, improves error handling, makes docker import optional for tests, and fixes several typos and error messages.
Changes:
- Modified OutputHandler to include path (bucket, path) in cache signatures, ensuring cache isolation across different S3 locations
- Added internal piping support using
::syntax between producer commands (ls, drsview) and consumer commands (ls, p5dump) - Made docker import optional in test configuration to allow tests to run without Docker installed
- Fixed multiple typos and error messages throughout the codebase
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cfs3/s3cmd.py | Core changes: added path-aware caching to OutputHandler, implemented piping infrastructure, added clearcache and version commands, improved error handling, fixed typos and error messages, added null safety checks |
| tests/test_piping.py | New comprehensive test suite for internal piping functionality between commands |
| tests/test_outputhandler.py | New test suite verifying that cache respects path, method name, arguments, and bucket separately |
| tests/conftest.py | Made docker import optional and added graceful skipping when Docker is unavailable |
Comments suppressed due to low confidence (1)
cfs3/s3cmd.py:1058
- Missing call to
self.output_handler.end_method_and_cache()at the end of the 'drs' output branch. This function is called in the 'list' output branch (line 1043) but not in the 'drs' branch. Without this call, the output for the default 'drs' view won't be cached, which partially defeats the purpose of the caching fix introduced in this PR.
if arg.use_metadata:
mymetadata = self._getmetadata(myfiles)
output = drs_metaview(mymetadata, selects=selects, collapse=arg.collapse_list)
else:
myfiles = [f['n'] for f in myfiles]
output = drs_view(myfiles, arg.drs, selects=selects, collapse=arg.collapse_list)
for line in output:
self.houtput(line)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…being case insenstive.
This pull request addresses a caching issue which means that caching didn't work as you navigate around S3 repositories (see issue #21). It also addresses the other minor sub-issues listed there.
By mistake, it also picks up some earlier work that was supposed to be in the piping branch alone, but it's too hard to unpick so we're leaving it here. The draft pull request for that said: "The idea here is that we want to be able to go from a drsview to specific files (this was possible before, but this is an exercise in building up the piping infrastructure as well as adding a different route to functionality)."