formbricks / oss.gg

Gamify Open Source Contributions
https://oss.gg
MIT License
44 stars 25 forks source link

[FEATURE] Lay groundwork for BOUNTIES 💸 #74

Closed jobenjada closed 4 months ago

jobenjada commented 5 months ago

Is your feature request related to a problem? Please describe.

Currently, it is not possible to add bounties to issues. So we ship it :)

Describe the solution you'd like

We have this great, in-depth concept written bei the oss.gg PM team 🤓 Please read it carefully so you know what you're up to:

https://www.notion.so/ossgg/Bounty-System-A-Unified-Concept-e1782477db714bd18904aefb2ebbccac?pvs=4

Some aspect of the Concept are too far reaching, so I'll boil it down a bit and add some context on how to implement it:

  1. Dive deep into the Tremendous docs: https://developers.tremendous.com/docs/introduction We will use Tremendous to handle the bounty payouts. It's free for us and provides all the integrations that we need

  2. In terms of bounty creation UX, we start with creating bounties only on Github (in the same way you can only award points via GitHub right now). Look at how we use /award to award points in PRs. Similarly maintainers can add bounties to issues with /bounty 50 where 50 is the USD amount.

  3. Start with the schema. Add a new model Bounty to schema.prisma file with the following fields:

id: ccid (unique)
usdAmount: int
status: open/redeemed
issueUrl: 
createdAt:
updatedAt:
userId: String
repositoryId: String

user: User (relation)
repository: Repository (relation)

Very similar to the pointTransaction model, right?

  1. Write a ZOD schema and derive a type from it (follow the same structure like the point Transaction)

This is the ground work. Now, we will make our lives easier!!

Instead of creating and updating the bounty in our db when the maintainer runs /bounty we keep everything on Github until a PR gets merged. This keeps the whole bounty thing analog to how we handle pointTransactions.

  1. Write a GitHub action which is triggered if a maintainer runs /bounty 50 with the following checks:

    • Is issue or PR? If PR, display "Bounties can only be setup in issues, not in PRs."
    • Does already have bounty? "The bounty was updated to new value"
    • Add a label (like the one you can see on this issue "💸 50 USD" in green. If it already has such a label, skip. If it has a different bounty label, remove the old and add the new one.
  2. Now comes the interesting part: If a PR gets merged successfully and it has a valid bounty label attached to it a series of things happens:

Once the bounty was redeemed:


This should be the most basic implementation of it with all important parts setup 🤓 However...

Please think along! You'll be the expert and if you find a smarter/quicker/better way to build this, please let me know :)

For question, pls hit up @jobenjada

Thanks! 🤸

Describe alternatives you've considered

No response

Additional context

No response

raysubham commented 5 months ago

/assign

manish-singh-bisht commented 5 months ago

/assign

oss-gg[bot] commented 5 months ago

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] commented 5 months ago

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] commented 5 months ago

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] commented 5 months ago

This issue is already assigned to another person. Please find more issues here.

oss-gg[bot] commented 5 months ago

This issue is already assigned to another person. Please find more issues here.

raysubham commented 5 months ago

Unassigning myself from this issue to pick another issue.

raysubham commented 5 months ago

/unassign

oss-gg[bot] commented 5 months ago

Issue unassigned.

oss-gg[bot] commented 5 months ago

Issue unassigned.

raysubham commented 4 months ago

/assign