prevent failing to create a PR due to metadata gathering errors#5980
prevent failing to create a PR due to metadata gathering errors#5980jakecoffman merged 5 commits intomainfrom
Conversation
30ca2fc to
754c5bd
Compare
|
Fix #3844 |
|
I have this up as a draft because it's unclear to me why the I'll look into this more tomorrow, but if anyone has a tip let me know! |
|
That was odd, there was a second exception but it was showing the first rescued exception in the output which made it look like the rescue wasn't working. Once I stepped through the code I could see what the issue was. |
| Dependabot.logger.error("Error while generating PR name: #{e.message}") | ||
| pr_name = "" | ||
| end | ||
| pr_name += library? ? library_pr_name : application_pr_name |
There was a problem hiding this comment.
Just for my understanding what is the library here?
There was a problem hiding this comment.
Dependabot differentiates between library and application in a few places. For NPM, if you publish to the registry it's considered a library, otherwise it's an application. I actually didn't look at how this code changes depending on the type, but in another place it decides whether to increase the version vs widen the range.
Dependabot gathers useful information to populate the PR body and commit message. If Dependabot encounters a network error, the PR won't be posted since that extra information can't be obtained.
This PR catches those errors and populates the PR body and commit message with a minimal safe amount of info, and also logs the error so it's not a mystery as to why the message is sparse.