feat(#130): add VCS routing in cmd/review-bot via --vcs-type flag
CI / test (pull_request) Successful in 18s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 41s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 1m20s
CI / review (gpt-5, security, ., rodin/security-patterns, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m52s
CI / test (pull_request) Successful in 18s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 41s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 1m20s
CI / review (gpt-5, security, ., rodin/security-patterns, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m52s
- Add vcs_client.go with vcsClient interface, giteaClientVCSAdapter, githubClientVCSAdapter - Add giteaExtendedClient interface for Gitea-specific operations (supersede, resolve, etc.) - Add --vcs-type flag (gitea|github, default: gitea) with VCS_TYPE env var support - Replace direct giteaClient usage with vcsClient interface in main.go - Add verdictToVCSEvent() to map LLM verdict to vcs.ReviewEvent - Gitea adapter translates vcs.ReviewEvent back to Gitea API format (APPROVE->APPROVED) - Guard Gitea-specific ops (RequestReviewer, supersede, resolve) with type assertion - Guard fetchPatterns GetAllFilesInPath with Gitea-only type assertion - Replace reviewClientAdapter (giteaClientAdapter) for review.GiteaClient interface - Update main_test.go to use reviewInfo/commitStatusInfo instead of gitea types
This commit is contained in:
+5
-5
@@ -90,13 +90,13 @@ func (c *Client) PostReview(ctx context.Context, owner, repo string, number int,
|
||||
c.baseURL, url.PathEscape(owner), url.PathEscape(repo), number)
|
||||
|
||||
payload := postReviewRequest{
|
||||
Body: req.Body,
|
||||
Event: string(req.Event),
|
||||
Body: req.Body,
|
||||
Event: string(req.Event),
|
||||
CommitID: req.CommitID,
|
||||
}
|
||||
|
||||
// Build the payload in one pass. The GitHub API accepts a single commit_id
|
||||
// per review; we extract it from the first comment that supplies one and
|
||||
// reject the request if any other comment disagrees.
|
||||
// Build the comments in one pass. Inline comment CommitIDs must match the
|
||||
// review-level CommitID; reject if any disagree.
|
||||
for _, comment := range req.Comments {
|
||||
if comment.CommitID != "" {
|
||||
if payload.CommitID == "" {
|
||||
|
||||
Reference in New Issue
Block a user