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

Update "OPA Policy Tests" GitHub action #126

Merged
merged 1 commit into from Nov 16, 2022

Conversation

aknysh
Copy link
Member

@aknysh aknysh commented Nov 16, 2022

what

  • Update "OPA Policy Tests" GitHub action

why

  • b4b4r07/action-opa repo has a very old OPA version, and the repo has not been updated in many years
  • We need the latest OPA version to use some new Rego functions for comparing list of strings in Spacelift Rego policies to make the policy evaluation much faster
  • We forked the repo to https://github.com/cloudposse/action-opa and updated everything to the new versions including OPA

references

@aknysh aknysh added the patch A minor, backward compatible change label Nov 16, 2022
@aknysh aknysh self-assigned this Nov 16, 2022
@aknysh aknysh requested review from a team as code owners November 16, 2022 15:31
@github-actions
Copy link

OPA test results

[INFO] Testing for catalog/policies/access.default.rego...
PASS: 1/1
[INFO] Checking test coverage for catalog/policies/access.default.rego...
PASS: coverage 100%
[ERROR] catalog/policies/git_push.default.rego: test file not found
[ERROR] catalog/policies/git_push.head-diff.rego: test file not found
[INFO] Testing for catalog/policies/git_push.proposed-run.rego...
PASS: 11/11
[INFO] Checking test coverage for catalog/policies/git_push.proposed-run.rego...
PASS: coverage 100%
[ERROR] catalog/policies/git_push.tracked-run.rego: test file not found
[INFO] Testing for catalog/policies/plan.default.rego...
PASS: 2/2
[INFO] Checking test coverage for catalog/policies/plan.default.rego...
PASS: coverage 100%
[ERROR] catalog/policies/plan.deny-created-resources.rego: test file not found
[ERROR] catalog/policies/plan.warn-on-deletions-and-recreations.rego: test file not found
[ERROR] catalog/policies/plan.warn-on-resource-changes-except-image-id.rego: test file not found
[ERROR] catalog/policies/trigger.administrative.rego: test file not found
[ERROR] catalog/policies/trigger.dependencies.rego: test file not found
[INFO] Testing for catalog/policies/trigger.retries.rego...
PASS: 5/5
[INFO] Checking test coverage for catalog/policies/trigger.retries.rego...
PASS: coverage 100%

@aknysh
Copy link
Member Author

aknysh commented Nov 16, 2022

/test all

nitrocode
nitrocode previously approved these changes Nov 16, 2022
@nitrocode
Copy link
Member

Hmm seeing an error

Error: could not validate provider config: either the API key must be set or the following settings must be provided: api_key_endpoint, api_key_id, api_key_secret

@aknysh
Copy link
Member Author

aknysh commented Nov 16, 2022

Hmm seeing an error

Error: could not validate provider config: either the API key must be set or the following settings must be provided: api_key_endpoint, api_key_id, api_key_secret

this module never deployed to Spacelift, the terratest was never required

test errors

we don't have tests for all policies, it was like that before, so the errors say that the test files are not found

@aknysh aknysh merged commit 0319729 into master Nov 16, 2022
@aknysh aknysh deleted the update-policy-tests-gh-action branch November 16, 2022 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants