formbricks / oss.gg

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

feat: Add Bounties 💸 #79

Closed raysubham closed 1 month ago

raysubham commented 2 months ago

What does this PR do?

  1. Add /bounty command to create bounties for an issue. Only allows bounty on issues.
  2. Whenever a PR gets merged and it has a linked issue, runs checks for the bounty validity and awards bounty if everything is correct.
  3. Uses tremendous to dispatch bounty rewards and mails them to the user.
  4. Adds a new bounties table to the db.

Fixes https://github.com/formbricks/oss.gg/issues/74

https://github.com/formbricks/oss.gg/assets/66999381/92419bef-9eca-4ce2-89cc-2259eb86cb35

How should this be tested?

Checklist

Required

Appreciated

vercel[bot] commented 2 months ago

@raysubham is attempting to deploy a commit to the formbricks Team on Vercel.

A member of the Team first needs to authorize it.

github-actions[bot] commented 2 months ago

Thank you for following the naming conventions for pull request titles! 🙏

jobenjada commented 2 months ago

Hey @raysubham

so cool! Thanks a lot also for the video and great PR description :))

I've applied for a prod API key from Tremendous. Maybe we can use the meanwhile to add a limit to the bounties which can be issued. It makes me a bit nervous to think that someone might exploit this to issue and reward a bunch of bounties to themselves.

The form is there already, can we introduce the max bounty amount?

image

Would only require the app to check if the /bounty exceeds the max amount and display a corresponding notifier, if it does 🤓

I'm aware that bounties are only paid out if a PR gets merged but it would still let me sleep a bit better 😉

Thanks a ton, this is great!

raysubham commented 2 months ago

Hey @raysubham

so cool! Thanks a lot also for the video and great PR description :))

I've applied for a prod API key from Tremendous. Maybe we can use the meanwhile to add a limit to the bounties which can be issued. It makes me a bit nervous to think that someone might exploit this to issue and reward a bunch of bounties to themselves.

The form is there already, can we introduce the max bounty amount?

image

Would only require the app to check if the /bounty exceeds the max amount and display a corresponding notifier, if it does 🤓

I'm aware that bounties are only paid out if a PR gets merged but it would still let me sleep a bit better 😉

Thanks a ton, this is great!

Totally agree, We should have proper guardrails in place to avoid exploiting this feature. Additionally, before awarding bounty, we also check whether the PR author is assigned the issue or not. I'll make the max bounty setting changes by today.

raysubham commented 2 months ago

@jobenjada I have added the max bounty settings. Please review it.

https://github.com/formbricks/oss.gg/assets/66999381/5e3e9fb7-f788-4009-b00a-129e345c33c4

jobenjada commented 1 month ago

/award 800

oss-gg[bot] commented 1 month ago

Awarding raysubham: 800 points!