From faa69c73ac370c16226270fcf81b39a97472d48c Mon Sep 17 00:00:00 2001 From: Daniel <69415974+daniel-codefresh@users.noreply.github.com> Date: Wed, 5 Jan 2022 18:49:03 +0200 Subject: [PATCH] Modified deprecated projectID field of Gitlab Eventsource to be optional (#1500) * modified deprecated projectID field of gitlab eventsource to be optional Signed-off-by: Daniel Soifer * modified deprecated projectID field of gitlab eventsource to be optional Signed-off-by: Daniel Soifer * fix: Modified deprecated projectID field of gitlab eventsource to be optional Signed-off-by: Daniel Soifer * codegen Signed-off-by: Daniel Soifer --- api/event-source.html | 1 + api/event-source.md | 1 + api/jsonschema/schema.json | 1 - api/openapi-spec/swagger.json | 1 - pkg/apis/eventsource/v1alpha1/generated.proto | 1 + pkg/apis/eventsource/v1alpha1/openapi_generated.go | 3 +-- pkg/apis/eventsource/v1alpha1/types.go | 3 ++- 7 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/event-source.html b/api/event-source.html index 987377e1c1..2f69552854 100644 --- a/api/event-source.html +++ b/api/event-source.html @@ -2594,6 +2594,7 @@

GitlabEventSource +(Optional)

DeprecatedProjectID is the id of project for which integration needs to setup Deprecated: use Projects instead. Will be unsupported in v 1.7

diff --git a/api/event-source.md b/api/event-source.md index 01c453c72e..086eda7f7e 100644 --- a/api/event-source.md +++ b/api/event-source.md @@ -2676,6 +2676,7 @@ Webhook holds configuration to run a http server projectID
string +(Optional)

DeprecatedProjectID is the id of project for which integration needs to setup Deprecated: use Projects instead. Will be unsupported in v 1.7 diff --git a/api/jsonschema/schema.json b/api/jsonschema/schema.json index 96f88acba5..ba4f443d1a 100644 --- a/api/jsonschema/schema.json +++ b/api/jsonschema/schema.json @@ -1499,7 +1499,6 @@ } }, "required": [ - "projectID", "events", "gitlabBaseURL" ], diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 27f085e15d..73bab0fe3f 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -1432,7 +1432,6 @@ "description": "GitlabEventSource refers to event-source related to Gitlab events", "type": "object", "required": [ - "projectID", "events", "gitlabBaseURL" ], diff --git a/pkg/apis/eventsource/v1alpha1/generated.proto b/pkg/apis/eventsource/v1alpha1/generated.proto index 803faf6aed..0ca00b2ea8 100644 --- a/pkg/apis/eventsource/v1alpha1/generated.proto +++ b/pkg/apis/eventsource/v1alpha1/generated.proto @@ -618,6 +618,7 @@ message GitlabEventSource { // DeprecatedProjectID is the id of project for which integration needs to setup // Deprecated: use Projects instead. Will be unsupported in v 1.7 + // +optional optional string projectID = 2; // Events are gitlab event to listen to. diff --git a/pkg/apis/eventsource/v1alpha1/openapi_generated.go b/pkg/apis/eventsource/v1alpha1/openapi_generated.go index 31c0816c6f..6fbe93427c 100644 --- a/pkg/apis/eventsource/v1alpha1/openapi_generated.go +++ b/pkg/apis/eventsource/v1alpha1/openapi_generated.go @@ -1801,7 +1801,6 @@ func schema_pkg_apis_eventsource_v1alpha1_GitlabEventSource(ref common.Reference "projectID": { SchemaProps: spec.SchemaProps{ Description: "DeprecatedProjectID is the id of project for which integration needs to setup Deprecated: use Projects instead. Will be unsupported in v 1.7", - Default: "", Type: []string{"string"}, Format: "", }, @@ -1887,7 +1886,7 @@ func schema_pkg_apis_eventsource_v1alpha1_GitlabEventSource(ref common.Reference }, }, }, - Required: []string{"projectID", "events", "gitlabBaseURL"}, + Required: []string{"events", "gitlabBaseURL"}, }, }, Dependencies: []string{ diff --git a/pkg/apis/eventsource/v1alpha1/types.go b/pkg/apis/eventsource/v1alpha1/types.go index 928a383af3..6191b4f867 100644 --- a/pkg/apis/eventsource/v1alpha1/types.go +++ b/pkg/apis/eventsource/v1alpha1/types.go @@ -763,7 +763,8 @@ type GitlabEventSource struct { Webhook *WebhookContext `json:"webhook,omitempty" protobuf:"bytes,1,opt,name=webhook"` // DeprecatedProjectID is the id of project for which integration needs to setup // Deprecated: use Projects instead. Will be unsupported in v 1.7 - DeprecatedProjectID string `json:"projectID" protobuf:"bytes,2,opt,name=projectID"` + // +optional + DeprecatedProjectID string `json:"projectID,omitempty" protobuf:"bytes,2,opt,name=projectID"` // Events are gitlab event to listen to. // Refer https://github.com/xanzy/go-gitlab/blob/bf34eca5d13a9f4c3f501d8a97b8ac226d55e4d9/projects.go#L794. Events []string `json:"events" protobuf:"bytes,3,opt,name=events"`