mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-14 18:24:14 +01:00
[F3] ID remapping logic is in place, remove workaround
This commit is contained in:
parent
c770713656
commit
d0fee30167
2 changed files with 4 additions and 9 deletions
|
@ -111,6 +111,7 @@ func (o *Review) FromFormat(review *format.Review) {
|
||||||
*o = Review{
|
*o = Review{
|
||||||
Review: issues_model.Review{
|
Review: issues_model.Review{
|
||||||
ID: review.GetID(),
|
ID: review.GetID(),
|
||||||
|
ReviewerID: review.ReviewerID.GetID(),
|
||||||
Reviewer: &user_model.User{
|
Reviewer: &user_model.User{
|
||||||
ID: review.ReviewerID.GetID(),
|
ID: review.ReviewerID.GetID(),
|
||||||
},
|
},
|
||||||
|
@ -191,12 +192,6 @@ func (o *ReviewProvider) Put(ctx context.Context, user *User, project *Project,
|
||||||
comment.ID = 0
|
comment.ID = 0
|
||||||
}
|
}
|
||||||
r.IssueID = pullRequest.IssueID
|
r.IssueID = pullRequest.IssueID
|
||||||
// this is a workaround because the id remapping logic is missing, wait until it is implemented and remove it
|
|
||||||
u, err := user_model.GetUserByName(ctx, r.Reviewer.Name)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
r.ReviewerID = u.ID
|
|
||||||
if err := issues_model.InsertReviews([]*issues_model.Review{r}); err != nil {
|
if err := issues_model.InsertReviews([]*issues_model.Review{r}); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ func TestF3(t *testing.T) {
|
||||||
fixture.NewAsset()
|
fixture.NewAsset()
|
||||||
fixture.NewIssueComment(nil)
|
fixture.NewIssueComment(nil)
|
||||||
fixture.NewPullRequestComment()
|
fixture.NewPullRequestComment()
|
||||||
// fixture.NewReview()
|
fixture.NewReview()
|
||||||
fixture.NewIssueReaction()
|
fixture.NewIssueReaction()
|
||||||
fixture.NewCommentReaction()
|
fixture.NewCommentReaction()
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ func TestF3(t *testing.T) {
|
||||||
assert.Contains(t, files, "/release/")
|
assert.Contains(t, files, "/release/")
|
||||||
assert.Contains(t, files, "/asset/")
|
assert.Contains(t, files, "/asset/")
|
||||||
assert.Contains(t, files, "/comment/")
|
assert.Contains(t, files, "/comment/")
|
||||||
// assert.Contains(t, files, "/review/")
|
assert.Contains(t, files, "/review/")
|
||||||
assert.Contains(t, files, "/reaction/")
|
assert.Contains(t, files, "/reaction/")
|
||||||
// f3_util.Command(context.Background(), "cp", "-a", f3.GetDirectory(), "abc")
|
// f3_util.Command(context.Background(), "cp", "-a", f3.GetDirectory(), "abc")
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue