serokell / deploy-rs

A simple multi-profile Nix-flake deploy tool.
Other
1.42k stars 101 forks source link

output when deploying to multiple targets is unclear #273

Closed stuebinm closed 5 months ago

stuebinm commented 6 months ago

When deploying to multiple hosts in one invocation using --targets, the log output of deploy-rs is unnecessarily unclear on which host an operation affects. This is especially confusing in case one of the deployments fails, but the others succeed, as there's no obvious indication which deploy failed, only that one of them did.

As an example, consider:

āÆ deploy --targets .#chaski .#flora --dry-activate -s
šŸš€ ā„¹ļø [deploy] [INFO] Evaluating flake in .
šŸš€ ā„¹ļø [deploy] [INFO] Evaluating flake in .
šŸš€ ā„¹ļø [deploy] [INFO] The following profiles are going to be deployed:
[chaski.system]
user = "root"
ssh_user = "root"
path = "/nix/store/6kj8i7d0yglnlkzpmxdn9ydz1l9l3hln-activatable-nixos-system-chaski-23.11.20240406.e38d7cb"
hostname = "chaski"
ssh_opts = []
[flora.system]
user = "root"
ssh_user = "root"
path = "/nix/store/j9wk9wy0v0xq2c0dgxh0diqvgna0wc3f-activatable-nixos-system-flora-23.11.20240406.e38d7cb"
hostname = "flora"
ssh_opts = []

šŸš€ ā„¹ļø [deploy] [INFO] Building profile `system` for node `chaski`
šŸš€ ā„¹ļø [deploy] [INFO] Building profile `system` for node `flora`
šŸš€ ā„¹ļø [deploy] [INFO] Copying profile `system` to node `chaski`
šŸš€ ā„¹ļø [deploy] [INFO] Copying profile `system` to node `flora`
šŸš€ āŒ [deploy] [ERROR] Failed to push profile: Nix copy command resulted in a bad exit code: Some(1)

It'd be much nicer if the log messages would simply include the hostname again, so the last line would start with šŸš€ āŒ [deploy to flora] [ERROR] or something similar.

PhilTaken commented 6 months ago

Great suggestion, has been irking me as well!