Skip to content

Avoid emu data overwrite#48

Merged
deacon-mp merged 4 commits intomasterfrom
emu-overwrite
Oct 7, 2025
Merged

Avoid emu data overwrite#48
deacon-mp merged 4 commits intomasterfrom
emu-overwrite

Conversation

@uruwhy
Copy link
Copy Markdown
Contributor

@uruwhy uruwhy commented Sep 12, 2025

Description

Don't overwrite planners, fact sources, abilities, and adversary profiles that already exist

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Don't overwrite planners, fact sources, abilities, and adversary profiles that already exist
deacon-mp
deacon-mp previously approved these changes Oct 6, 2025
@deacon-mp deacon-mp requested a review from Copilot October 6, 2025 23:14
Copy link
Copy Markdown

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

Prevents EMU plugin from overwriting existing data by removing the pre-clean step and adding per-file existence checks before writing or copying.

  • Removed directory deletion in hook to avoid wiping existing EMU data
  • Added skip-on-exist logic for planners, adversaries, abilities, and sources with debug logs
  • Preserved payload decryption and data population flow

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
hook.py Removed rmtree of data subdirectories to stop wholesale deletion of existing EMU data before population.
app/emu_svc.py Added existence checks and skip logic for planner copy and YAML writers for adversaries, abilities, and sources, with debug logs.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Oct 7, 2025

@uruwhy uruwhy requested a review from deacon-mp October 7, 2025 16:23
@deacon-mp deacon-mp merged commit 22dfd61 into master Oct 7, 2025
5 checks passed
@deacon-mp deacon-mp deleted the emu-overwrite branch March 16, 2026 13:27
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.

3 participants