feat(vcs): extract interfaces and types from gitea/ (Phase 1) #83
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
|
|
||||||
// This file is excluded from normal builds.
|
// This file is excluded from normal builds.
|
||||||
// Run `go build -v .` inside this file to see the documented gaps between
|
// Remove the //go:build ignore tag and run `go build ./vcs/` to see the documented gaps between
|
||||||
// gitea.Client and vcs.Client that Phase 2 (Gitea adapter) must bridge.
|
// gitea.Client and vcs.Client that Phase 2 (Gitea adapter) must bridge.
|
||||||
//
|
//
|
||||||
// Known gaps (as of Phase 1):
|
// Known gaps (as of Phase 1):
|
||||||
|
|||||||
+15
-6
@@ -1,14 +1,23 @@
|
|||||||
// Package vcs defines the shared interface and types for VCS platform clients.
|
|
||||||
// Adapters (gitea, github) implement these interfaces; the core review logic
|
|
||||||
// uses them without knowing the underlying platform.
|
|
||||||
package vcs
|
package vcs
|
||||||
|
|
|||||||
|
|
||||||
|
// ReviewEvent is the event type for a pull request review action.
|
||||||
|
type ReviewEvent string
|
||||||
|
|
||||||
|
const (
|
||||||
|
// ReviewEventApprove approves the pull request.
|
||||||
|
ReviewEventApprove ReviewEvent = "APPROVED"
|
||||||
|
gpt-review-bot
commented
[MINOR] ReviewEventApprove is set to "APPROVED", which matches a review state rather than an action. If these constants represent actions to post (as implied by ReviewRequest.Event), consider using "APPROVE" to align with GitHub semantics, or clearly document that adapters must translate these abstracted values to provider-specific event strings. **[MINOR]** ReviewEventApprove is set to "APPROVED", which matches a review state rather than an action. If these constants represent actions to post (as implied by ReviewRequest.Event), consider using "APPROVE" to align with GitHub semantics, or clearly document that adapters must translate these abstracted values to provider-specific event strings.
|
|||||||
|
// ReviewEventRequestChanges requests changes to the pull request.
|
||||||
|
ReviewEventRequestChanges ReviewEvent = "REQUEST_CHANGES"
|
||||||
|
// ReviewEventComment posts a review comment without approval or rejection.
|
||||||
|
ReviewEventComment ReviewEvent = "COMMENT"
|
||||||
|
)
|
||||||
|
|
||||||
// PullRequest holds relevant PR metadata.
|
// PullRequest holds relevant PR metadata.
|
||||||
type PullRequest struct {
|
type PullRequest struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
Head struct {
|
Head struct {
|
||||||
Sha string `json:"sha"`
|
SHA string `json:"sha"`
|
||||||
Ref string `json:"ref"`
|
Ref string `json:"ref"`
|
||||||
} `json:"head"`
|
} `json:"head"`
|
||||||
}
|
}
|
||||||
@@ -56,7 +65,7 @@ type ReviewComment struct {
|
|||||||
type ReviewRequest struct {
|
type ReviewRequest struct {
|
||||||
// Body is the top-level review comment.
|
// Body is the top-level review comment.
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
// Event is "APPROVED" or "REQUEST_CHANGES".
|
// Event is the review action (approve, request changes, or comment).
|
||||||
Event string `json:"event"`
|
Event ReviewEvent `json:"event"`
|
||||||
Comments []ReviewComment `json:"comments,omitempty"`
|
Comments []ReviewComment `json:"comments,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user
[NIT] The
types.gofile is missing a package doc comment or any reference back to the main package-level documentation. Sinceinterfaces.gocarries the package doc (// Package vcs defines...), this is fine per Go convention (only one file needs the package comment), but it's worth noting the package doc lives ininterfaces.gorather than a dedicateddoc.go, which is a slightly non-idiomatic placement for packages that will grow to have many files.