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

Added examples for policy commands #769

Merged
merged 2 commits into from
Aug 22, 2022
Merged

Conversation

sagar-connect
Copy link
Contributor

@sagar-connect sagar-connect commented Aug 19, 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

=======

  • Added examples for policy commands

@sagar-connect sagar-connect changed the title added examples for policy commands Added examples for policy commands Aug 19, 2022
@codecov
Copy link

codecov bot commented Aug 19, 2022

Codecov Report

Merging #769 (38764d3) into master (ec7d8d3) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #769   +/-   ##
=======================================
  Coverage   32.77%   32.77%           
=======================================
  Files          46       46           
  Lines        5415     5415           
=======================================
  Hits         1775     1775           
  Misses       3387     3387           
  Partials      253      253           
Impacted Files Coverage Δ
cmd/policy/policy.go 78.75% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sagar-connect sagar-connect marked this pull request as ready for review August 19, 2022 20:35
@sagar-connect sagar-connect requested a review from a team as a code owner August 19, 2022 20:35
@@ -83,7 +83,7 @@ func NewCommand(config *settings.Config, preRunE validator.Validator) *cobra.Com
return nil
},
Args: cobra.ExactArgs(1),
Example: `policy push ./policy_bundle_dir_path --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f --context config`,
Example: `policy push ./config --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f`,
Copy link
Contributor

Choose a reason for hiding this comment

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

The folder to be pushed being called config is confusing.

Policy push ./policies seems better.

There's the confusion between the context config and the folder config...

@@ -117,7 +117,8 @@ func NewCommand(config *settings.Config, preRunE validator.Validator) *cobra.Com

return prettyJSONEncoder(cmd.OutOrStdout()).Encode(diff)
},
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
Example: `policy diff ./config --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

@@ -356,7 +358,8 @@ func NewCommand(config *settings.Config, preRunE validator.Validator) *cobra.Com

return nil
},
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
Example: `policy eval ./config --input ./.circleci/config.yml`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

@@ -264,13 +265,13 @@ func NewCommand(config *settings.Config, preRunE validator.Validator) *cobra.Com

cmd := &cobra.Command{
Short: "make a decision",
Use: "decide",
Use: "decide [policy_file_or_dir_path]",
Copy link
Contributor

Choose a reason for hiding this comment

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

😄

Copy link
Contributor

@eddiewebb eddiewebb left a comment

Choose a reason for hiding this comment

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

Awesome, thanks @sagar-connect,

@sagar-connect sagar-connect merged commit 168582f into master Aug 22, 2022
@sagar-connect sagar-connect deleted the policy_command_examples branch August 22, 2022 13:31
threepipes pushed a commit to threepipes/circleci-cli that referenced this pull request Sep 22, 2022
* added examples for policy commands

* updated example
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.

3 participants