-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cherrypicker when the fork is not named the same as the repo #20826
Conversation
Looks good to me, thank you for fixing this! |
@@ -556,7 +556,7 @@ func (s *Server) ensureForkExists(org, repo string) (string, error) { | |||
fork := s.botUser.Login + "/" + repo | |||
|
|||
// fork repo if it doesn't exsit | |||
if _, err := s.ghc.EnsureFork(s.botUser.Login, org, repo); err != nil { | |||
if repo, err := s.ghc.EnsureFork(s.botUser.Login, org, repo); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only case in which this code will use the name from EnsureFork
is if there was an error in which case we don't do anything anyways, this doesn't address Steves comment at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you write some tests for this method to be confident your changes do what you think they do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks for the feedback
df30e9b
to
9a2ae14
Compare
9a2ae14
to
7838946
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, chaodaiG, mpherman2 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
If the fork name was not the same as the repo name, we were not returning the right value for ensureForkExists