Skip to content

prevent failing to create a PR due to metadata gathering errors#5980

Merged
jakecoffman merged 5 commits intomainfrom
jakecoffman/pr-dont-fail-me-now
Oct 28, 2022
Merged

prevent failing to create a PR due to metadata gathering errors#5980
jakecoffman merged 5 commits intomainfrom
jakecoffman/pr-dont-fail-me-now

Conversation

@jakecoffman
Copy link
Copy Markdown
Member

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.

@jakecoffman jakecoffman force-pushed the jakecoffman/pr-dont-fail-me-now branch from 30ca2fc to 754c5bd Compare October 26, 2022 19:58
@jeffwidman
Copy link
Copy Markdown
Member

jeffwidman commented Oct 26, 2022

Fix #3844

@jeffwidman jeffwidman linked an issue Oct 26, 2022 that may be closed by this pull request
@jakecoffman
Copy link
Copy Markdown
Member Author

I have this up as a draft because it's unclear to me why the pr_name test is failing, it seems to be ignoring the rescue. 🤷

I'll look into this more tomorrow, but if anyone has a tip let me know!

@jakecoffman jakecoffman marked this pull request as ready for review October 27, 2022 14:14
@jakecoffman jakecoffman requested a review from a team as a code owner October 27, 2022 14:14
@jakecoffman
Copy link
Copy Markdown
Member Author

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
Copy link
Copy Markdown
Contributor

@honeyankit honeyankit Oct 27, 2022

Choose a reason for hiding this comment

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

Just for my understanding what is the library here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@jakecoffman jakecoffman merged commit 46aecc9 into main Oct 28, 2022
@jakecoffman jakecoffman deleted the jakecoffman/pr-dont-fail-me-now branch October 28, 2022 14:10
@pavera pavera mentioned this pull request Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider creating the PR even if pulling the metadata fails

3 participants