Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SECENG-685] Add human-friendly outputs for policy commands #759

Merged

Conversation

sagar-connect
Copy link
Contributor

@sagar-connect sagar-connect commented Jul 26, 2022

Checklist

=========

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked for similar issues and haven't found anything relevant.
  • This is not a security issue (which should be reported here: https://circleci.com/security/)
  • I have read Contribution Guidelines.

Changes

=======

  • Additionally print user-friendly command outputs for create, update and delete policy subcommands to stderr.
  • Update test(s)

Rationale

=========
The current output format was focused towards scripting, but we also need human-friendly output for policy commands.

Considerations

==============

The human friendly output is logged to stderr, and machine parsable output (JSON) is output to the stdout right after.
This way we get both the info we need, without the need to having to choose between one, and also eliminating the need for special flags.

@codecov
Copy link

codecov bot commented Jul 26, 2022

Codecov Report

Merging #759 (70e64bc) into master (571ae88) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #759      +/-   ##
==========================================
+ Coverage   32.60%   32.63%   +0.02%     
==========================================
  Files          46       46              
  Lines        5410     5412       +2     
==========================================
+ Hits         1764     1766       +2     
  Misses       3390     3390              
  Partials      256      256              
Impacted Files Coverage Δ
cmd/policy/policy.go 81.73% <100.00%> (+0.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 571ae88...70e64bc. Read the comment docs.

@sagar-connect sagar-connect marked this pull request as ready for review July 26, 2022 18:00
@sagar-connect sagar-connect requested a review from a team as a code owner July 26, 2022 18:00
@sagar-connect sagar-connect merged commit 990c791 into master Jul 26, 2022
@sagar-connect sagar-connect deleted the SECENG-685-human-friendly-output-policy-commands branch July 26, 2022 18:33
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.

2 participants