Documentation
¶
Index ¶
Constants ¶
View Source
const ( JobTypeGitHubCommentSync = "github_comment_sync" JobTypeGitHubProcessCommentLLM = "github_process_comment_llm" JobTypeGitHubCodeReview = "github_code_review" DefaultLeaseDuration = 30 * time.Second )
Variables ¶
View Source
var ( ErrInvalidGitHubConfig = errors.New("invalid GitHub configuration") ErrGitHubAPIError = errors.New("GitHub API error") )
Functions ¶
This section is empty.
Types ¶
type GitHubCodeReviewProcessor ¶
type GitHubCodeReviewProcessor struct {
// contains filtered or unexported fields
}
func NewGitHubCodeReviewProcessor ¶
func NewGitHubCodeReviewProcessor( db libdb.DBManager, env execservice.TasksEnvService, githubClient githubclient.Client, chatManager *chat.Manager, tracker activitytracker.ActivityTracker, ) *GitHubCodeReviewProcessor
func (*GitHubCodeReviewProcessor) ProcessJob ¶
type GitHubCommentProcessor ¶
type GitHubCommentProcessor struct {
// contains filtered or unexported fields
}
func NewGitHubCommentProcessor ¶
func NewGitHubCommentProcessor(db libdb.DBManager, env execservice.TasksEnvService, githubClient githubclient.Client, chatManager *chat.Manager, tracker activitytracker.ActivityTracker) *GitHubCommentProcessor
func (*GitHubCommentProcessor) ProcessJob ¶
type GithubMessage ¶
type MessagePayload ¶
type MessagePayload struct {
// "repo_id": repoID,
// "pr_number": prNumber,
// "comment_id": commentID,
// "user_name": userName,
// "content": content,
// "sent_at": sendAt,
RepoID string `json:"repoID"`
PRNumber int `json:"prNumber"`
CommentID string `json:"commentID"`
UserName string `json:"userName"`
chatservice.ChatMessage
}
// TODO add type and fix missing role.
{
"role": "",
"content": "this is a test message to ping the bot",
"sentAt": "2025-07-27T08:47:01Z",
"isUser": false,
"isLatest": false
}
Store message with full context
type PullRequest ¶
type PullRequest struct {
ID int64 `json:"id"`
Number int `json:"number"`
Title string `json:"title"`
State string `json:"state"`
URL string `json:"url"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
AuthorLogin string `json:"authorLogin"`
ClosedAt *time.Time `json:"closedAt,omitempty"`
MergedAt *time.Time `json:"mergedAt,omitempty"`
}
type PullRequestDetails ¶
type PullRequestDetails struct {
PullRequest *github.PullRequest
ChangedFiles []*github.CommitFile
IssueComments []*github.IssueComment
Reviews []*github.PullRequestReview
}
type Service ¶
type Service interface {
serverops.ServiceMeta
ConnectRepo(ctx context.Context, userID, owner, repoName, accessToken string, botUserName string) (*store.GitHubRepo, error)
ListPRs(ctx context.Context, repoID string) ([]*githubclient.PullRequest, error)
ListRepos(ctx context.Context) ([]*store.GitHubRepo, error)
DisconnectRepo(ctx context.Context, repoID string) error
PR(ctx context.Context, repoID string, prNumber int) (*PullRequestDetails, error)
ListComments(ctx context.Context, repoID string, prNumber int, since time.Time) ([]*github.IssueComment, error)
PostComment(ctx context.Context, repoID string, prNumber int, comment string) error
}
func WithActivityTracker ¶
func WithActivityTracker(service Service, tracker activitytracker.ActivityTracker) Service
New decorator factory
type Worker ¶
type Worker interface {
ReceiveTick(ctx context.Context) error
ProcessTick(ctx context.Context) error
serverops.ServiceMeta
}
func NewWorker ¶
func NewWorker( githubClient githubclient.Client, kvManager libkv.KVManager, tracker activitytracker.ActivityTracker, dbInstance libdb.DBManager, bootLastSyncTime time.Time, ) Worker
Click to show internal directories.
Click to hide internal directories.