Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Bounties 💸 #79

Merged
merged 4 commits into from
May 15, 2024
Merged

feat: Add Bounties 💸 #79

merged 4 commits into from
May 15, 2024

Conversation

raysubham
Copy link
Contributor

@raysubham raysubham commented May 1, 2024

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 #74

Screen.Recording.2024-05-01.at.7.1.mp4

How should this be tested?

  • Create a new tremendous sandbox account (https://developers.tremendous.com/docs/1-create-a-sandbox-account) and create a new API key. Also create a new campaign and copy the campaign id. Add these value in the .env file, copy them from the .env.example file.
  • Create a issue, then assign a bounty on it. Then from a different GitHub account, raise a PR which mentions the issue in the PR description. Now merge it, the bounty will now be awarded and you will recieve a mail with the reward details.

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at oss.gg
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

Copy link

vercel bot commented May 1, 2024

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

A member of the Team first needs to authorize it.

Copy link

github-actions bot commented May 1, 2024

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

@raysubham raysubham changed the title feat: Add Bounties feat: Add Bounties 💸 May 1, 2024
@raysubham raysubham marked this pull request as ready for review May 1, 2024 14:24
@jobenjada
Copy link
Member

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Screen.Recording.2024-05-09.at.10.27.45.PM.mov

@jobenjada jobenjada added this pull request to the merge queue May 15, 2024
@jobenjada
Copy link
Member

/award 800

Copy link

oss-gg bot commented May 15, 2024

Awarding raysubham: 800 points!

Merged via the queue into formbricks:main with commit 927c9a5 May 15, 2024
2 of 3 checks passed
@jobenjada jobenjada mentioned this pull request May 18, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Lay groundwork for BOUNTIES 💸
2 participants