Unified Backups: Decouple compression/decompression command execution
Summary
Current Backup implementations allows compression and decompression customization via Environmental variables. Part of the code is handled by ::Backup::Helper and the processing is done by other classes that rely on the compress_cmd and decompress_cmd to know which command to pipe into the shell
Improvements
For the Unified Backups we want to move away from using gzip as the compression method, and use p7zip with its own .7z format.
This will be handled by : #454832.
We need to first refactor the existing compression/decompression implementation to not use the compress_cmd and deocompress_cmd directly.
This is the last code shared by the ::Backup::Helper class. When the refactor is done, we should not have the ::Backup::Helper class anymore.
The new implementation should contain a generic compress/decompress logic relying on Shell::Command and Shell::Pipeline, while still allow the existing customization via ENV variables.
Risks
Change is covered by unit tests, no change in behavior is expected.
Involved components
- ::Backup::Helper
- ::Backup::Dump::Postgres
- ::Bakup::Targets::Files
Optional: Intended side effects
With the refactor and decoupling it will become much simpler to implement the new compression format in the Unified Backups, and allow more code to be extracted into the gem as they should accept both compression strategies (the one that will be refactored here and the new one in the unified backups)