Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds documentation for policy tests as well as a new GitHub Actions workflow to run these tests automatically.
- Introduces a README file with information on policy tests.
- Adds a CI workflow to run rego tests on pushes and pull requests.
Reviewed Changes
Copilot reviewed 3 out of 7 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rego/README.md | Added documentation explaining policy tests and usage context. |
| .github/workflows/rego.yaml | Introduced a workflow to trigger policy test execution. |
Files not reviewed (4)
- Makefile: Language not supported
- rego/fixtures.rego: Language not supported
- rego/policies.rego: Language not supported
- rego/policies_test.rego: Language not supported
1556e05 to
6b8eb29
Compare
steiza
left a comment
There was a problem hiding this comment.
First of all, this is amazing. Really nice work implementing, testing, and automating the testing.
... but that won't stop me from being nit-picky (sorry!)
291e1f3 to
5ff050b
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces new provenance and issuer checks in the Rego constraint templates while adding documentation and workflow tests for policy validations.
- Updated constraint templates in validation/ to compare provenance and issuer values from certificate data.
- Enhanced documentation in rego/README.md and README.md, and added a new GitHub Actions workflow for rego tests.
Reviewed Changes
Copilot reviewed 7 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| validation/from-repo-constraint-template.yaml | Added provenance and issuer validations with updated indexing |
| validation/from-org-with-signer-constraint-template.yaml | Added provenance and issuer validations and fixed comparison comment |
| validation/from-org-constraint-template.yaml | Added provenance and issuer validations with a minor comment change |
| rego/README.md | New documentation for policy tests |
| README.md | Updated usage instructions and examples |
| .github/workflows/rego.yaml | New workflow to run rego tests |
Files not reviewed (4)
- Makefile: Language not supported
- rego/policies.rego: Language not supported
- rego/policies_test.rego: Language not supported
- scripts/diff_policy.sh: Language not supported
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the Rego policy constraints by adding additional validations for provenance and issuer fields, and it updates documentation and CI workflows to reflect these changes.
- Added provenance and issuer verification to repo, org-with-signer, and org constraint templates.
- Updated README files and added a GitHub Actions workflow to test the new policy configurations.
Reviewed Changes
Copilot reviewed 7 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| validation/from-repo-constraint-template.yaml | Adds provenance and issuer checks in the repo constraint policy. |
| validation/from-org-with-signer-constraint-template.yaml | Adds provenance and issuer checks in the org-with-signer policy. |
| validation/from-org-constraint-template.yaml | Adds provenance and issuer checks in the org constraint policy. |
| rego/README.md | Introduces documentation for policy tests. |
| README.md | Updates instructions and references for policy testing. |
| .github/workflows/rego.yaml | Adds a workflow to run policy tests using OPA. |
Files not reviewed (4)
- Makefile: Language not supported
- rego/policies.rego: Language not supported
- rego/policies_test.rego: Language not supported
- scripts/diff_policy.sh: Language not supported
Comments suppressed due to low confidence (3)
validation/from-repo-constraint-template.yaml:40
- [nitpick] Consider adding inline comments or using more descriptive variable names for the indices (i, j, k, l) to clarify their roles in accessing nested response elements.
some i, j, k, l
validation/from-org-with-signer-constraint-template.yaml:40
- [nitpick] Consider adding comments to explain the purpose of each index (i, j, k, l, m) so that future readers understand how these indices map to the response structure.
some i, j, k, l, m
validation/from-org-constraint-template.yaml:40
- [nitpick] Consider adding inline comments or renaming the indices to more descriptive names to improve readability in nested array accesses.
some i, j, k, l
Verify that the policy ensures that the expected OIDC issuer is found. Use consistent function naming in policies and constraint files Add a step to compare that the constraint and policies are the same.
1a88ce0 to
c6f5cd4
Compare
malancas
left a comment
There was a problem hiding this comment.
lgtm, the some i,j,k,l stuff is neat
Per https://github.com/github/package-security/issues/2849