ac6d34f5bd
PR Ready Gate / clear-labels (pull_request) Successful in 2s
CI / test (pull_request) Successful in 19s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 56s
CI / review (gpt-5, security, ., rodin/security-patterns, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m51s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 2m21s
- Introduce vcs.VCSProvider typed constant (replaces plain string provider) - Introduce vcs.ReviewSuperseder optional interface for supersede logic - Implement SupersedeReviews on gitea.Adapter (edit + resolve) and github.Client (dismiss) - Remove concrete type assertion client.(*gitea.Adapter) from main - Remove redundant baseURL fallback for github (NewClient defaults it) - Condense --gitea-url alias comment block - Fix fetchPatterns comment (empty paths are skipped, not fetched) - Add default panic to VCS client init switch Addresses: #19607, #19608, #19609, #19610, #19621, #19622, #19623
27 lines
615 B
Go
27 lines
615 B
Go
package vcs
|
|
|
|
// VCSProvider identifies a VCS platform. Using a typed string instead of bare
|
|
// strings makes provider values compiler-checkable and prevents typos from
|
|
// silently passing validation.
|
|
type VCSProvider string
|
|
|
|
const (
|
|
ProviderGitea VCSProvider = "gitea"
|
|
ProviderGithub VCSProvider = "github"
|
|
)
|
|
|
|
// Valid reports whether p is a known VCS provider.
|
|
func (p VCSProvider) Valid() bool {
|
|
switch p {
|
|
case ProviderGitea, ProviderGithub:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// String returns the string representation of the provider.
|
|
func (p VCSProvider) String() string {
|
|
return string(p)
|
|
}
|