Skip to content

Commit

Permalink
chore: merge multi-pipelines feature branch into main (#2298)
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Rancourt <[email protected]>
Signed-off-by: Remington Breeze <[email protected]>
Co-authored-by: Remington Breeze <[email protected]>
  • Loading branch information
krancour and rbreeze authored Jul 15, 2024
1 parent 38580b7 commit 9101f2d
Show file tree
Hide file tree
Showing 103 changed files with 16,100 additions and 5,442 deletions.
7 changes: 4 additions & 3 deletions api/service/v1alpha1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ service KargoService {
rpc DeleteFreight(DeleteFreightRequest) returns (DeleteFreightResponse);
rpc GetFreight(GetFreightRequest) returns (GetFreightResponse);
rpc PromoteToStage(PromoteToStageRequest) returns (PromoteToStageResponse);
rpc PromoteToStageSubscribers(PromoteToStageSubscribersRequest) returns (PromoteToStageSubscribersResponse);
rpc PromoteDownstream(PromoteDownstreamRequest) returns (PromoteDownstreamResponse);
rpc QueryFreight(QueryFreightRequest) returns (QueryFreightResponse);
rpc UpdateFreightAlias(UpdateFreightAliasRequest) returns (UpdateFreightAliasResponse);

Expand Down Expand Up @@ -388,14 +388,14 @@ message PromoteToStageResponse {
github.com.akuity.kargo.api.v1alpha1.Promotion promotion = 1;
}

message PromoteToStageSubscribersRequest {
message PromoteDownstreamRequest {
string project = 1;
string stage = 2;
string freight = 3;
string freight_alias = 4 [json_name = "freightAlias"];
}

message PromoteToStageSubscribersResponse {
message PromoteDownstreamResponse {
repeated github.com.akuity.kargo.api.v1alpha1.Promotion promotions = 1;
}

Expand All @@ -406,6 +406,7 @@ message QueryFreightRequest {
string group = 4;
string order_by = 5;
bool reverse = 6;
repeated string origins = 7;
}

message QueryFreightResponse {
Expand Down
12 changes: 10 additions & 2 deletions api/v1alpha1/freight_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name=Alias,type=string,JSONPath=`.metadata.labels.kargo\.akuity\.io/alias`
// +kubebuilder:printcolumn:name=Origin (Kind),type=string,JSONPath=`.origin.kind`
// +kubebuilder:printcolumn:name=Origin (Name),type=string,JSONPath=`.origin.name`
// +kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp`

// Freight represents a collection of versioned artifacts.
Expand All @@ -36,8 +38,12 @@ type Freight struct {
// required field. TODO: It is not clear yet how this field should be set in
// the case of user-defined Freight.
//
// +kubebuilder:validation:Required
// Deprecated: Use Origin instead.
Warehouse string `json:"warehouse,omitempty" protobuf:"bytes,8,opt,name=warehouse"`
// Origin describes a kind of Freight in terms of its origin.
//
// +kubebuilder:validation:Required
Origin FreightOrigin `json:"origin,omitempty" protobuf:"bytes,9,opt,name=origin"`
// Commits describes specific Git repository commits.
Commits []GitCommit `json:"commits,omitempty" protobuf:"bytes,3,rep,name=commits"`
// Images describes specific versions of specific container images.
Expand Down Expand Up @@ -103,7 +109,9 @@ func (f *Freight) GenerateID() string {
sort.Strings(artifacts)
return fmt.Sprintf(
"%x",
sha1.Sum([]byte(strings.Join(artifacts, "|"))),
sha1.Sum([]byte(
fmt.Sprintf("%s:%s", f.Origin.String(), strings.Join(artifacts, "|")),
)),
)
}

Expand Down
4 changes: 4 additions & 0 deletions api/v1alpha1/freight_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ func TestGitCommitEquals(t *testing.T) {

func TestFreightGenerateID(t *testing.T) {
freight := Freight{
Origin: FreightOrigin{
Kind: "fake-kind",
Name: "fake-name",
},
Commits: []GitCommit{
{
RepoURL: "fake-git-repo",
Expand Down
Loading

0 comments on commit 9101f2d

Please sign in to comment.