Skip to content

Comments

Rego tests#14

Merged
kommendorkapten merged 17 commits intomainfrom
rego-tests
Apr 24, 2025
Merged

Rego tests#14
kommendorkapten merged 17 commits intomainfrom
rego-tests

Conversation

@kommendorkapten
Copy link
Member

Copilot AI review requested due to automatic review settings April 8, 2025 06:59
@kommendorkapten kommendorkapten requested a review from a team as a code owner April 8, 2025 06:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

Copy link
Member

@steiza steiza left a comment

Choose a reason for hiding this comment

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

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!)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

@kommendorkapten kommendorkapten requested a review from Copilot April 10, 2025 08:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

steiza
steiza previously approved these changes Apr 10, 2025
Copy link
Member

@steiza steiza left a comment

Choose a reason for hiding this comment

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

LGTM!

malancas
malancas previously approved these changes Apr 18, 2025
Copy link
Contributor

@malancas malancas left a comment

Choose a reason for hiding this comment

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

lgtm, the some i,j,k,l stuff is neat

@kommendorkapten kommendorkapten dismissed stale reviews from malancas and steiza via 272afe0 April 22, 2025 07:02
@kommendorkapten kommendorkapten merged commit 0c27497 into main Apr 24, 2025
9 checks passed
@kommendorkapten kommendorkapten deleted the rego-tests branch April 24, 2025 06:54
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