Feature request
Please consider supporting GitHub reaction objects as approval candidates or policy predicates.
Use case
Some GitHub Apps and review bots signal a successful review by adding a +1
reaction to the pull request issue instead of posting a pull request comment or
submitting an approving review. In that case, Policy Bot cannot currently model
the bot signal directly with policy configuration.
For example, a policy author may want a rule like:
approval_rules:
- name: review bot reacted
options:
methods:
reactions:
issue:
content: "+1"
requires:
count: 1
users:
- "chatgpt-codex-connector[bot]"
The exact shape is only a strawman. The important part is being able to count a
GitHub reaction from a required user/app account the same way Policy Bot can
currently count comments, comment patterns, GitHub reviews, review-comment
patterns, and pull-request body patterns.
Current workaround
The workaround is to run a separate bridge check that calls GitHub's reactions
API, verifies that the required bot account added a +1 reaction to the PR
issue, then publishes a commit status or check run that Policy Bot can require
through has_status.
That works, but it means every repository or organization that wants to use this
signal needs to maintain extra automation just to translate a GitHub approval
signal into something Policy Bot already understands.
Semantics to consider
- The first useful target would be reactions on the pull request issue itself:
GET /repos/{owner}/{repo}/issues/{issue_number}/reactions?content=%2B1.
- It would be helpful if reaction approval candidates honored existing
requires.users, requires.organizations, and requires.teams checks.
- If
invalidate_on_push is enabled, a reaction created before the latest
relevant push should probably be treated similarly to a stale approval
comment, using the reaction created_at timestamp.
- If GitHub does not send webhook events for reaction changes, it would still be
useful for Policy Bot to read reactions during normal policy evaluation and
document the re-evaluation behavior.
Why this belongs in Policy Bot
Policy Bot already lets teams model nuanced approval signals declaratively. A
reaction approval method would keep the policy in one place and avoid requiring
custom status-bridge automation for bots whose only public approval signal is a
GitHub reaction.
Feature request
Please consider supporting GitHub reaction objects as approval candidates or policy predicates.
Use case
Some GitHub Apps and review bots signal a successful review by adding a
+1reaction to the pull request issue instead of posting a pull request comment or
submitting an approving review. In that case, Policy Bot cannot currently model
the bot signal directly with policy configuration.
For example, a policy author may want a rule like:
The exact shape is only a strawman. The important part is being able to count a
GitHub reaction from a required user/app account the same way Policy Bot can
currently count comments, comment patterns, GitHub reviews, review-comment
patterns, and pull-request body patterns.
Current workaround
The workaround is to run a separate bridge check that calls GitHub's reactions
API, verifies that the required bot account added a
+1reaction to the PRissue, then publishes a commit status or check run that Policy Bot can require
through
has_status.That works, but it means every repository or organization that wants to use this
signal needs to maintain extra automation just to translate a GitHub approval
signal into something Policy Bot already understands.
Semantics to consider
GET /repos/{owner}/{repo}/issues/{issue_number}/reactions?content=%2B1.requires.users,requires.organizations, andrequires.teamschecks.invalidate_on_pushis enabled, a reaction created before the latestrelevant push should probably be treated similarly to a stale approval
comment, using the reaction
created_attimestamp.useful for Policy Bot to read reactions during normal policy evaluation and
document the re-evaluation behavior.
Why this belongs in Policy Bot
Policy Bot already lets teams model nuanced approval signals declaratively. A
reaction approval method would keep the policy in one place and avoid requiring
custom status-bridge automation for bots whose only public approval signal is a
GitHub reaction.