MCPcopy Index your code
hub / github.com/apache/devlake / convertGiteePullRequest

Function convertGiteePullRequest

backend/plugins/gitee/tasks/pr_extractor.go:147–170  ·  view source on GitHub ↗
(pull *GiteeApiPullResponse, connId uint64, repoId int)

Source from the content-addressed store, hash-verified

145 return extractor.Execute()
146}
147func convertGiteePullRequest(pull *GiteeApiPullResponse, connId uint64, repoId int) (*models.GiteePullRequest, errors.Error) {
148 giteePull := &models.GiteePullRequest{
149 ConnectionId: connId,
150 GiteeId: pull.GiteeId,
151 RepoId: repoId,
152 Number: pull.Number,
153 State: pull.State,
154 Title: pull.Title,
155 Url: pull.HtmlUrl,
156 AuthorName: pull.User.Login,
157 AuthorId: pull.User.Id,
158 GiteeCreatedAt: pull.GiteeCreatedAt.ToTime(),
159 GiteeUpdatedAt: pull.GiteeUpdatedAt.ToTime(),
160 ClosedAt: common.Iso8601TimeToTime(pull.ClosedAt),
161 MergedAt: common.Iso8601TimeToTime(pull.MergedAt),
162 MergeCommitSha: pull.MergeCommitSha,
163 Body: string(pull.Body),
164 BaseRef: pull.Base.Ref,
165 BaseCommitSha: pull.Base.Sha,
166 HeadRef: pull.Head.Ref,
167 HeadCommitSha: pull.Head.Sha,
168 }
169 return giteePull, nil
170}

Callers 1

ExtractApiPullRequestsFunction · 0.85

Calls 1

ToTimeMethod · 0.45

Tested by

no test coverage detected