-
Notifications
You must be signed in to change notification settings - Fork 0
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
docs: readme about autoattach #6
Conversation
WalkthroughThe changes in this pull request focus on enhancements to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
README.md (3)
9-13
: Consider enhancing the policy attachment section with examplesThe section provides good information but could be more actionable with practical examples. Consider adding:
> ## Attaching Policies to Spacelift Stacks > > Spacelift Policies can be attached to Spacelift Stacks via labels! [See the official Spacelift documentation](https://docs.spacelift.io/concepts/policy#automatically) that shows how policies with the label `autoattach:*` attaches to all stacks and `autoattach:label_here` attaches to all stacks with the `label_here` label. +> +> ### Examples: +> - `autoattach:*` - Attaches to all stacks +> - `autoattach:prod` - Attaches to stacks labeled with `prod` +> - `autoattach:needs-approval` - Attaches to stacks labeled with `needs-approval`
50-50
: Consider clarifying multiple label behaviorThe example effectively shows the autoattach label usage. Consider adding a note about how multiple labels interact:
- labels = ["env:prod", "autoattach:needs-approvers"] # This policy will be auto-attached to stacks with the 'needs-approvers' label. + labels = ["env:prod", "autoattach:needs-approvers"] # This policy will be auto-attached to stacks with the 'needs-approvers' label. The 'env:prod' label is used for policy organization.
56-62
: Consider adding a basic test exampleThe testing section provides excellent resources. Consider enhancing it with a basic test case example:
> ### Testing your Spacelift OPA Rego Policies > > Spacelift Policies use the Open Policy Agent (OPA) Rego language. You can test your policies using the [Rego Playground](https://play.openpolicyagent.org/). > > Masterpoint has an [open-source GitHub Action to automate the testing of OPA Rego policies](https://github.com/masterpointio/github-action-opa-rego-test). It is also showcased on [OPA Ecosystem's Integrations page](https://www.openpolicyagent.org/integrations/github-action-opa-rego-test/). +> +> #### Example Test Case: +> ```rego +> test_allow { +> allow with input as {"user": {"role": "admin"}} +> } +> ``` +> +> You can also test policies locally using the OPA CLI: +> ```bash +> opa test . -v +> ```
> | ||
> Spacelift Policies use the Open Policy Agent (OPA) Rego language. You can test your policies using the [Rego Playground](https://play.openpolicyagent.org/). | ||
> | ||
> Masterpoint has an [open-source GitHub Action to automate the testing of OPA Rego policies](https://github.com/masterpointio/github-action-opa-rego-test). It is also showcased on [OPA Ecosystem's Integrations page](https://www.openpolicyagent.org/integrations/github-action-opa-rego-test/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌 🙌 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!
what
references
Markdown preview
Tip
Attaching Policies to Spacelift Stacks
Spacelift Policies can be attached to Spacelift Stacks via labels! See the official Spacelift documentation that shows how policies with the label
autoattach:*
attaches to all stacks andautoattach:label_here
attaches to all stacks with thelabel_here
label.Tip
Testing your Spacelift OPA Rego Policies
Spacelift Policies use the Open Policy Agent (OPA) Rego language. You can test your policies using the Rego Playground.
Masterpoint has an open-source GitHub Action to automate the testing of OPA Rego policies. It is also showcased on OPA Ecosystem's Integrations page.
Summary by CodeRabbit