formbricks / oss.gg

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

feat: Add automation for PR rejection #66

Closed manish-singh-bisht closed 2 months ago

manish-singh-bisht commented 3 months ago

What does this PR do?

fixes #47

Technical description- since there is no persistent storage to store users whose pr is rejected , i am utilizing comment of GitHub. when /reject is executed for the first time a comment will be created "Attempted:user1". this comment is updated ,adding the new user ,every time the reject command is executed. this comment will be between the reject command and the rejection message. placement is important, as it makes it faster to catch this particular comment while looping through all the comment in the issue comment section when the assign command is executed by the user whose pr is already rejected,and is sure that this comment will be just above the first rejection message or just below the first reject command

Regex at multiple places be careful.

Screencast from 12-04-24 02:42:00 AM IST.webm

How should this be tested?

on an issue write /reject pr #prNumber message

Required

Appreciated

vercel[bot] commented 3 months ago

@manish-singh-bisht 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 3 months ago

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

jobenjada commented 2 months ago

Hey @manish-singh-bisht

thanks a lot for working on this and sorry for the delay in review!

Here is my feedback:


1. Lots of bot messages

As you can see here in my test issue, the bot created 19 comments:

https://github.com/jobenjada/test-ossgg/issues/5

Please make sure this doesn't happen.


  1. Complicated UX

I'm sorry if that wasn't clear from the ticket description, but we need this to work in PRs and not in Issues. So in the PR itself, I comment/reject This is my reason and then the described actions happen. In a nutshell, this needs to happen:

  1. Comment on PR with the message drafted
  2. Close PR
  3. Check if PR is connected to an issue. If not, post another comment in the PR: "This PR is not linked to an issue. Please update the issue status manually."
  4. If yes, check if the PR author is also assigned to this issue. If so:
    • Unassign
    • Post a comment into the issue: "The issue is up for grabs again! Feel free to assign yourself using /assign"

This should also cut down a bit on the logic needed in the hook 🤓


Other than that, great work! Works very well :))

jobenjada commented 2 months ago

Please see Discord message, in my test repo it does not work.

  1. Doesnt work in PRs, still works in Issues
  2. Getting a loooot of bot comments in the issue: https://github.com/jobenjada/test-ossgg/issues/5

Please make a video and explain how your fixes make it work as described in the comment 🙏

Thanks!!

manish-singh-bisht commented 2 months ago

hey @jobenjada , removed the oss label checks for the pr,your pr didn't had ossgg labels so it didnt work , now it will.

heres the updated video

Screencast from 15-04-24 07:03:08 PM IST.webm

jobenjada commented 2 months ago

/award 250

oss-gg[bot] commented 2 months ago

Awarding manish-singh-bisht: 250 points!