MCPcopy
hub / github.com/harness/harness / AsCodeComment

Method AsCodeComment

types/pullreq_activity.go:68–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66}
67
68func (a *PullReqActivity) AsCodeComment() *CodeComment {
69 if !a.IsValidCodeComment() {
70 return &CodeComment{}
71 }
72 return &CodeComment{
73 ID: a.ID,
74 Version: a.Version,
75 Updated: a.Updated,
76 CodeCommentFields: CodeCommentFields{
77 Outdated: a.CodeComment.Outdated,
78 MergeBaseSHA: a.CodeComment.MergeBaseSHA,
79 SourceSHA: a.CodeComment.SourceSHA,
80 Path: a.CodeComment.Path,
81 LineNew: a.CodeComment.LineNew,
82 SpanNew: a.CodeComment.SpanNew,
83 LineOld: a.CodeComment.LineOld,
84 SpanOld: a.CodeComment.SpanOld,
85 },
86 }
87}
88
89func (a *PullReqActivity) IsReplyable() bool {
90 return (a.Type == enum.PullReqActivityTypeComment || a.Type == enum.PullReqActivityTypeCodeComment) &&

Callers 2

CommentCreateMethod · 0.95

Calls 1

IsValidCodeCommentMethod · 0.95

Tested by

no test coverage detected