prevent "unknown" base_commit SHA from failing PR creation#6266
Merged
jakecoffman merged 2 commits intomainfrom Dec 5, 2022
Merged
prevent "unknown" base_commit SHA from failing PR creation#6266jakecoffman merged 2 commits intomainfrom
jakecoffman merged 2 commits intomainfrom
Conversation
landongrindheim
approved these changes
Dec 5, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We're noticing some PRs are failing to be created and have "unknown" set as the base_commit.
One way that could be happening is the
file_fetcher.commitcould be returningnil, which then gets set to "unknown". Then the update carries that values through the entire update posting PRs which will fail with a base commit of "unknown." We originally added the "unknown" in a few places in #5981 to fix an exception in the exception handler.So I've removed the
|| "unknown"and added a sanity check which will take us into the rescue.It seems like the only place
commitcould returnnilis here:dependabot-core/common/lib/dependabot/file_fetchers/base.rb
Line 88 in db729c1
I'm unsure why we would not want to throw in that situation. 🤔