-
Notifications
You must be signed in to change notification settings - Fork 109
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
feat(policy): Support marshalling of config #796
base: develop
Are you sure you want to change the base?
Conversation
Thanks for your interest in palantir/policy-bot, @iainlane! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think it's fine to support this for people who'd like to use it.
Note that we don't offer any guarantees about Go-level compatibility between different versions of Policy Bot. As long as the behavior of the running server is compatible, we may make breaking changes to any of the Go packages in minor/patch versions. Something to be aware of if you plan to consume this code in a tool to generate policies.
6ad96ce
to
701277f
Compare
701277f
to
3ba5a0f
Compare
13c4546
to
99349c4
Compare
Sometimes it's convenient to generate a Policy Bot config. For example, when handling required but optional workflows, you need the config file to contain a rule for each workflow which replicates its path filters. That job is made much easier if the Policy Bot types can be reused. But without `omitempty` the generated YAML contains all fields and it's hard to read/review. Add `omitempty` where it's needed, and `IsZero` in a few places too - which is how the behaviour of `omitempty` can be customised.
99349c4
to
787b1cf
Compare
Just remembered about this / came back to it and rebased 👍 |
Also part of: palantir#796
Sometimes it's convenient to generate a Policy Bot config. For example, when handling required but optional workflows, you need the config file to contain a rule for each workflow which replicates its path filters.
That job is made much easier if the Policy Bot types can be reused. But without
omitempty
the generated YAML contains all fields and it's hard to read/review.Add
omitempty
where it's needed, andIsZero
in a few places too - which is how the behaviour ofomitempty
can be customised.