mirror of
https://github.com/hanzoai/cd.git
synced 2026-10-30 14:56:45 +00:00
repository.proto and 11 sibling hand-written .proto files referenced generated.proto's application/v1alpha1 types under the pre-fork package path (github.com.argoproj.argo_cd.v3...); protoc silently kept compiling because generated.proto still carried that same stale package too. Point both at the real, mechanically-derived path (github.com.hanzoai.cd.pkg.apis.application.v1alpha1, no v3 segment) and regenerate everything protoc/go-to-protobuf own: generated.proto/pb.go, every pkg/apiclient and reposerver/cmpserver/commitserver *.pb.go, assets/swagger.json, and the CRD manifests. That regeneration surfaced a second, unrelated bug: hack/gen-crd-spec stamped app.kubernetes.io/part-of: cd on the CRDs, but util/settings.isSettingsObject (and the ConfigMap informer built on it) only ever recognizes part-of=hanzocd. The same wrong "cd" value was baked into cmd/cd/commands/admin/settings.go's setSettingsMeta and the shared test/testdata.go fixtures ~30 files import — util/settings' own test suite was panicking on an empty slice because its fixture was invisible to the informer it was supposedly seeding. Fixed the label everywhere it's produced or asserted in the settings path; left the ~90 unrelated part-of:"cd" literals in other packages' local test fixtures alone since they never touch this selector. Also dropped 25 "TODO: Remove deprecated <dead upstream issue link>" comments that duplicated the real explanation already sitting one line away (a proper `Deprecated:` godoc, a cobra Deprecated field, or a nolint:staticcheck marker) — kept the explanation, dropped the link, per the standing rule for these citations. And repointed the two Grafana dashboards' job selector from argocd-server-metrics, a Service the manifests never create, to hanzocd-server-metrics, the one they do.
149 lines
4.7 KiB
Protocol Buffer
149 lines
4.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
option go_package = "github.com/hanzoai/cd/pkg/apiclient/project";
|
|
|
|
// Project Service
|
|
//
|
|
// Project Service API performs CRUD actions against project resources
|
|
package project;
|
|
|
|
import "google/api/annotations.proto";
|
|
import "github.com/hanzoai/cd/pkg/apis/application/v1alpha1/generated.proto";
|
|
import "github.com/hanzoai/cd/server/application/application.proto";
|
|
import "github.com/hanzoai/cd/server/events/events.proto";
|
|
|
|
// ProjectCreateRequest defines project creation parameters.
|
|
message ProjectCreateRequest {
|
|
github.com.hanzoai.cd.pkg.apis.application.v1alpha1.AppProject project = 1;
|
|
bool upsert = 2;
|
|
}
|
|
|
|
// ProjectTokenCreateRequest defines project token deletion parameters.
|
|
message ProjectTokenDeleteRequest {
|
|
string project = 1;
|
|
string role = 2;
|
|
int64 iat = 3;
|
|
string id = 4;
|
|
}
|
|
|
|
// ProjectTokenCreateRequest defines project token creation parameters.
|
|
message ProjectTokenCreateRequest {
|
|
string project = 1;
|
|
string description = 2;
|
|
string role = 3;
|
|
// expiresIn represents a duration in seconds
|
|
int64 expiresIn = 4;
|
|
string id = 5;
|
|
}
|
|
// ProjectTokenResponse wraps the created token or returns an empty string if deleted.
|
|
message ProjectTokenResponse {
|
|
string token = 1;
|
|
}
|
|
|
|
|
|
// ProjectQuery is a query for Project resources
|
|
message ProjectQuery {
|
|
string name = 1;
|
|
}
|
|
|
|
message ProjectUpdateRequest {
|
|
github.com.hanzoai.cd.pkg.apis.application.v1alpha1.AppProject project = 1;
|
|
}
|
|
|
|
message EmptyResponse {}
|
|
|
|
message SyncWindowsQuery {
|
|
string name = 1;
|
|
}
|
|
|
|
message SyncWindowsResponse {
|
|
repeated github.com.hanzoai.cd.pkg.apis.application.v1alpha1.SyncWindow windows = 1;
|
|
}
|
|
|
|
message GlobalProjectsResponse {
|
|
repeated github.com.hanzoai.cd.pkg.apis.application.v1alpha1.AppProject items = 1;
|
|
}
|
|
|
|
message DetailedProjectsResponse {
|
|
repeated github.com.hanzoai.cd.pkg.apis.application.v1alpha1.AppProject globalProjects = 1;
|
|
github.com.hanzoai.cd.pkg.apis.application.v1alpha1.AppProject project = 2;
|
|
repeated github.com.hanzoai.cd.pkg.apis.application.v1alpha1.Repository repositories = 3;
|
|
repeated github.com.hanzoai.cd.pkg.apis.application.v1alpha1.Cluster clusters = 4;
|
|
}
|
|
|
|
message ListProjectLinksRequest {
|
|
string name = 1;
|
|
}
|
|
|
|
// ProjectService
|
|
service ProjectService {
|
|
|
|
// Create a new project token
|
|
rpc CreateToken(ProjectTokenCreateRequest) returns (ProjectTokenResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/projects/{project}/roles/{role}/token"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
// Delete a new project token
|
|
rpc DeleteToken(ProjectTokenDeleteRequest) returns (EmptyResponse) {
|
|
option (google.api.http).delete = "/v1/projects/{project}/roles/{role}/token/{iat}";
|
|
}
|
|
|
|
// Create a new project
|
|
rpc Create(ProjectCreateRequest) returns (github.com.hanzoai.cd.pkg.apis.application.v1alpha1.AppProject) {
|
|
option (google.api.http) = {
|
|
post: "/v1/projects"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
// List returns list of projects
|
|
rpc List(ProjectQuery) returns (github.com.hanzoai.cd.pkg.apis.application.v1alpha1.AppProjectList) {
|
|
option (google.api.http).get = "/v1/projects";
|
|
}
|
|
|
|
// GetDetailedProject returns a project that include project, global project and scoped resources by name
|
|
rpc GetDetailedProject(ProjectQuery) returns (DetailedProjectsResponse) {
|
|
option (google.api.http).get = "/v1/projects/{name}/detailed";
|
|
}
|
|
|
|
// Get returns a project by name
|
|
rpc Get(ProjectQuery) returns (github.com.hanzoai.cd.pkg.apis.application.v1alpha1.AppProject) {
|
|
option (google.api.http).get = "/v1/projects/{name}";
|
|
}
|
|
|
|
// Get returns a virtual project by name
|
|
rpc GetGlobalProjects(ProjectQuery) returns (GlobalProjectsResponse) {
|
|
option (google.api.http).get = "/v1/projects/{name}/globalprojects";
|
|
}
|
|
|
|
// Update updates a project
|
|
rpc Update(ProjectUpdateRequest) returns (github.com.hanzoai.cd.pkg.apis.application.v1alpha1.AppProject) {
|
|
option (google.api.http) = {
|
|
put: "/v1/projects/{project.metadata.name}"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
// Delete deletes a project
|
|
rpc Delete(ProjectQuery) returns (EmptyResponse) {
|
|
option (google.api.http).delete = "/v1/projects/{name}";
|
|
}
|
|
|
|
// ListEvents returns a list of project events
|
|
rpc ListEvents(ProjectQuery) returns (events.EventList) {
|
|
option (google.api.http).get = "/v1/projects/{name}/events";
|
|
}
|
|
|
|
// GetSchedulesState returns true if there are any active sync syncWindows
|
|
rpc GetSyncWindowsState(SyncWindowsQuery) returns (SyncWindowsResponse) {
|
|
option (google.api.http).get = "/v1/projects/{name}/syncwindows";
|
|
}
|
|
|
|
// ListLinks returns all deep links for the particular project
|
|
rpc ListLinks(ListProjectLinksRequest) returns (application.LinksResponse) {
|
|
option (google.api.http).get = "/v1/projects/{name}/links";
|
|
}
|
|
|
|
} |