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!