Skip to content

Commit

Permalink
Merge branch 'main' into hoon/stage-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
devholic authored Aug 1, 2023
2 parents 78066a0 + 445dc83 commit bce8543
Show file tree
Hide file tree
Showing 77 changed files with 8,450 additions and 27,722 deletions.
10 changes: 7 additions & 3 deletions .github/governance.yaml → .github/governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ issue:
list:
- feat
- bug
multiple: false
- refactor
- enhancement
multiple: true
needs: true

- prefix: priority
Expand All @@ -22,16 +24,18 @@ issue:
- prefix: area
list:
# generic areas
- bug
- chore
- planning
- devx
- docs
- documentation
- perf
- regression
- security
- tech-debt
- test
- ux
- ci-process
- release-process
# kargo component areas
- api
- charts
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ jobs:
run: go install github.com/bufbuild/buf/cmd/[email protected]
- name: Install controller-gen
run: go install sigs.k8s.io/controller-tools/cmd/[email protected]
- name: Install go-to-protobuf
run: |
go install k8s.io/code-generator/cmd/[email protected]
go install k8s.io/code-generator/cmd/go-to-protobuf/[email protected]
- name: Run Codegen
run: make codegen
- name: Git stuff
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: BirthdayResearch/oss-governance-bot@v3
with:
config-path: .github/governance.yml
3 changes: 0 additions & 3 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ ARG TARGETARCH
ARG BUF_VERSION=v1.15.1
ARG CONTROLLER_GEN_VERSION=v0.11.3
ARG GOLANGCI_LINT_VERSION=1.51.2
ARG GO_TO_PROTOBUF_VERSION=v0.27.1
ARG HELM_VERSION=v3.10.0

RUN go install github.com/bufbuild/buf/cmd/buf@${BUF_VERSION} \
&& go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION} \
&& go install k8s.io/code-generator/cmd/go-to-protobuf@${GO_TO_PROTOBUF_VERSION} \
&& go install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo@${GO_TO_PROTOBUF_VERSION} \
&& cd /usr/local/bin \
&& curl -sSfL https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-${TARGETARCH}.tar.gz \
| tar xvz golangci-lint-${GOLANGCI_LINT_VERSION}-linux-${TARGETARCH}/golangci-lint --strip-components=1 \
Expand Down
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ lint-go:

.PHONY: lint-proto
lint-proto:
go mod vendor
buf lint api --error-format=$(BUF_LINT_ERROR_FORMAT)

.PHONY: lint-charts
Expand Down Expand Up @@ -56,12 +55,7 @@ test-unit:

.PHONY: codegen
codegen:
go mod vendor
./hack/generate-proto.sh
buf generate api
./hack/api/apply-patches.sh
go mod tidy
rm -rf ./vendor
controller-gen \
rbac:roleName=manager-role \
crd \
Expand Down
11 changes: 11 additions & 0 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ k8s_resource(
]
)

k8s_resource(
workload = 'kargo-garbage-collector',
new_name = 'garbage-collector',
labels = ['kargo'],
objects = [
'kargo-garbage-collector:clusterrole',
'kargo-garbage-collector:clusterrolebinding',
'kargo-garbage-collector:serviceaccount'
]
)

