-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework rule format to distinguish between trigger and actions #213
Comments
Maybe we could have multiple triggers and specify ALL or ONE? Also, if we could have multiple actions (simply an array of objects?), we can save people from the rule-duplication that's currently happening. |
Interesting. I think it makes things more complex to write, but way more clear as well. I like the idea of dividing re concept: We have Phabricator like functionality, but I don't believe we should duplicate Phabricator's interface, meaning is not a recipe for success (necessarily). I like the atomic approach we have set so far. altho some duplication exists, we can debug and share more simply what's going on in a rule. Simplicity keeps being key. Rules are meant to be written once, and read many times, also hopefully re-used. |
@cyamonide do you mind investigate how our current rules will look like with this new format? I would hate to do this work without anticipating issues. |
In Phabricator's Herald, conditions and actions are made distinct:
use-herald-action
's rules should take on a similar interface.Motivation
Currently, rules exist in the form of a flat JSON object which makes it difficult to understand the cause and effect of a particular UHA rule at a glance.
An example
Current rule
To the uninitiated, the
teams
attribute above is ambiguous, and could be a trigger condition. Does it mean to addmy-awesome-team
as a reviewer, or is it a rule that triggers when a member ofmy-awesome-team
opens the PR?After inspecting the rule, it's possible to deduce the former. However, it shouldn't take EMs and new developers a few minutes to figure out what a rule does.
Reworked rule
The new format (above) distinguishes triggers and actions (cause and effect) much better.
Extensibility
Instead of having users determine a JSONPath expression for triggering a rule when, say, a specific user has opened a PR, it would be nice if a rule could accept a list of users on which to trigger the rule.
However, there is already a
users
field accepted by our current rule format, and it is used in the action (not the trigger) of the rule.The text was updated successfully, but these errors were encountered: