Releases: palantir/policy-bot
1.12.2
Improved handling for requesting reviewers (#127)
Reduce the number of events that trigger the request reviewer flow.
Check for assigned reviewers just before requesting (#126)
Previously we only checked once, performed lookups, and possibly requested reviewers after a human had already done so. Instead, we can check a second time just before making the last API call.
1.12.1
1.12.0
1.11.0
Add only_has_contributors_in
predicate (#114)
The new only_has_contributors_in
predicate is similar to has_contributor_in
, but applies to all contributors on a pull request, including the pull request author. This is useful to enable special approval conditions when a mix of trusted users and/or automated bots have contributed to a pull request.
Add ability to read some configuration values from the environment (#113)
All GitHub options and certain sensitive Policy Bot options can be defined or overridden by environment variables. The exact properties and environment variable names are described in the sample configuration file.
Fix caching when a pull request contains no changed files (#105)
Previously, if a pull request had no files, the file cache for a request was never initialized. When a policy has many file-based rules, this can lead to a huge number of unnecessary API requests and delay evaluation.
Other Changes
1.10.1
Order rules by status on the details page (#96)
When viewing the details of a pull requests, rules are now ordered by status, with approved rules at the top, then pending rules, and finally skipped rules. This makes it easier to see which rules are still required when the policy contains many different rules.
Other Changes
1.10.0
Add client caching for GitHub REST requests (#91)
GitHub responses to v3 REST API requests are now cached and requests are made conditionally when possible. This reduces the request load Policy Bot places on GitHub and avoids rate limiting. Cached requests are always re-validated with GitHub to avoid working with stale data. The maximum size of the cache is also configurable by administrators.
Other Changes
- Increase the number of retries when the
pushedDate
of a commit is not loaded (#92)
1.9.3
1.9.2
Add support for policy files larger than 1MB (#84)
In certain situations, auto-generated policy files can be larger than the 1MB size limit allowed by the "get contents" API. If this is the case, policy-bot will now fallback to a different API that allows files up to 100MB.
Other changes
- Clarify error messages when listing commits (#79)
1.9.1
Add author_is_only_contributor
predicate (#77)
This predicate applies if the pull request author is the only author and committer of commits in the pull request. It's useful in conjunction with has_author_in
to reduce or increase the approval required for specific authors only when no other users have added commits to the same branch.
Retry loading data if initial response is missing information (#78)
This is a workaround for a GitHub API issue where new information about a pull request is sometimes not available at the time the pull_request
webhook event is received.
1.9.0
This release includes changes originally released in the 1.7.x and 1.8.x versions. These older releases are not recommended due to regressions in important functionality.
Fix invalidate_on_push
for pull requests from forks (#61, #68, #76)
Originally released in 1.7.0, fully fixed in 1.9.0.
Due to API limitations in GitHub, the information required to implement invalidate_on_push
was not being returned for pull requests from forks, meaning new commits pushed to these PRs did not invalidate approval. We've switched to an alternate method of retrieving push times for commits from forks.
Note: policy-bot
now errors on pull requests from private forks. We believe that these PRs are uncommon and that fixing the invalidate_on_push
behavior is more important, but please let us know if you relied on this functionality.
Add modified_lines
predicate (#71)
Originally released in 1.8.0
Users can now use the modified_lines
predicate to apply rules based on the number of lines added or removed by a pull request. See the README for details on how to configure this predicate.
Fix error when posting audit statuses (#73)
Originally released in 1.8.1
policy-bot monitors status checks to verify that other users with write access do not overwrite the statuses generated by policy-bot. If an overwrite is detected, policy-bot posts a failed status, but previously used a description value that was too long, causing GitHub to return an error response instead.
Adjust how update merge commits are detected (#76)
A commit is now considered an update merge (for the purpose of the ignore_update_merges
option) if it is created via the UI or API and has exactly two parents, one that is part of the pull request and one that is not. Previously, the second parent had to appear in the last 100 commits on the target branch. The new method is simpler and takes advantage of the fact that GitHub already excludes commits that exist on the target branch from the pull request commits.