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)
Sat, Nov 26, 3:05 PM
Unknown Object (File)
Fri, Nov 11, 1:39 PM
Unknown Object (File)
Oct 17 2022, 10:57 PM
Unknown Object (File)
Oct 3 2022, 5:08 AM
Unknown Object (File)
Oct 1 2022, 11:35 PM
Unknown Object (File)
Oct 1 2022, 1:55 AM
Unknown Object (File)
Sep 27 2022, 6:37 AM
Unknown Object (File)
Sep 6 2022, 11:41 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.