Skip to content

Releases: palantir/policy-bot

1.12.2

16 Oct 09:55
5d53002
Compare
Choose a tag to compare

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

11 Oct 16:34
46d8fb1
Compare
Choose a tag to compare

Fix regression in pull_request_review_event handling (#125)

Usage of the in-preview isDraft field in the GraphQL API caused failures when the field was missing.

1.12.0

11 Oct 10:49
950cbbf
Compare
Choose a tag to compare

Add ability to request reviewers automatically (#121, #122 #123, #124)

policy-bot can now automatically request reviewers when a pull request is opened by using the request_review option on an approval rule. See the README for more usage details.

Other Changes

  • Bump mixin-deep from 1.3.1 to 1.3.2 (#118)
  • Allow policy-bot to be hosted at a subpath behind a proxy (#117)

1.11.0

19 Aug 09:41
Compare
Choose a tag to compare

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

  • Document URLs for GitHub App configuration (#104)
  • Bump lodash from 4.17.11 to 4.17.14 (#101)
  • Update palantir/go-githubapp to the latest version (#115)

1.10.1

11 Jul 23:14
f7969f9
Compare
Choose a tag to compare

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

  • Correctly identify rate limit metrics by installation ID (#95)
  • Add additional debug logging for rare GitHub API failures (#97)
  • Improve documentation (#94, #98)

1.10.0

25 Jun 18:45
b5eb561
Compare
Choose a tag to compare

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

19 Jun 21:21
Compare
Choose a tag to compare

Fix author_is_only_contributor predicate for web commits (#89)

Commits created via the GitHub UI are now properly detected as having a single author. Previously, GitHub was incorrectly identified as a non-author contributor.

Other Changes

  • Update front end build dependencies

1.9.2

05 Jun 22:44
Compare
Choose a tag to compare

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

02 May 20:33
b4b6b6f
Compare
Choose a tag to compare

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

30 Apr 19:46
93cf299
Compare
Choose a tag to compare

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.

Other Changes

  • Administrators can now set the log level in the configuration (#60)
  • Fix a long-standing data race with default approval and disapproval methods (#66)
  • Build with Go 1.12.4 and Godel 2.16.0 (#67)