UNCLASSIFIED - NO CUI

Resolve "Enable pretty-printing output by default, create configuration option to disable pretty-printing"

General MR

Summary

Feature request from Ironbank:

When you print the values, it does it as a blob instead of pretty printing Can you pretty print?

By default, output is currently a giant blob. This is required for the parsers that power the Grafana dashboards as part of the Cron Job chart. This is a lesser user experience on the command line however. Traditionally, we've asked that users pipe that output to another tool like jq or yq for formatting, however this is less intuitive for new users and doesn't really enhance the user experience. Instead, we should enable pretty-printing by default and have it disabled in the helm chart where necessary.

Acceptance Criteria

  • Implement pretty-printing for YAML and JSON structured outputs
  • Create a configuration flag to enable pretty printing
  • Set the flag to True in new configuration files by default. If the flag is not set, False.
  • Update the Helm charts to explicitly disable pretty printing (big-bang/product/packages/bbctl#329 (closed))
  • Detect if the output is being piped into another program and if so, disable pretty printing

Additional Changes

  • Adjusted outputs and tests to accommodate big-bang-skip-auto-update and skip-update-check config changes
  • Added big-bang-skip-auto-update, skip-update-check, and pretty-print options to config wizard, with defaults
  • Refactored cmd/config/init.go to utilize helper object to reduce cylcomatic complexity lints that were failing

Relevant logs/screenshots

pretty-print=false, both JSON raw output and output piped into jq:

74-no-pp-jq-no-jq

pretty-print=true, JSON raw output only (no jq):

74-pp-no-jq

pretty-print=true, JSON output piped into jq:

74-pp-jq

Linked Issue

issue)

Upgrade Notices

(Include any relevant notes about upgrades here or write "N/A" if there are none)

Closes #74 (closed)

Edited by Darrien Lee

Merge request reports

Loading