mirror of
https://github.com/hanzoai/cd.git
synced 2026-10-30 14:56:45 +00:00
Drops the Argo/ArgoCD prefix from our own const, type and field names (ArgoCDConfigMapName -> ConfigMapName, ArgoCDSettings -> Settings, ArgoCDServer -> Server, HeaderArgoCD* -> HeaderCD*, the argocd-manager RBAC names, the CLI-facing Env* aliases, and the three separately scoped ArgoCDNamespace test/CLI defaults) and reflows the surrounding comments and log/help text from Argo CD to Hanzo CD. Runtime string values are untouched (still hanzocd-*, argo-cd-cli, argo-cd, etc.) — renaming those is a live ConfigMap/Secret/service-name and OAuth-client-ID change that has to land with the manifests and Hanzo IAM/dex registration together, not silently inside a naming pass. argoproj.io, other real upstream API groups, GitHub issue/PR citations, and external URLs are untouched throughout. Verified with go build ./... and go vet ./... (both clean); go test ./util/... ./controller/... ./server/... has the identical 26/26 pre-existing failing packages before and after (root cause: an unrelated redis-removal regression, not this change — see report).
39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package commitserver
|
|
|
|
import (
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/grpc/health"
|
|
"google.golang.org/grpc/health/grpc_health_v1"
|
|
|
|
"github.com/hanzoai/cd/commitserver/apiclient"
|
|
"github.com/hanzoai/cd/commitserver/commit"
|
|
"github.com/hanzoai/cd/commitserver/metrics"
|
|
versionpkg "github.com/hanzoai/cd/pkg/apiclient/version"
|
|
"github.com/hanzoai/cd/server/version"
|
|
"github.com/hanzoai/cd/util/git"
|
|
)
|
|
|
|
// Server is the server that handles commit requests.
|
|
type Server struct {
|
|
commitService *commit.Service
|
|
}
|
|
|
|
// NewServer returns a new instance of the commit server.
|
|
func NewServer(gitCredsStore git.CredsStore, metricsServer *metrics.Server) *Server {
|
|
return &Server{commitService: commit.NewService(gitCredsStore, metricsServer)}
|
|
}
|
|
|
|
// CreateGRPC creates a new gRPC server.
|
|
func (a *Server) CreateGRPC() *grpc.Server {
|
|
server := grpc.NewServer(grpc.MaxRecvMsgSize(apiclient.MaxGRPCMessageSize))
|
|
versionpkg.RegisterVersionServiceServer(server, version.NewServer(nil, func() (bool, error) {
|
|
return true, nil
|
|
}))
|
|
apiclient.RegisterCommitServiceServer(server, a.commitService)
|
|
|
|
healthService := health.NewServer()
|
|
grpc_health_v1.RegisterHealthServer(server, healthService)
|
|
|
|
return server
|
|
}
|