Add untar functionality and debugging configuration#10
Conversation
…requiring them to manually extract it first.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces functionality to handle .tar.gz archives directly by adding an UnTar function and includes a debugging configuration. The main purpose is to eliminate the need for manual archive extraction by automatically handling the untar/retar workflow within the tool.
Key changes:
- Added UnTar function to extract .tar.gz archives with automatic destination directory handling
- Modified the main command to extract archives before processing and re-package them after modification
- Added comprehensive test coverage for the new UnTar functionality
- Included VS Code debugging configuration for development
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/archive/archive.go | Implements UnTar function and updates ReTar to use -REMAPPED suffix |
| internal/archive/archive_test.go | Adds comprehensive test coverage for UnTar function and error cases |
| cmd/root.go | Integrates UnTar workflow and adds cleanup of extracted directories |
| README.md | Updates documentation to reflect .tar.gz support and explains output format |
| .vscode/launch.json | Adds debugging configuration for development |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@robandpdx should we put this under a flag ? The reason why we expect the untared migration archive is because in order to run the |
|
|
||
| err = commitremap.ProcessFiles(archivePath, types, commitMap) | ||
| // Extract the provided migration archive so we can modify its JSON contents | ||
| extractedDir, err := archive.UnTar(archiveFile, "") |
There was a problem hiding this comment.
@robandpdx we should check what the archive extension is and only archive if it is a .tar.gz
There was a problem hiding this comment.
@amenocal Sure! That could be a good way to trigger unarchive/archive functionality. So, if I give it a directory, it will behave as it does now. If I give it a .tar.gz file, it unarchives/acrhives. I'll make that change to my branch.
amenocal
left a comment
There was a problem hiding this comment.
🚀 thank you for the improvements to this CLI!
This pull request adds support for handling both
.tar.gzmigration archives and already-extracted directories, improving the flexibility and usability of the migration remapping tool. It introduces a newUnTarhelper, updates the command-line interface and documentation, and ensures that processed archives are output with a-REMAPPEDsuffix. The changes also include new tests for archive extraction.Introduce an untar function to allow users to provide a .tar.gz archive directly, eliminating the need for manual extraction. Additionally, add a launch configuration for debugging purposes.