Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Auto add reviwers to pull request by condition

irismet
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 27, 2018

Hello! I ran into a problem, when executing a request for a pull request, a check should be performed on the names of the changed files according to my list of critical files in which there are 1000 file names.
I did a check through the script runner (event handlers - auto add reviewers) and the code looks like this:

def file_path = "/home/iris/top-files.txt"
def fileContents = new File (file_path)

for (String str in fileContents.getText ('UTF-8'). split ("\ n"))
{
  pathsMatch('glob: **' + str, event.pullRequest.getCommits())
}

And the problem is that it works for about 70-80 seconds it is very long.
And the problem is that the developer will not wait so much time, he simply clicks on the Creat button, and the check will stop, the reviewers will not be added to the pull request.

From here, I see two exits or make the CREATE button inactive during the scan or display a modal window with a warning that the check is in progress and that the user cannot press the buttons.
Or speed up the check.
Maybe there are some ideas about this.
Thanks!

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events