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)
Feb 13 2024, 9:53 PM
Unknown Object (File)
Feb 3 2024, 3:04 PM
Unknown Object (File)
Jan 31 2024, 2:11 AM
Unknown Object (File)
Jan 20 2024, 5:32 PM
Unknown Object (File)
Jan 9 2024, 10:22 AM
Unknown Object (File)
Jan 5 2024, 1:46 PM
Unknown Object (File)
Jan 3 2024, 6:56 AM
Unknown Object (File)
Dec 27 2023, 10:12 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.