2020-10-17 12:23:08 +08:00
|
|
|
// Copyright 2020 The Gitea Authors. All rights reserved.
|
2022-11-28 02:20:29 +08:00
|
|
|
// SPDX-License-Identifier: MIT
|
2020-10-17 12:23:08 +08:00
|
|
|
|
|
|
|
package convert
|
|
|
|
|
|
|
|
import (
|
2022-11-19 16:12:33 +08:00
|
|
|
"context"
|
|
|
|
|
2022-06-13 17:37:59 +08:00
|
|
|
issues_model "code.gitea.io/gitea/models/issues"
|
2022-01-01 22:12:25 +08:00
|
|
|
repo_model "code.gitea.io/gitea/models/repo"
|
|
|
|
user_model "code.gitea.io/gitea/models/user"
|
|
|
|
"code.gitea.io/gitea/modules/log"
|
2020-10-17 12:23:08 +08:00
|
|
|
api "code.gitea.io/gitea/modules/structs"
|
2023-06-23 20:12:39 +08:00
|
|
|
"code.gitea.io/gitea/modules/util"
|
2020-10-17 12:23:08 +08:00
|
|
|
)
|
|
|
|
|
2022-06-13 17:37:59 +08:00
|
|
|
// ToComment converts a issues_model.Comment to the api.Comment format
|
Add context cache as a request level cache (#22294)
To avoid duplicated load of the same data in an HTTP request, we can set
a context cache to do that. i.e. Some pages may load a user from a
database with the same id in different areas on the same page. But the
code is hidden in two different deep logic. How should we share the
user? As a result of this PR, now if both entry functions accept
`context.Context` as the first parameter and we just need to refactor
`GetUserByID` to reuse the user from the context cache. Then it will not
be loaded twice on an HTTP request.
But of course, sometimes we would like to reload an object from the
database, that's why `RemoveContextData` is also exposed.
The core context cache is here. It defines a new context
```go
type cacheContext struct {
ctx context.Context
data map[any]map[any]any
lock sync.RWMutex
}
var cacheContextKey = struct{}{}
func WithCacheContext(ctx context.Context) context.Context {
return context.WithValue(ctx, cacheContextKey, &cacheContext{
ctx: ctx,
data: make(map[any]map[any]any),
})
}
```
Then you can use the below 4 methods to read/write/del the data within
the same context.
```go
func GetContextData(ctx context.Context, tp, key any) any
func SetContextData(ctx context.Context, tp, key, value any)
func RemoveContextData(ctx context.Context, tp, key any)
func GetWithContextCache[T any](ctx context.Context, cacheGroupKey string, cacheTargetID any, f func() (T, error)) (T, error)
```
Then let's take a look at how `system.GetString` implement it.
```go
func GetSetting(ctx context.Context, key string) (string, error) {
return cache.GetWithContextCache(ctx, contextCacheKey, key, func() (string, error) {
return cache.GetString(genSettingCacheKey(key), func() (string, error) {
res, err := GetSettingNoCache(ctx, key)
if err != nil {
return "", err
}
return res.SettingValue, nil
})
})
}
```
First, it will check if context data include the setting object with the
key. If not, it will query from the global cache which may be memory or
a Redis cache. If not, it will get the object from the database. In the
end, if the object gets from the global cache or database, it will be
set into the context cache.
An object stored in the context cache will only be destroyed after the
context disappeared.
2023-02-15 21:37:34 +08:00
|
|
|
func ToComment(ctx context.Context, c *issues_model.Comment) *api.Comment {
|
2020-10-17 12:23:08 +08:00
|
|
|
return &api.Comment{
|
2022-12-09 14:35:56 +08:00
|
|
|
ID: c.ID,
|
Add context cache as a request level cache (#22294)
To avoid duplicated load of the same data in an HTTP request, we can set
a context cache to do that. i.e. Some pages may load a user from a
database with the same id in different areas on the same page. But the
code is hidden in two different deep logic. How should we share the
user? As a result of this PR, now if both entry functions accept
`context.Context` as the first parameter and we just need to refactor
`GetUserByID` to reuse the user from the context cache. Then it will not
be loaded twice on an HTTP request.
But of course, sometimes we would like to reload an object from the
database, that's why `RemoveContextData` is also exposed.
The core context cache is here. It defines a new context
```go
type cacheContext struct {
ctx context.Context
data map[any]map[any]any
lock sync.RWMutex
}
var cacheContextKey = struct{}{}
func WithCacheContext(ctx context.Context) context.Context {
return context.WithValue(ctx, cacheContextKey, &cacheContext{
ctx: ctx,
data: make(map[any]map[any]any),
})
}
```
Then you can use the below 4 methods to read/write/del the data within
the same context.
```go
func GetContextData(ctx context.Context, tp, key any) any
func SetContextData(ctx context.Context, tp, key, value any)
func RemoveContextData(ctx context.Context, tp, key any)
func GetWithContextCache[T any](ctx context.Context, cacheGroupKey string, cacheTargetID any, f func() (T, error)) (T, error)
```
Then let's take a look at how `system.GetString` implement it.
```go
func GetSetting(ctx context.Context, key string) (string, error) {
return cache.GetWithContextCache(ctx, contextCacheKey, key, func() (string, error) {
return cache.GetString(genSettingCacheKey(key), func() (string, error) {
res, err := GetSettingNoCache(ctx, key)
if err != nil {
return "", err
}
return res.SettingValue, nil
})
})
}
```
First, it will check if context data include the setting object with the
key. If not, it will query from the global cache which may be memory or
a Redis cache. If not, it will get the object from the database. In the
end, if the object gets from the global cache or database, it will be
set into the context cache.
An object stored in the context cache will only be destroyed after the
context disappeared.
2023-02-15 21:37:34 +08:00
|
|
|
Poster: ToUser(ctx, c.Poster, nil),
|
2022-12-09 14:35:56 +08:00
|
|
|
HTMLURL: c.HTMLURL(),
|
|
|
|
IssueURL: c.IssueURL(),
|
|
|
|
PRURL: c.PRURL(),
|
|
|
|
Body: c.Content,
|
|
|
|
Attachments: ToAttachments(c.Attachments),
|
|
|
|
Created: c.CreatedUnix.AsTime(),
|
|
|
|
Updated: c.UpdatedUnix.AsTime(),
|
2020-10-17 12:23:08 +08:00
|
|
|
}
|
|
|
|
}
|
2022-01-01 22:12:25 +08:00
|
|
|
|
2022-06-13 17:37:59 +08:00
|
|
|
// ToTimelineComment converts a issues_model.Comment to the api.TimelineComment format
|
2022-11-19 16:12:33 +08:00
|
|
|
func ToTimelineComment(ctx context.Context, c *issues_model.Comment, doer *user_model.User) *api.TimelineComment {
|
|
|
|
err := c.LoadMilestone(ctx)
|
2022-01-01 22:12:25 +08:00
|
|
|
if err != nil {
|
|
|
|
log.Error("LoadMilestone: %v", err)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
err = c.LoadAssigneeUserAndTeam()
|
|
|
|
if err != nil {
|
|
|
|
log.Error("LoadAssigneeUserAndTeam: %v", err)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
err = c.LoadResolveDoer()
|
|
|
|
if err != nil {
|
|
|
|
log.Error("LoadResolveDoer: %v", err)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
err = c.LoadDepIssueDetails()
|
|
|
|
if err != nil {
|
|
|
|
log.Error("LoadDepIssueDetails: %v", err)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
err = c.LoadTime()
|
|
|
|
if err != nil {
|
|
|
|
log.Error("LoadTime: %v", err)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
err = c.LoadLabel()
|
|
|
|
if err != nil {
|
|
|
|
log.Error("LoadLabel: %v", err)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-06-23 20:12:39 +08:00
|
|
|
if c.Content != "" {
|
|
|
|
if (c.Type == issues_model.CommentTypeAddTimeManual ||
|
|
|
|
c.Type == issues_model.CommentTypeStopTracking ||
|
|
|
|
c.Type == issues_model.CommentTypeDeleteTimeManual) &&
|
|
|
|
c.Content[0] == '|' {
|
|
|
|
// TimeTracking Comments from v1.21 on store the seconds instead of an formated string
|
|
|
|
// so we check for the "|" delimeter and convert new to legacy format on demand
|
|
|
|
c.Content = util.SecToTime(c.Content[1:])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-01 22:12:25 +08:00
|
|
|
comment := &api.TimelineComment{
|
|
|
|
ID: c.ID,
|
|
|
|
Type: c.Type.String(),
|
Add context cache as a request level cache (#22294)
To avoid duplicated load of the same data in an HTTP request, we can set
a context cache to do that. i.e. Some pages may load a user from a
database with the same id in different areas on the same page. But the
code is hidden in two different deep logic. How should we share the
user? As a result of this PR, now if both entry functions accept
`context.Context` as the first parameter and we just need to refactor
`GetUserByID` to reuse the user from the context cache. Then it will not
be loaded twice on an HTTP request.
But of course, sometimes we would like to reload an object from the
database, that's why `RemoveContextData` is also exposed.
The core context cache is here. It defines a new context
```go
type cacheContext struct {
ctx context.Context
data map[any]map[any]any
lock sync.RWMutex
}
var cacheContextKey = struct{}{}
func WithCacheContext(ctx context.Context) context.Context {
return context.WithValue(ctx, cacheContextKey, &cacheContext{
ctx: ctx,
data: make(map[any]map[any]any),
})
}
```
Then you can use the below 4 methods to read/write/del the data within
the same context.
```go
func GetContextData(ctx context.Context, tp, key any) any
func SetContextData(ctx context.Context, tp, key, value any)
func RemoveContextData(ctx context.Context, tp, key any)
func GetWithContextCache[T any](ctx context.Context, cacheGroupKey string, cacheTargetID any, f func() (T, error)) (T, error)
```
Then let's take a look at how `system.GetString` implement it.
```go
func GetSetting(ctx context.Context, key string) (string, error) {
return cache.GetWithContextCache(ctx, contextCacheKey, key, func() (string, error) {
return cache.GetString(genSettingCacheKey(key), func() (string, error) {
res, err := GetSettingNoCache(ctx, key)
if err != nil {
return "", err
}
return res.SettingValue, nil
})
})
}
```
First, it will check if context data include the setting object with the
key. If not, it will query from the global cache which may be memory or
a Redis cache. If not, it will get the object from the database. In the
end, if the object gets from the global cache or database, it will be
set into the context cache.
An object stored in the context cache will only be destroyed after the
context disappeared.
2023-02-15 21:37:34 +08:00
|
|
|
Poster: ToUser(ctx, c.Poster, nil),
|
2022-01-01 22:12:25 +08:00
|
|
|
HTMLURL: c.HTMLURL(),
|
|
|
|
IssueURL: c.IssueURL(),
|
|
|
|
PRURL: c.PRURL(),
|
|
|
|
Body: c.Content,
|
|
|
|
Created: c.CreatedUnix.AsTime(),
|
|
|
|
Updated: c.UpdatedUnix.AsTime(),
|
|
|
|
|
|
|
|
OldProjectID: c.OldProjectID,
|
|
|
|
ProjectID: c.ProjectID,
|
|
|
|
|
|
|
|
OldTitle: c.OldTitle,
|
|
|
|
NewTitle: c.NewTitle,
|
|
|
|
|
|
|
|
OldRef: c.OldRef,
|
|
|
|
NewRef: c.NewRef,
|
|
|
|
|
|
|
|
RefAction: c.RefAction.String(),
|
|
|
|
RefCommitSHA: c.CommitSHA,
|
|
|
|
|
|
|
|
ReviewID: c.ReviewID,
|
|
|
|
|
|
|
|
RemovedAssignee: c.RemovedAssignee,
|
|
|
|
}
|
|
|
|
|
|
|
|
if c.OldMilestone != nil {
|
|
|
|
comment.OldMilestone = ToAPIMilestone(c.OldMilestone)
|
|
|
|
}
|
|
|
|
if c.Milestone != nil {
|
|
|
|
comment.Milestone = ToAPIMilestone(c.Milestone)
|
|
|
|
}
|
|
|
|
|
|
|
|
if c.Time != nil {
|
2022-09-04 22:01:23 +08:00
|
|
|
err = c.Time.LoadAttributes()
|
|
|
|
if err != nil {
|
|
|
|
log.Error("Time.LoadAttributes: %v", err)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-11-19 16:12:33 +08:00
|
|
|
comment.TrackedTime = ToTrackedTime(ctx, c.Time)
|
2022-01-01 22:12:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if c.RefIssueID != 0 {
|
2022-11-19 16:12:33 +08:00
|
|
|
issue, err := issues_model.GetIssueByID(ctx, c.RefIssueID)
|
2022-01-01 22:12:25 +08:00
|
|
|
if err != nil {
|
|
|
|
log.Error("GetIssueByID(%d): %v", c.RefIssueID, err)
|
|
|
|
return nil
|
|
|
|
}
|
2022-11-19 16:12:33 +08:00
|
|
|
comment.RefIssue = ToAPIIssue(ctx, issue)
|
2022-01-01 22:12:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if c.RefCommentID != 0 {
|
2022-11-19 16:12:33 +08:00
|
|
|
com, err := issues_model.GetCommentByID(ctx, c.RefCommentID)
|
2022-01-01 22:12:25 +08:00
|
|
|
if err != nil {
|
|
|
|
log.Error("GetCommentByID(%d): %v", c.RefCommentID, err)
|
|
|
|
return nil
|
|
|
|
}
|
2022-11-19 16:12:33 +08:00
|
|
|
err = com.LoadPoster(ctx)
|
2022-01-01 22:12:25 +08:00
|
|
|
if err != nil {
|
|
|
|
log.Error("LoadPoster: %v", err)
|
|
|
|
return nil
|
|
|
|
}
|
Add context cache as a request level cache (#22294)
To avoid duplicated load of the same data in an HTTP request, we can set
a context cache to do that. i.e. Some pages may load a user from a
database with the same id in different areas on the same page. But the
code is hidden in two different deep logic. How should we share the
user? As a result of this PR, now if both entry functions accept
`context.Context` as the first parameter and we just need to refactor
`GetUserByID` to reuse the user from the context cache. Then it will not
be loaded twice on an HTTP request.
But of course, sometimes we would like to reload an object from the
database, that's why `RemoveContextData` is also exposed.
The core context cache is here. It defines a new context
```go
type cacheContext struct {
ctx context.Context
data map[any]map[any]any
lock sync.RWMutex
}
var cacheContextKey = struct{}{}
func WithCacheContext(ctx context.Context) context.Context {
return context.WithValue(ctx, cacheContextKey, &cacheContext{
ctx: ctx,
data: make(map[any]map[any]any),
})
}
```
Then you can use the below 4 methods to read/write/del the data within
the same context.
```go
func GetContextData(ctx context.Context, tp, key any) any
func SetContextData(ctx context.Context, tp, key, value any)
func RemoveContextData(ctx context.Context, tp, key any)
func GetWithContextCache[T any](ctx context.Context, cacheGroupKey string, cacheTargetID any, f func() (T, error)) (T, error)
```
Then let's take a look at how `system.GetString` implement it.
```go
func GetSetting(ctx context.Context, key string) (string, error) {
return cache.GetWithContextCache(ctx, contextCacheKey, key, func() (string, error) {
return cache.GetString(genSettingCacheKey(key), func() (string, error) {
res, err := GetSettingNoCache(ctx, key)
if err != nil {
return "", err
}
return res.SettingValue, nil
})
})
}
```
First, it will check if context data include the setting object with the
key. If not, it will query from the global cache which may be memory or
a Redis cache. If not, it will get the object from the database. In the
end, if the object gets from the global cache or database, it will be
set into the context cache.
An object stored in the context cache will only be destroyed after the
context disappeared.
2023-02-15 21:37:34 +08:00
|
|
|
comment.RefComment = ToComment(ctx, com)
|
2022-01-01 22:12:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if c.Label != nil {
|
|
|
|
var org *user_model.User
|
|
|
|
var repo *repo_model.Repository
|
|
|
|
if c.Label.BelongsToOrg() {
|
|
|
|
var err error
|
2022-12-03 10:48:26 +08:00
|
|
|
org, err = user_model.GetUserByID(ctx, c.Label.OrgID)
|
2022-01-01 22:12:25 +08:00
|
|
|
if err != nil {
|
2022-12-03 10:48:26 +08:00
|
|
|
log.Error("GetUserByID(%d): %v", c.Label.OrgID, err)
|
2022-01-01 22:12:25 +08:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if c.Label.BelongsToRepo() {
|
|
|
|
var err error
|
2022-12-03 10:48:26 +08:00
|
|
|
repo, err = repo_model.GetRepositoryByID(ctx, c.Label.RepoID)
|
2022-01-01 22:12:25 +08:00
|
|
|
if err != nil {
|
2022-12-10 10:46:31 +08:00
|
|
|
log.Error("GetRepositoryByID(%d): %v", c.Label.RepoID, err)
|
2022-01-01 22:12:25 +08:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
comment.Label = ToLabel(c.Label, repo, org)
|
|
|
|
}
|
|
|
|
|
|
|
|
if c.Assignee != nil {
|
Add context cache as a request level cache (#22294)
To avoid duplicated load of the same data in an HTTP request, we can set
a context cache to do that. i.e. Some pages may load a user from a
database with the same id in different areas on the same page. But the
code is hidden in two different deep logic. How should we share the
user? As a result of this PR, now if both entry functions accept
`context.Context` as the first parameter and we just need to refactor
`GetUserByID` to reuse the user from the context cache. Then it will not
be loaded twice on an HTTP request.
But of course, sometimes we would like to reload an object from the
database, that's why `RemoveContextData` is also exposed.
The core context cache is here. It defines a new context
```go
type cacheContext struct {
ctx context.Context
data map[any]map[any]any
lock sync.RWMutex
}
var cacheContextKey = struct{}{}
func WithCacheContext(ctx context.Context) context.Context {
return context.WithValue(ctx, cacheContextKey, &cacheContext{
ctx: ctx,
data: make(map[any]map[any]any),
})
}
```
Then you can use the below 4 methods to read/write/del the data within
the same context.
```go
func GetContextData(ctx context.Context, tp, key any) any
func SetContextData(ctx context.Context, tp, key, value any)
func RemoveContextData(ctx context.Context, tp, key any)
func GetWithContextCache[T any](ctx context.Context, cacheGroupKey string, cacheTargetID any, f func() (T, error)) (T, error)
```
Then let's take a look at how `system.GetString` implement it.
```go
func GetSetting(ctx context.Context, key string) (string, error) {
return cache.GetWithContextCache(ctx, contextCacheKey, key, func() (string, error) {
return cache.GetString(genSettingCacheKey(key), func() (string, error) {
res, err := GetSettingNoCache(ctx, key)
if err != nil {
return "", err
}
return res.SettingValue, nil
})
})
}
```
First, it will check if context data include the setting object with the
key. If not, it will query from the global cache which may be memory or
a Redis cache. If not, it will get the object from the database. In the
end, if the object gets from the global cache or database, it will be
set into the context cache.
An object stored in the context cache will only be destroyed after the
context disappeared.
2023-02-15 21:37:34 +08:00
|
|
|
comment.Assignee = ToUser(ctx, c.Assignee, nil)
|
2022-01-01 22:12:25 +08:00
|
|
|
}
|
|
|
|
if c.AssigneeTeam != nil {
|
Add context cache as a request level cache (#22294)
To avoid duplicated load of the same data in an HTTP request, we can set
a context cache to do that. i.e. Some pages may load a user from a
database with the same id in different areas on the same page. But the
code is hidden in two different deep logic. How should we share the
user? As a result of this PR, now if both entry functions accept
`context.Context` as the first parameter and we just need to refactor
`GetUserByID` to reuse the user from the context cache. Then it will not
be loaded twice on an HTTP request.
But of course, sometimes we would like to reload an object from the
database, that's why `RemoveContextData` is also exposed.
The core context cache is here. It defines a new context
```go
type cacheContext struct {
ctx context.Context
data map[any]map[any]any
lock sync.RWMutex
}
var cacheContextKey = struct{}{}
func WithCacheContext(ctx context.Context) context.Context {
return context.WithValue(ctx, cacheContextKey, &cacheContext{
ctx: ctx,
data: make(map[any]map[any]any),
})
}
```
Then you can use the below 4 methods to read/write/del the data within
the same context.
```go
func GetContextData(ctx context.Context, tp, key any) any
func SetContextData(ctx context.Context, tp, key, value any)
func RemoveContextData(ctx context.Context, tp, key any)
func GetWithContextCache[T any](ctx context.Context, cacheGroupKey string, cacheTargetID any, f func() (T, error)) (T, error)
```
Then let's take a look at how `system.GetString` implement it.
```go
func GetSetting(ctx context.Context, key string) (string, error) {
return cache.GetWithContextCache(ctx, contextCacheKey, key, func() (string, error) {
return cache.GetString(genSettingCacheKey(key), func() (string, error) {
res, err := GetSettingNoCache(ctx, key)
if err != nil {
return "", err
}
return res.SettingValue, nil
})
})
}
```
First, it will check if context data include the setting object with the
key. If not, it will query from the global cache which may be memory or
a Redis cache. If not, it will get the object from the database. In the
end, if the object gets from the global cache or database, it will be
set into the context cache.
An object stored in the context cache will only be destroyed after the
context disappeared.
2023-02-15 21:37:34 +08:00
|
|
|
comment.AssigneeTeam, _ = ToTeam(ctx, c.AssigneeTeam)
|
2022-01-01 22:12:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if c.ResolveDoer != nil {
|
Add context cache as a request level cache (#22294)
To avoid duplicated load of the same data in an HTTP request, we can set
a context cache to do that. i.e. Some pages may load a user from a
database with the same id in different areas on the same page. But the
code is hidden in two different deep logic. How should we share the
user? As a result of this PR, now if both entry functions accept
`context.Context` as the first parameter and we just need to refactor
`GetUserByID` to reuse the user from the context cache. Then it will not
be loaded twice on an HTTP request.
But of course, sometimes we would like to reload an object from the
database, that's why `RemoveContextData` is also exposed.
The core context cache is here. It defines a new context
```go
type cacheContext struct {
ctx context.Context
data map[any]map[any]any
lock sync.RWMutex
}
var cacheContextKey = struct{}{}
func WithCacheContext(ctx context.Context) context.Context {
return context.WithValue(ctx, cacheContextKey, &cacheContext{
ctx: ctx,
data: make(map[any]map[any]any),
})
}
```
Then you can use the below 4 methods to read/write/del the data within
the same context.
```go
func GetContextData(ctx context.Context, tp, key any) any
func SetContextData(ctx context.Context, tp, key, value any)
func RemoveContextData(ctx context.Context, tp, key any)
func GetWithContextCache[T any](ctx context.Context, cacheGroupKey string, cacheTargetID any, f func() (T, error)) (T, error)
```
Then let's take a look at how `system.GetString` implement it.
```go
func GetSetting(ctx context.Context, key string) (string, error) {
return cache.GetWithContextCache(ctx, contextCacheKey, key, func() (string, error) {
return cache.GetString(genSettingCacheKey(key), func() (string, error) {
res, err := GetSettingNoCache(ctx, key)
if err != nil {
return "", err
}
return res.SettingValue, nil
})
})
}
```
First, it will check if context data include the setting object with the
key. If not, it will query from the global cache which may be memory or
a Redis cache. If not, it will get the object from the database. In the
end, if the object gets from the global cache or database, it will be
set into the context cache.
An object stored in the context cache will only be destroyed after the
context disappeared.
2023-02-15 21:37:34 +08:00
|
|
|
comment.ResolveDoer = ToUser(ctx, c.ResolveDoer, nil)
|
2022-01-01 22:12:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if c.DependentIssue != nil {
|
2022-11-19 16:12:33 +08:00
|
|
|
comment.DependentIssue = ToAPIIssue(ctx, c.DependentIssue)
|
2022-01-01 22:12:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return comment
|
|
|
|
}
|