Skip to content

Conversation

@Ana06
Copy link
Member

@Ana06 Ana06 commented Apr 24, 2025

Try to install failed packages after completing all packages installation. This way packages have more chances to get installed,
facilitating automated FLARE-VM installations (without manual interaction).

Introduces the functions Get-Failed-Packages and Install-Packages to avoid duplicating code.

In addition, this PR also fixes a bug introduced in PR #1274 where we started to always create failed_packages.txt to signal installation completion for automation. It also inadvertently caused the installer to always log additional failure information, regardless of actual package failures, because of checking for the existence of the (now always present) file. The detailed failure messages are now only displayed when one or more packages have failed to install.

Closes #1219.

@mandiant/vms I would appreciate a review if anyone has time, as any error in the installer breaks Commando-VM and FLARE-VM. I have tested locally, but an extra pair of 👀 would be good.

PR mandiant#1274 introduced the consistent creation of `failed_packages.txt` to
signal installation completion for automation. However, it also
inadvertently caused the installer to always log additional failure
information, regardless of actual package failures, because of checking
for the existence of the (now always present) file.

This commit addresses this by checking the actual count of failed
packages (`$failures.Count`). The detailed failure messages are now only
displayed when one or more packages have failed to install.
@Ana06 Ana06 added 💎 enhancement It is working, but it could be better 🌀 FLARE-VM A package or feature to be used by FLARE-VM labels Apr 24, 2025
@Ana06 Ana06 requested review from a team and d35ha April 24, 2025 15:53
@Ana06 Ana06 self-assigned this Apr 24, 2025
Try to install failed packages after completing all packages
installation. This way packages have more chances to get installed,
facilitating automated FLARE-VM installations (without manual
interaction).

Introduces the functions `Get-Failed-Packages` and `Install-Packages` to
avoid duplicating code.
Copy link
Member

@d35ha d35ha left a comment

Choose a reason for hiding this comment

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

I tested it successfully, LGTM.

@Ana06
Copy link
Member Author

Ana06 commented Apr 30, 2025

Thanks for the review @d35ha! 💐

@Ana06 Ana06 merged commit 94b088d into mandiant:main Apr 30, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌀 FLARE-VM A package or feature to be used by FLARE-VM 💎 enhancement It is working, but it could be better

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-try package installation on failure

2 participants