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)
Tue, Dec 24, 10:14 AM
Unknown Object (File)
Tue, Dec 24, 7:12 AM
Unknown Object (File)
Fri, Dec 20, 7:14 PM
Unknown Object (File)
Thu, Dec 19, 5:10 AM
Unknown Object (File)
Thu, Dec 12, 9:25 PM
Unknown Object (File)
Fri, Nov 29, 9:03 PM
Unknown Object (File)
Nov 25 2024, 8:04 AM
Unknown Object (File)
Nov 21 2024, 7:47 AM
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.