Skip to content

Conversation

@robandpdx
Copy link
Contributor

@robandpdx robandpdx commented Sep 10, 2025

This pull request adds support for handling both .tar.gz migration archives and already-extracted directories, improving the flexibility and usability of the migration remapping tool. It introduces a new UnTar helper, updates the command-line interface and documentation, and ensures that processed archives are output with a -REMAPPED suffix. 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@amenocal
Copy link
Contributor

@robandpdx should we put this under a flag ? The reason why we expect the untared migration archive is because in order to run the git filter-repo you need to open the migration archive, therefore there would be no need to tar it back again so that this extension process it. Thoughts ?

cmd/root.go Outdated

err = commitremap.ProcessFiles(archivePath, types, commitMap)
// Extract the provided migration archive so we can modify its JSON contents
extractedDir, err := archive.UnTar(archiveFile, "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robandpdx we should check what the archive extension is and only archive if it is a .tar.gz

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@robandpdx robandpdx requested a review from amenocal September 23, 2025 14:02
Copy link
Contributor

@amenocal amenocal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 thank you for the improvements to this CLI!

@robandpdx robandpdx merged commit a7c19b0 into mona-actions:main Sep 23, 2025
1 check passed
@robandpdx robandpdx deleted the untar branch September 23, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants