mirror of
https://github.com/harness/drone.git
synced 2025-05-17 01:20:13 +08:00
[FIX] Add repo_pullreq_seq to pullreq read APIs (#158)
This commit is contained in:
parent
7ada1af3aa
commit
d61e876de0
@ -74,16 +74,19 @@ func (c *Controller) Create(
|
||||
return nil, usererror.BadRequest("a pull request for this target and source branch already exists")
|
||||
}
|
||||
|
||||
targetRepo, _ = c.repoStore.UpdateOptLock(ctx, targetRepo, func(repo *types.Repository) error {
|
||||
targetRepo, err = c.repoStore.UpdateOptLock(ctx, targetRepo, func(repo *types.Repository) error {
|
||||
repo.PullReqSeq++
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to aquire PullReqSeq number: %w", err)
|
||||
}
|
||||
|
||||
pr := newPullReq(session, targetRepo.PullReqSeq, sourceRepo, targetRepo, in)
|
||||
|
||||
err = c.pullreqStore.Create(ctx, pr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("pullreq creation failed: %w", err)
|
||||
}
|
||||
|
||||
return pr, nil
|
||||
|
@ -418,6 +418,7 @@ repo_id
|
||||
,repo_updated
|
||||
,repo_git_uid
|
||||
,repo_default_branch
|
||||
,repo_pullreq_seq
|
||||
,repo_fork_id
|
||||
,repo_num_forks
|
||||
,repo_num_pulls
|
||||
|
Loading…
Reference in New Issue
Block a user