mappjzc opened a new issue, #2067:
URL: https://github.com/apache/incubator-devlake/issues/2067

   ## Describe the bug
   The MustCompile function throws a panic instead of an error when we fill in 
an invalid regex setting in the .env config file or somewhere else.
   
![image](https://user-images.githubusercontent.com/2921251/171658303-f7da05bc-03e9-400e-b0a2-70e784c186bc.png)
   
![image](https://user-images.githubusercontent.com/2921251/171657949-c9bb9b6e-b067-4f0f-a804-6faea30ea0ef.png)
   
![image](https://user-images.githubusercontent.com/2921251/171658036-801bb0a3-1b2b-4527-b761-d6b996659090.png)
   As shown in the figure above, when the github plugin has been executed for a 
long time and finally reaches the step of EnrichPullRequestIssues, it will read 
the regular expression from the configuration file and execute MustCompile
   At this point, MustCompile fails to parse and throws panic.
   From the log, no error log was written at this time. There is also no line 
count information for the error location, the only known information is the 
panic sent to the config-ui
   
   MustCompile be used at lot of place.
   There all will be throw panic but not an error. 
   
   ## To Reproduce
   Steps to reproduce the behavior:
   1. Go to set an incorrect regex to GITHUB_PR_BODY_CLOSE_PATTERN.
   2. Run github plugin with EnrichPullRequestIssues.
   
   ## Expected behavior
   Use error,but not panic.
   Maybe Compile  is better than MustCompile ?
   
   ## Screenshots
   If applicable, add screenshots to help explain your problem.
   
   ## Additional context
   Add any other context about the problem here.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to