Make dashboard updateable
This commit is contained in:
22
cache.go
22
cache.go
@@ -138,6 +138,28 @@ func (c *CachedGitHubService) ReplyToThread(
|
||||
return writer.ReplyToThread(ctx, threadID, body)
|
||||
}
|
||||
|
||||
func (c *CachedGitHubService) UpdatePullRequest(
|
||||
ctx context.Context,
|
||||
pullRequestID string,
|
||||
update PullRequestMetadata,
|
||||
) (PullRequestMetadata, error) {
|
||||
writer, ok := c.remote.(GitHubPullRequestWriteService)
|
||||
if !ok {
|
||||
return PullRequestMetadata{}, errors.New("GitHub service does not support pull request updates")
|
||||
}
|
||||
return writer.UpdatePullRequest(ctx, pullRequestID, update)
|
||||
}
|
||||
|
||||
func (c *CachedGitHubService) ListBranches(
|
||||
ctx context.Context, owner, repo string,
|
||||
) ([]RepositoryBranch, error) {
|
||||
service, ok := c.remote.(GitHubBranchService)
|
||||
if !ok {
|
||||
return nil, errors.New("GitHub service does not support listing branches")
|
||||
}
|
||||
return service.ListBranches(ctx, owner, repo)
|
||||
}
|
||||
|
||||
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