palantir / policy-bot

A GitHub App that enforces approval policies on pull requests
Apache License 2.0
780 stars 108 forks source link

requires.conditions not working correctly in rule #785

Closed reedog117 closed 5 months ago

reedog117 commented 5 months ago

Have a rule that looks like this

- name: rulename
  if:
    changed_files:
      paths:
        - path1
        - path2
  requires:
    conditions:
      has_successful_status:
        - "status check"

I'm getting this error when attempting to validate the policy.

{"message":"Policy is invalid. 'yaml: unmarshal errors:\n  line 77: field conditions not found in type common.Requires'.","version":"1.34.1"}

I'm guessing this isn't expected since requires.conditions is an example config in the README.

bluekeyes commented 5 months ago

The requires.conditions feature was introduced in 1.35.0, but from the log, it looks like you instance of Policy Bot is still running 1.34.1. Please try upgrading to the latest version and see if that fixes things.

reedog117 commented 5 months ago

Updating to 1.35.0 fixed this. Thanks!