Page MenuHomePhabricator

Add award and revoke conduit calls to Badges
ClosedPublic

Authored by chad on Mar 8 2017, 8:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 8:04 AM
Unknown Object (File)
Thu, Nov 21, 7:47 AM
Unknown Object (File)
Sat, Nov 16, 10:06 PM
Unknown Object (File)
Sat, Nov 9, 1:06 PM
Unknown Object (File)
Sat, Nov 2, 1:44 AM
Unknown Object (File)
Oct 21 2024, 6:50 AM
Unknown Object (File)
Oct 17 2024, 10:07 AM
Unknown Object (File)
Oct 13 2024, 6:22 PM
Subscribers

Details

Summary

Allow people to award and remove badges via conduit, but not from the standard badges form.

Test Plan

Build a generator and generate awards. Didn't test the revoke yet.

pasted_file (1×2 px, 278 KB)

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Should this be it's own AwardEditEngine? I think I can make one but not have it anywhere other than conduit?

I think we should probably just hold this for now since we don't really have use cases yet.

If we build "award reason" in the future (where an awarder can explain why they awarded the badge, which seems nice to have and like something we'll probbbbably build eventually?) then a separate badge.award.edit probably makes more sense (so you can provide a reason, edit it, etc). Or if we let badges be awarded multiple times ("1st Place Finish in Company Sack Race" for 2018, 2019, and 2021), since then revocation would need to specify which award was being revoked.

If we don't build that stuff then something like this makes more sense, but it's hard/impossible to extend to those use cases without compatibility breaks if we do build those features.

I built it for the lipsum generator. :/

I think that's a reasonable-enough use case. We could do the lipsum thing by using a raw Editor, but I think using Conduit is cleaner. One inline about naming/consistency. If we do end up making a small break here in the future that's not the end of the world.

src/applications/badges/editor/PhabricatorBadgesEditEngine.php
128

Minor, but prefer award and revoke for consistency -- no other keys have underscores.

This revision is now accepted and ready to land.Mar 9 2017, 7:24 PM

Yeah this seemed minimal to maintain and even if we had badge.award.edit, we could still keep this around. I do like the long-term idea of Badges + Facts for automatic awards. I tried to futz with Herald, but it felt forced.

This revision was automatically updated to reflect the committed changes.