defenseunicorns / uds-cli

Apache License 2.0
24 stars 11 forks source link

Remove extra output from `uds run` #916

Closed UncleGedd closed 1 week ago

UncleGedd commented 2 weeks ago

Describe what should be investigated or refactored

When running Maru tasks via uds run, remove the "Saving log file" notes

Screenshot 2024-09-09 at 1 58 38 PM

catsby commented 2 weeks ago

Unless I'm mistaken, maru-runner doesn't seem to allow silencing this NOTE: without completely disabling the logs entirely.

We can remove this NOTE: here by completely turning off logging for Zarf and Maru-runner in src/cmd/vendored.go:

diff --git a/src/cmd/vendored.go b/src/cmd/vendored.go
index 47cf4d5..eda265a 100644
--- a/src/cmd/vendored.go
+++ b/src/cmd/vendored.go
@@ -26,6 +26,11 @@ var runnerCmd = &cobra.Command{
    Use:     "run",
    Aliases: []string{"r"},
    Short:   lang.CmdRunShort,
+   PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
+       // disable Zarf log file
+       config.SkipLogFile = true
+       return nil
+   },
    RunE: func(_ *cobra.Command, _ []string) error {
        os.Args = os.Args[1:] // grab 'run' and onward from the CLI args

@@ -57,6 +62,9 @@ var runnerCmd = &cobra.Command{
        }

        runnerCLI.RootCmd().SetArgs(os.Args)
+       // disable maru-runner log file
+       runnerCLI.RootCmd().PersistentFlags().Set("no-log-file", "true")
+
        runnerCLI.Execute()

        return nil

but that turns off logging for them both entirely, as opposed to just silencing the message. Is that what we want?

UncleGedd commented 2 weeks ago

https://github.com/defenseunicorns/uds-cli/pull/919 removes the extra Zarf output, still need to address the Maru output

catsby commented 1 week ago

PR for this is here https://github.com/defenseunicorns/uds-cli/pull/925 but it depends on a Maru PR