Page MenuHomePhabricator

Make "ADD_CC" and "REMOVE_CC" available as "standard" Herald effects
ClosedPublic

Authored by epriestley on Jun 6 2015, 12:33 PM.
Tags
None
Referenced Files
F13091636: D13179.diff
Thu, Apr 25, 3:06 AM
Unknown Object (File)
Sun, Apr 21, 7:04 PM
Unknown Object (File)
Thu, Apr 11, 10:36 AM
Unknown Object (File)
Tue, Apr 9, 11:37 PM
Unknown Object (File)
Sun, Mar 31, 6:49 AM
Unknown Object (File)
Mar 25 2024, 4:29 AM
Unknown Object (File)
Mar 17 2024, 8:25 PM
Unknown Object (File)
Feb 18 2024, 9:12 AM
Subscribers

Details

Summary

Ref T8455. Begins consolidating the code for applying these effects:

  • Makes Add/Remove subscribers a standard effect, and uses it in Pholio.
  • This includes the "don't re-subscribe users who have explicitly unsubscribed" logic from Differential in the standard effect. I think this rule is always desirable.
  • This adds new filtering of invalid PHID types to resolve the arc diff issue in T8455 once Differential uses this standard effect.
  • Added "Remove Subscribers" to MockAdapter in order to test that it works.
  • Relabeled "CC" in Pholio to "Subscribers" for consistency.
Test Plan
  • Created several rules which add subscribers to (and remove subscribers from) mocks.
  • Updated mocks, changing properties and adding and removing subscribers.
  • Observed transactions applying and aggregating properly.
  • Observed add/remove rules each working correctly.
  • Observed the "don't re-add unsubscribed users" condition acting on subscribers who had previously been added but explicitly removed/unsubscribed.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Make "ADD_CC" and "REMOVE_CC" available as "standard" Herald effects.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
btrahan added inline comments.
src/applications/herald/adapter/HeraldAdapter.php
1701–1703

I'm curious what else are you thinking should / could be here? (I figure we have the subscriber xaction itself so not immediately clear to me what else to surface here in time.)

This revision is now accepted and ready to land.Jun 8 2015, 4:46 PM
src/applications/herald/adapter/HeraldAdapter.php
1701–1703

We "shouldn't" be storing translated text in the database: we currently generate a bunch of error messages in some arbitrary user's translation, then store the raw text. We should really store some kind of machine-readable representation of the error so we can render and display it to users in their own language.

We're generally pretty good about this, but do it here, and also do it in Audit (storing audit reasons as text). Those are the only two I'm aware of.

In this particular case, it would be helpful to show the fate of each individual target: X, Y were subscribed, Z and A had already been unsubscribed, B was invalid. But doing this in a translatable way was a crazy amount of work, and that work to get the translations right was "wrong", and we can't really show handles properly, so it would be an unintelligible mess of PHIDs anyway, so I just skipped it for now.

I think this will get easier once Herald eventually modularizes and these actions can be split out per class and have translations in them, similar to how Transactions work. This sequence of diffs moves Herald toward that, although we still have a way to go.

Eventually, I'd imagine the output possibly looking something like this:

RULE                TARGET         ACTION

H23 Example Rule    epriestley     Added subscriber.
                    btrahan        This user previously unsubscribed.
                    MLST           Invalid subscriber.
                    
                                        ^
                                        |
  These would be translated properly ---+
This revision was automatically updated to reflect the committed changes.