Skip to content

prevent "unknown" base_commit SHA from failing PR creation#6266

Merged
jakecoffman merged 2 commits intomainfrom
jakecoffman/base-commit-sanity-checks
Dec 5, 2022
Merged

prevent "unknown" base_commit SHA from failing PR creation#6266
jakecoffman merged 2 commits intomainfrom
jakecoffman/base-commit-sanity-checks

Conversation

@jakecoffman
Copy link
Copy Markdown
Member

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.commit could be returning nil, 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 commit could return nil is here:

raise unless e.message.include?("Repository is empty")

I'm unsure why we would not want to throw in that situation. 🤔

@jakecoffman jakecoffman requested a review from a team as a code owner December 5, 2022 19:07
@jakecoffman jakecoffman merged commit 0459eba into main Dec 5, 2022
@jakecoffman jakecoffman deleted the jakecoffman/base-commit-sanity-checks branch December 5, 2022 20:17
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.

2 participants