Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/migration/pullrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type PullRequest struct {
ForeignIndex int64
Context DownloaderContext `yaml:"-"`
EnsuredSafe bool `yaml:"ensured_safe"`
IsDraft bool `yaml:"is_draft"`
}

func (p *PullRequest) GetLocalIndex() int64 { return p.Number }
Expand Down
7 changes: 6 additions & 1 deletion services/migrations/gitea_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,15 @@ func (g *GiteaLocalUploader) newPullRequest(pr *base.PullRequest) (*issues_model
pr.Updated = pr.Created
}

prTitle := pr.Title
if pr.IsDraft {
prTitle = fmt.Sprintf("%s%s", setting.Repository.PullRequest.WorkInProgressPrefixes[0], pr.Title)
}

issue := issues_model.Issue{
RepoID: g.repo.ID,
Repo: g.repo,
Title: pr.Title,
Title: prTitle,
Index: pr.Number,
Content: pr.Content,
MilestoneID: milestoneID,
Expand Down
1 change: 1 addition & 0 deletions services/migrations/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullReq
PatchURL: pr.GetPatchURL(), // see below for SECURITY related issues here
Reactions: reactions,
ForeignIndex: int64(*pr.Number),
IsDraft: pr.GetDraft(),
})

// SECURITY: Ensure that the PR is safe
Expand Down
1 change: 1 addition & 0 deletions services/migrations/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque
PatchURL: pr.WebURL + ".patch",
ForeignIndex: int64(pr.IID),
Context: gitlabIssueContext{IsMergeRequest: true},
IsDraft: pr.Draft,
})

// SECURITY: Ensure that the PR is safe
Expand Down
Loading