Replies: 2 comments 1 reply
|
I like the idea of supporting custom properties in predicates and think this would be a good feature to add. One area for discussion is the design of the predicate configuration. In your implementation, there's a single predicate with many subfields. The existing predicates in Policy Bot usually focus on one specific condition instead. I'm not sure we make the same choice if designing this again, but for consistency, it may make sense to have multiple custom property predicates, for instance:
While it requires a bit more code and makes policies more verbose, one advantage is that it is clearer how multiple conditions combine: they follow the existing |
|
Implemented in #1054 and will be part of the next release. Thanks for contributing this feature! |
Uh oh!
There was an error while loading. Please reload this page.
What we are trying to achieve
We would like to be able to specify rules that apply if the repository's custom properties match certain conditions, which we use internally to store metadata regarding the repository and for the purpose of applying specific org-wide rulesets. For example, we have different security configurations for repositories based on their usage (production, experimental, etc).
While it is possible to generate the list of repositories and use it in the policy, implementing it directly in Policy Bot means that it will never get out of sync.
How we are currently achieving the goal
Corresponding code change: https://github.com/mercari/policy-bot/pull/4/files
We have added the
CustomPropertypredicate to support string (and technically boolean) custom properties.All reactions