PRs: Move to use a temporary repo for pushing new prs #10009

Merged
lunny merged 3 commits from prevent-intermittent-pr-creation-push-failure into master 2020-01-28 10:23:59 +00:00
Contributor

Whilst testing on my local machine I was able to consistently make a failure with making a PR from one particular repository to the same repository. I'm not certain why this is the case, but changing the pull structure to do the push from a temporary repository fixes this.

Whilst testing on my local machine I was able to consistently make a failure with making a PR from one particular repository to the same repository. I'm not certain why this is the case, but changing the pull structure to do the push from a temporary repository fixes this.
6543 (Migrated from github.com) reviewed 2020-01-27 12:01:11 +00:00
@ -312,2 +312,4 @@
log.Trace("PushToBaseRepo[%d]: pushing commits to base repo '%s'", pr.BaseRepoID, pr.GetGitRefName())
// Clone base repo.
tmpBasePath, err := models.CreateTemporaryPath("pull")
6543 (Migrated from github.com) commented 2020-01-27 12:01:10 +00:00

if func PushToBaseRepo is called in paralel - they still result in different tmpRepos ?
@zeripath

if func `PushToBaseRepo` is called in paralel - they still result in different tmpRepos ? @zeripath
zeripath reviewed 2020-01-27 13:14:03 +00:00
@ -312,2 +312,4 @@
log.Trace("PushToBaseRepo[%d]: pushing commits to base repo '%s'", pr.BaseRepoID, pr.GetGitRefName())
// Clone base repo.
tmpBasePath, err := models.CreateTemporaryPath("pull")
Author
Contributor

Yup they do. Take a look at the code for create temporary path.

Yup they do. Take a look at the code for create temporary path.
6543 (Migrated from github.com) approved these changes 2020-01-27 14:29:39 +00:00
mrsdizzie (Migrated from github.com) approved these changes 2020-01-27 19:23:53 +00:00
guillep2k (Migrated from github.com) reviewed 2020-01-27 21:57:31 +00:00
guillep2k (Migrated from github.com) commented 2020-01-27 21:57:14 +00:00

It would be nice to log the path to remove, so the admin can remove it themselves.

It would be nice to log the path to remove, so the admin can remove it themselves.
zeripath reviewed 2020-01-27 22:30:57 +00:00
Author
Contributor
			log.Error("Error whilst removing temporary path: %s Error: %v", tmpBasePath, err)
```suggestion log.Error("Error whilst removing temporary path: %s Error: %v", tmpBasePath, err) ```
zeripath reviewed 2020-01-27 22:31:20 +00:00
Author
Contributor

It should literally never happen though.

It should literally never happen though.
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#10009
No description provided.