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 automation for PR rejection #66

Merged
merged 9 commits into from
Apr 15, 2024

Conversation

manish-singh-bisht
Copy link
Contributor

@manish-singh-bisht manish-singh-bisht commented Apr 11, 2024

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

  • 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 Apr 11, 2024

@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.

Copy link

github-actions bot commented Apr 11, 2024

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

@manish-singh-bisht manish-singh-bisht marked this pull request as draft April 11, 2024 13:23
@manish-singh-bisht manish-singh-bisht changed the title feat: f Add automation for PR rejection feat: Add automation for PR rejection Apr 11, 2024
@manish-singh-bisht manish-singh-bisht marked this pull request as ready for review April 11, 2024 21:06
@jobenjada
Copy link
Member

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:

jobenjada/test-ossgg#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
Copy link
Member

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: test april jobenjada/test-ossgg#5

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

Thanks!!

@manish-singh-bisht
Copy link
Contributor Author

manish-singh-bisht commented Apr 15, 2024

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

Copy link
Member

@jobenjada jobenjada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging under the objection that I might reverse if the duplicate comment issue replicates on prod.

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

/award 250

Copy link

oss-gg bot commented Apr 15, 2024

Awarding manish-singh-bisht: 250 points!

Merged via the queue into formbricks:main with commit c920ca5 Apr 15, 2024
2 of 3 checks passed
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] Add automation for PR rejection
2 participants