philschatz/project-bot

option to AND rules

Opened this issue · 3 comments

Is this not possible at all? How can we get multiple rules honored for one pipeline?

I do think this is necessary as well. I'm currently using this (while it's been SUPER HANDY! Thank you for making this), I want to be able to achieve e.g. the situation where I have "high priority issues" and "high priority PRs" on separate columns. Without the AND rules, this wouldn't be possible.

need this as well :)

Use case is filtering the PR events by a group of labels.

I think a good format for this could be

###### Automation Rules

<!-- Documentation: https://github.com/philschatz/project-bot -->

- `new_pullrequest`
  - `added_label` **target:beta**

This would also mean that #104 wouldn't be needed as the parent rule for new issue/pr would still create the card.

This syntax would allow for some relatively powerful logical branching, with nested signifying "AND" and sibling signaling "OR" (which is the current behavior of rule lists).

You could implement something like A && ((B && C) || D || (E && F)) for instance with the following:

###### Automation Rules

<!-- Documentation: https://github.com/philschatz/project-bot -->

-  A
  - B
    - C
  - D
  - E
    - F

This would be achieved by the existing parser creating rules in a tree structure https://github.com/philschatz/project-bot/blob/master/src/extract-rules.js and the rule matchers being updated to ensure that the necessary conditions of the rule's children were also matched.