k8s_resource(
workload = 'kargo-webhooks-server',
new_name = 'webhooks-server',
Expand Down
5 changes: 3 additions & 2 deletions api/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ lint:
- DEFAULT
except:
- PACKAGE_DIRECTORY_MATCH
ignore:
- v1alpha1/generated.proto
ignore_only:
PACKAGE_VERSION_SUFFIX:
- metav1/types.proto
breaking:
use:
- FILE
55 changes: 55 additions & 0 deletions api/metav1/types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
syntax = "proto3";

package github.com.akuity.kargo.pkg.api.metav1;

import "google/protobuf/timestamp.proto";

option go_package = "github.com/akuity/kargo/pkg/api/metav1";

message FieldsV1 {
optional bytes raw = 1;
}

message OwnerReference {
optional string api_version = 5;
optional string kind = 1;
optional string name = 3;
optional string uid = 4;
optional bool controller = 6;
optional bool block_owner_deletion = 7;
}

message ManagedFieldsEntry {
optional string manager = 1;
optional string operation = 2;
optional string api_version = 3;
optional google.protobuf.Timestamp time = 4;
optional string fields_type = 6;
optional FieldsV1 fields_v1 = 7;
optional string subresource = 8;
}

message ObjectMeta {
optional string name = 1;
optional string generate_name = 2;
optional string namespace = 3;
optional string self_link = 4;
optional string uid = 5;
optional string resource_version = 6;
optional int64 generation = 7;
optional google.protobuf.Timestamp creation_timestamp = 8;
optional google.protobuf.Timestamp deletion_timestamp = 9;
optional int64 deletion_grace_period_seconds = 10;
map<string, string> labels = 11;
map<string, string> annotations = 12;
repeated OwnerReference owner_references = 13;
repeated string finalizers = 14;
repeated ManagedFieldsEntry managed_fields = 17;
}

message ListMeta {
optional string self_link = 1;
optional string resource_version = 2;
optional string continue = 3;
optional int64 remaining_item_count = 4;
}
63 changes: 62 additions & 1 deletion api/service/v1alpha1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "google/protobuf/timestamp.proto";

option go_package = "github.com/akuity/kargo/pkg/api/service/v1alpha1;svcv1alpha1";

import "v1alpha1/generated.proto";
import "v1alpha1/types.proto";

service KargoService {
rpc CreateStage(CreateStageRequest) returns (CreateStageResponse);
Expand All @@ -16,6 +16,12 @@ service KargoService {
rpc DeleteStage(DeleteStageRequest) returns (DeleteStageResponse);
rpc PromoteStage(PromoteStageRequest) returns (PromoteStageResponse);

rpc CreatePromotionPolicy(CreatePromotionPolicyRequest) returns (CreatePromotionPolicyResponse);
rpc ListPromotionPolicies(ListPromotionPoliciesRequest) returns (ListPromotionPoliciesResponse);
rpc GetPromotionPolicy(GetPromotionPolicyRequest) returns (GetPromotionPolicyResponse);
rpc UpdatePromotionPolicy(UpdatePromotionPolicyRequest) returns (UpdatePromotionPolicyResponse);
rpc DeletePromotionPolicy(DeletePromotionPolicyRequest) returns (DeletePromotionPolicyResponse);

rpc CreateProject(CreateProjectRequest) returns (CreateProjectResponse);
rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse);
rpc DeleteProject(DeleteProjectRequest) returns (DeleteProjectResponse);
Expand Down Expand Up @@ -85,6 +91,61 @@ message PromoteStageResponse {
github.com.akuity.kargo.pkg.api.v1alpha1.Promotion promotion = 1;
}

message TypedPromotionPolicySpec {
string project = 1;
string name = 2;
string stage = 3;
bool enable_auto_promotion = 4;
}

message CreatePromotionPolicyRequest {
oneof promotion_policy {
TypedPromotionPolicySpec typed = 1;
string yaml = 2;
}
}

message CreatePromotionPolicyResponse {
github.com.akuity.kargo.pkg.api.v1alpha1.PromotionPolicy promotion_policy = 1;
}

message ListPromotionPoliciesRequest {
string project = 1;
}

message ListPromotionPoliciesResponse {
repeated github.com.akuity.kargo.pkg.api.v1alpha1.PromotionPolicy promotion_policies = 1;
}

message GetPromotionPolicyRequest {
string project = 1;
string name = 2;
}

message GetPromotionPolicyResponse {
github.com.akuity.kargo.pkg.api.v1alpha1.PromotionPolicy promotion_policy = 1;
}

message UpdatePromotionPolicyRequest {
oneof promotion_policy {
TypedPromotionPolicySpec typed = 1;
string yaml = 2;
}
}

message UpdatePromotionPolicyResponse {
github.com.akuity.kargo.pkg.api.v1alpha1.PromotionPolicy promotion_policy = 1;
}

message DeletePromotionPolicyRequest {
string project = 1;
string name = 2;
}

message DeletePromotionPolicyResponse {
/* explicitly empty */
}

message Project {
string name = 1;
google.protobuf.Timestamp create_time = 2;
Expand Down
Loading

0 comments on commit bce8543

Please sign in to comment.