When creating a new herald rule for "Commits -> Body contains Diffusion -> Any Action", the error "Failed to decode rule data." is fired and the rule is not created. Is this a bug, or is the Herald documentation lacking in how to avoid the exception being thrown?
Description
Revisions and Commits
Event Timeline
The issue still appears when selecting New rule for "Commits" rather than "Commit Hook: Commit Content". Looking to open an audit on commits which have not passed through Phabricator, which the commit hooks do not have as an option.
I can't immediately reproduce this. Here's what I did:
I created a new rule like this:
Here's the detail view:
I pushed a new commit to trigger the rule:
>>> orbital ~/repos/POEMS $ git commit -m 'test test test diffusion' [blarp 99b742c] test test test diffusion 1 file changed, 1 insertion(+) >>> orbital ~/repos/POEMS $ git push Counting objects: 5, done. Delta compression using up to 8 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 278 bytes, done. Total 3 (delta 2), reused 0 (delta 0) To ssh://dweller@localhost/diffusion/POEMS/ 8f3e93b..99b742c blarp -> blarp
After it parsed, it produced a valid transcript:
This transcript showed the rule fired:
The transcript body shows the field populated correctly ("Field: Body"):
And the rule detail looks correct too:
Any ideas about what I'm doing differently?
Oh, sorry, it looks like I'm really bad at reading. If you aren't even getting as far as rule creation, maybe try checking your browser console for Javascript errors?
I had thought "Failed to decode rule data." was firing elsewhere, but it's only if your browser does not POST a valid JSON representation of the rule when you hit "Save". So this is probably something in the JS.
Meaning a better question than which VCS you're using is probably "Which browser are you using?"
Can confirm rule creation works fine using Firefox. Error I'm seeing appears in IE 8.0 but doesnt seem to throw a JS error, though this may just be my unfamiliarity with the IE tools. Happy for bug to be closed as IE's fault.
Ah, cool. We'll take a look at this -- we ostensibly support IE8, it just doesn't get tested much since we have fewer users on it than FF/Chrome/Safari.
Having said that, there is another bug: Though I can create an email rule just fine, selecting "Trigger an audit by" does not allow me to select a user: Typing a name does not bring down the typical list of matched names and leaving the field blank is equivalent to the "Do Nothing" choice.
Ideally, I'd like to leave the name field blank and have any willing developer pick up the audit.
The blankness is probably another JS browser issue, possibly caused by the first issue. Is that also IE-only, or IE+FF?
For "any developer", you should be able to put all your developers in a project called "Developers" and trigger an audit by the project.
IE+FF both fail to produce the drop down, though both do produce it on the other actions, e.g. send an email. Thanks for the project tip!
Another twist, the list IS produced for projects, just not users. Perhaps this is intentional?
However, selecting a project as the audit target seems to cause the rule to never fire. Exactly the same set up with an email target to a user instead does fire using the Herald Test Console.
Ah, yeah, the underlying source only included projects. I think it's rare to want to write a global rule which triggers for users, but there's no reason to disallow it and it's confusing that it's not available as an option. D7803 should fix this, and allow you to choose either users or projects.
Apologies, the rule does seem to trigger. I hadn't noticed the "Rules that Affected Me" vs "Rules I Own" in the Herals rule test. It doesn't seem to be aware I'm a user of the selected project, but this isn't technically wrong.
So all seems to be working, thanks!
We're probably going to get rid of that sidebar or make it default to "All" (see T3506) -- it was appropriate at Facebook when everything triggered like 200 rules to default it to "Me", but is confusing in other cases.