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

Custom Policy #213

Closed
ctit-cl opened this issue Jul 21, 2023 · 3 comments
Closed

Custom Policy #213

ctit-cl opened this issue Jul 21, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ctit-cl
Copy link

ctit-cl commented Jul 21, 2023

TL;DR

modify the repository.rego file, commenting or removing some line to disable some rule.

Error at run time

image

Expected behavior

see if we can deactivate some rules according to team policies

Observed behavior

No response

Version

0.2.7

On which operating system are you using legitify?

Linux

Relevant log output

Error: compiler: 11 errors occurred:
../gitlab/repository.rego:11: rego_type_error: multiple default rules data.repository.project_not_maintained found
../gitlab/repository.rego:150: rego_type_error: multiple default rules data.repository.no_conversation_resolution found
../gitlab/repository.rego:180: rego_type_error: multiple default rules data.repository.code_review_not_required found
../gitlab/repository.rego:102: rego_type_error: multiple default rules data.repository.repository_require_code_owner_reviews_policy found
../gitlab/repository.rego:195: rego_type_error: multiple default rules data.repository.code_review_by_two_members_not_required found
../gitlab/repository.rego:240: rego_type_error: multiple default rules data.repository.repository_allows_committer_approvals_policy found
../gitlab/repository.rego:254: rego_type_error: multiple default rules data.repository.repository_dismiss_stale_reviews found
../gitlab/repository.rego:50: rego_type_error: multiple default rules data.repository.forking_allowed_for_repository found
../gitlab/repository.rego:121: rego_type_error: multiple default rules data.repository.project_webhook_doesnt_require_ssl found
../gitlab/repository.rego:210: rego_type_error: multiple default rules data.repository.repository_allows_review_requester_to_approve_their_own_request found
rego_compile_error: error limit reached

Additional information

No response

@noamd-legit
Copy link
Contributor

Hi @ctit-cl,
Custom policies are only for adding new policies and not for removing existing ones.
I've created this feature request to support it.

Meanwhile, If you're willing to compile legitify from source I could guide you how to deactivate the unwanted policies

@ctit-cl
Copy link
Author

ctit-cl commented Jul 25, 2023

@noamd-legit thanks for the help, can you help me to be able to disable the rules at build time?

@noamd-legit
Copy link
Contributor

@ctit-cl I've just added support for specifying policies to ignore - #218

If you run from the main branch you can use the --ignore-policies-path PATH option to do that.

The ignore file needs to contain each policy name in a new line, e.g.

no_conversation_resolution
requires_status_checks   

Let me know how it works for you 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants