Add resolve and reply support
This commit is contained in:
20
cache.go
20
cache.go
@@ -118,6 +118,26 @@ func (c *CachedGitHubService) LivePullRequest(
|
||||
return details, nil
|
||||
}
|
||||
|
||||
func (c *CachedGitHubService) SetThreadResolved(
|
||||
ctx context.Context, threadID string, resolved bool,
|
||||
) (ReviewThread, error) {
|
||||
writer, ok := c.remote.(GitHubWriteService)
|
||||
if !ok {
|
||||
return ReviewThread{}, errors.New("GitHub service does not support write actions")
|
||||
}
|
||||
return writer.SetThreadResolved(ctx, threadID, resolved)
|
||||
}
|
||||
|
||||
func (c *CachedGitHubService) ReplyToThread(
|
||||
ctx context.Context, threadID, body string,
|
||||
) (ReviewComment, error) {
|
||||
writer, ok := c.remote.(GitHubWriteService)
|
||||
if !ok {
|
||||
return ReviewComment{}, errors.New("GitHub service does not support write actions")
|
||||
}
|
||||
return writer.ReplyToThread(ctx, threadID, body)
|
||||
}
|
||||
|
||||
func (c *CachedGitHubService) pullRequestsKey(owner, repo string, limit int, showAll bool) string {
|
||||
return fmt.Sprintf("prs:%s/%s:%d:%t", owner, repo, limit, showAll)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user