From c3a031f42d9558844eb246e2cead39acee023cf8 Mon Sep 17 00:00:00 2001 From: Pierre Gerbelot Date: Tue, 21 Nov 2023 12:24:08 +0100 Subject: [PATCH 1/2] feat: remove the double git sub-object in the helm request for values part --- .../HelmValuesGitRepositoryRequest.yaml | 26 +++++++++++++++++++ src/schemas/_index.yaml | 2 ++ src/schemas/helm/HelmRequest.yaml | 13 ++-------- 3 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 src/schemas/HelmValuesGitRepositoryRequest.yaml diff --git a/src/schemas/HelmValuesGitRepositoryRequest.yaml b/src/schemas/HelmValuesGitRepositoryRequest.yaml new file mode 100644 index 00000000..025362a2 --- /dev/null +++ b/src/schemas/HelmValuesGitRepositoryRequest.yaml @@ -0,0 +1,26 @@ +type: object +required: + - url + - branch + - paths +properties: + url: + type: string + description: application git repository URL + example: https://github.com/Qovery/simple-node-app + branch: + type: string + description: | + Name of the branch to use. This is optional + If not specified, then the branch used is the `main` or `master` one + example: feat/text_xxx + paths: + type: array + description: List of path inside your git repository to locate values file. Must start by a / + items: + type: string + git_token_id: + type: string + format: uuid + description: The git token id on Qovery side + nullable: true diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 18bbeaf4..761d1460 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -762,3 +762,5 @@ BaseJobResponse: $ref: ./job/BaseJobResponse.yaml HelmGitRepositoryRequest: $ref: ./HelmGitRepositoryRequest.yaml +HelmValuesGitRepositoryRequest: + $ref: ./HelmValuesGitRepositoryRequest.yaml diff --git a/src/schemas/helm/HelmRequest.yaml b/src/schemas/helm/HelmRequest.yaml index 14c17646..e9791797 100644 --- a/src/schemas/helm/HelmRequest.yaml +++ b/src/schemas/helm/HelmRequest.yaml @@ -103,14 +103,5 @@ allOf: content: type: string description: The content of the value file - git: - type: object - nullable: true - properties: - git_repository: - $ref: '../ApplicationGitRepositoryRequest.yaml' - paths: - type: array - description: List of path inside your git repository to locate values file. Must start by a / - items: - type: string + git_repository: + $ref: '../HelmValuesGitRepositoryRequest.yaml' From b880d7cfd3689139277ebb5f4a403c956dd61778 Mon Sep 17 00:00:00 2001 From: Pierre Gerbelot Date: Tue, 21 Nov 2023 13:23:15 +0100 Subject: [PATCH 2/2] add oneof for source in HelmRequest --- src/schemas/HelmGitRepositoryRequest.yaml | 1 - src/schemas/helm/HelmRequest.yaml | 38 ++++++++++++----------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/schemas/HelmGitRepositoryRequest.yaml b/src/schemas/HelmGitRepositoryRequest.yaml index c4e25b59..2b5b2a26 100644 --- a/src/schemas/HelmGitRepositoryRequest.yaml +++ b/src/schemas/HelmGitRepositoryRequest.yaml @@ -1,5 +1,4 @@ type: object -nullable: true required: - provider - owner diff --git a/src/schemas/helm/HelmRequest.yaml b/src/schemas/helm/HelmRequest.yaml index e9791797..a2c7d207 100644 --- a/src/schemas/helm/HelmRequest.yaml +++ b/src/schemas/helm/HelmRequest.yaml @@ -31,25 +31,27 @@ allOf: description: | Specify if the helm will be automatically updated after receiving a new image tag or a new commit according to the source type. source: - type: object - properties: - git_repository: - $ref: '../HelmGitRepositoryRequest.yaml' - helm_repository: - type: object - nullable: true + oneOf: + - type: object properties: - repository: - type: string - format: UUID - description: The id of the helm repository - nullable: true - chart_name: - type: string - description: The name of the chart in the repository - chart_version: - type: string - description: The version of the chart to use + git_repository: + $ref: '../HelmGitRepositoryRequest.yaml' + - type: object + properties: + helm_repository: + type: object + properties: + repository: + type: string + format: UUID + description: The id of the helm repository + nullable: true + chart_name: + type: string + description: The name of the chart in the repository + chart_version: + type: string + description: The version of the chart to use arguments: type: array description: The extra arguments to pass to helm