Merged
Conversation
- Introduced an `--overwrite` flag in CLI commands to allow users to replace existing Excel files during export. - Enhanced logging to inform users when existing files are being overwritten. - Updated the `write_excel` function to handle overwriting of existing files and log actions accordingly. - Modified tests to cover scenarios for overwriting existing files and logging behavior. - Updated dependencies to include `click` version 8.1.8 for improved CLI functionality.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This pull request adds robust handling for existing Excel files in the
attackToExcelmodule, ensuring that exports do not accidentally overwrite user data unless explicitly allowed. It introduces anoverwriteparameter to relevant functions and commands, updates documentation to reflect this new behavior, and improves logging for file operations. Additionally, the README and documentation are updated for clarity and visibility.Excel export safety and overwrite controls:
Added an
overwriteparameter towrite_excel,export, andexport_releasefunctions, and updated all internal logic to refuse overwriting existing Excel files unlessoverwrite=Trueis specified. This includes checks and error messages when files already exist, and logging when files are replaced. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]Improved logging for file operations, including detailed messages when overwriting is about to occur and summaries of written files. [1] [2]
Documentation and user guidance:
mitreattack/attackToExcel/README.mdto document the new overwrite behavior and the--overwriteflag for CLI commands, as well as the new--verboseflag for debug logs.overwriteparameter for relevant methods.General improvements:
README.mdfor PyPI version, Python version, license, docs, and CI status..readthedocs.yamlto clarify the HTML build step.attackToExcel.pyto support new functionality.These changes make the Excel export process safer, more user-friendly, and better documented.