Open lanej opened 5 years ago
Yeah, it's not great and I've solved it in the past with VCR configuration like:
# 155 char limit on path, 100 char limit on name (https://github.com/rubygems/rubygems/blob/v3.0.3/lib/rubygems/package/tar_writer.rb#L311-L336)
cassette_name = "#{pathname[0..154]}/#{name[0..83]}-#{digest}"
The drawback of using a digest -> filename mapping in blockbuster is you lose the ability to manually untar the cassette file and inspect the individual cassettes. That might be better than the alternatives though.
Ye ole POSIX vs GNU.
The reduction in traceability and discoverability is something I'd like to solve with this. Also, if there are lengthy cassettes then moving cassettes or copying cassettes to duplicate recordings can save significant time. Once you've manipulated the filename you need application knowledge to do it well. It goes from being a shell script to a ruby script with some copied configuration.
@leklund Alternatively, we could let the user choose the compression format. Zipfiles would allow for 2^16 filename lengths but you'd loose a few percentage points on archive size.
POSIX
tar
does not allow file names longer 100 characters. GNUtar
does allow for longer than 100 character filenames. ruby'szlib
implementation matches the POSIX standard.Many
VCR
cassette names use a combination of file name and test/example name which often greatly exceed 100 characters. This forces downstream developers to obfuscate filenames which make them harder to use. They also need to understand thatblockbuster
is using a specific method of compression which leaks implementation details downstream.The easiest solution to this would be to write some sort of mapping for individual files from there hashsum to their real filename. This gets slightly more complicated when you consider deltas may re-write that mapping.