policy-bot icon indicating copy to clipboard operation
policy-bot copied to clipboard

Feature: Include PR Body in Approval Candidates

Open agirlnamedsophia opened this issue 3 years ago • 2 comments

This adds a solution for https://github.com/palantir/policy-bot/issues/417.

As discussed in the attached issue, this adds support for reading the PR Body for approval patterns. It also invalidates a current approval if the body is edited, if the user has ignore_edited_body in their policy options list.

Let me know if this looks okay. Especially curious if there are other better ways to have tested this implementation. Thank you again for considering this!

agirlnamedsophia avatar Jul 22 '22 15:07 agirlnamedsophia

@bluekeyes thanks for your speedy feedback! I have implemented some changes. Let me knokw what you think.

agirlnamedsophia avatar Aug 02 '22 16:08 agirlnamedsophia

we also want to add something like this to the rule Trigger method here, so that updates will automatically reflect on the PR instead of having to check the details page to trigger all:

		if len(m.BodyPatterns) > 0 {
			t |= common.TriggerPullRequest
		}

devinburnette avatar Aug 08 '22 17:08 devinburnette

Thanks for the feedback @devinburnette and @bluekeyes - I've finally made the changes. Sorry for the delay, was on a long holiday.

agirlnamedsophia avatar Sep 06 '22 13:09 agirlnamedsophia

this lgtm

devinburnette avatar Sep 09 '22 15:09 devinburnette