From 9fc889f5f6df6bae551cd73b6f629f90f005f2f0 Mon Sep 17 00:00:00 2001 From: sam boyer Date: Thu, 9 Jun 2022 02:48:27 -0400 Subject: [PATCH] ci: Depend on init-enterprise for gen-cue verify (#50191) --- .drone.yml | 170 +++++++++++++++++++-------- scripts/drone/pipelines/main.star | 3 +- scripts/drone/pipelines/pr.star | 3 +- scripts/drone/pipelines/release.star | 4 +- scripts/drone/steps/lib.star | 3 + 5 files changed, 130 insertions(+), 53 deletions(-) diff --git a/.drone.yml b/.drone.yml index 758076b73af..afd93a2702e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -94,8 +94,18 @@ steps: - grabpl image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - make gen-go + depends_on: + - verify-gen-cue image: grafana/build-container:1.5.5 name: wire-install - commands: @@ -188,8 +198,18 @@ steps: - grabpl image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - make gen-go + depends_on: + - verify-gen-cue image: grafana/build-container:1.5.5 name: wire-install - commands: @@ -245,14 +265,6 @@ steps: environment: null image: grafana/build-container:1.5.5 name: build-plugins -- commands: - - '# It is required that code generated from Thema/CUE be committed and in sync - with its inputs.' - - '# The following command will fail if running code generators produces any diff - in output.' - - CODEGEN_VERIFY=1 make gen-cue - image: grafana/build-container:1.5.5 - name: verify-gen-cue - commands: - . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --variants linux-amd64,linux-amd64-musl,darwin-amd64,windows-amd64,armv6 @@ -753,8 +765,18 @@ steps: - grabpl image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - make gen-go + depends_on: + - verify-gen-cue image: grafana/build-container:1.5.5 name: wire-install - commands: @@ -837,8 +859,18 @@ steps: - grabpl image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - make gen-go + depends_on: + - verify-gen-cue image: grafana/build-container:1.5.5 name: wire-install - commands: @@ -921,14 +953,6 @@ steps: from_secret: grafana_api_key image: grafana/build-container:1.5.5 name: build-plugins -- commands: - - '# It is required that code generated from Thema/CUE be committed and in sync - with its inputs.' - - '# The following command will fail if running code generators produces any diff - in output.' - - CODEGEN_VERIFY=1 make gen-cue - image: grafana/build-container:1.5.5 - name: verify-gen-cue - commands: - ./bin/grabpl package --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --sign depends_on: @@ -1505,8 +1529,18 @@ steps: - grabpl image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - make gen-go + depends_on: + - verify-gen-cue image: grafana/build-container:1.5.5 name: wire-install - commands: @@ -1550,14 +1584,6 @@ steps: from_secret: grafana_api_key image: grafana/build-container:1.5.5 name: build-plugins -- commands: - - '# It is required that code generated from Thema/CUE be committed and in sync - with its inputs.' - - '# The following command will fail if running code generators produces any diff - in output.' - - CODEGEN_VERIFY=1 make gen-cue - image: grafana/build-container:1.5.5 - name: verify-gen-cue - commands: - ./bin/grabpl package --jobs 8 --edition oss --sign ${DRONE_TAG} depends_on: @@ -1800,8 +1826,18 @@ steps: - grabpl image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - make gen-go + depends_on: + - verify-gen-cue image: grafana/build-container:1.5.5 name: wire-install - commands: @@ -2101,6 +2137,16 @@ steps: - init-enterprise image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + depends_on: + - init-enterprise + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - ./bin/grabpl build-backend --jobs 8 --edition enterprise ${DRONE_TAG} depends_on: @@ -2136,14 +2182,6 @@ steps: from_secret: grafana_api_key image: grafana/build-container:1.5.5 name: build-plugins -- commands: - - '# It is required that code generated from Thema/CUE be committed and in sync - with its inputs.' - - '# The following command will fail if running code generators produces any diff - in output.' - - CODEGEN_VERIFY=1 make gen-cue - image: grafana/build-container:1.5.5 - name: verify-gen-cue - commands: - ./bin/grabpl build-backend --jobs 8 --edition enterprise2 ${DRONE_TAG} depends_on: @@ -2447,6 +2485,16 @@ steps: - init-enterprise image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + depends_on: + - init-enterprise + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - |- echo -e "unknwon @@ -3293,8 +3341,18 @@ steps: - grabpl image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - make gen-go + depends_on: + - verify-gen-cue image: grafana/build-container:1.5.5 name: wire-install - commands: @@ -3338,14 +3396,6 @@ steps: from_secret: grafana_api_key image: grafana/build-container:1.5.5 name: build-plugins -- commands: - - '# It is required that code generated from Thema/CUE be committed and in sync - with its inputs.' - - '# The following command will fail if running code generators produces any diff - in output.' - - CODEGEN_VERIFY=1 make gen-cue - image: grafana/build-container:1.5.5 - name: verify-gen-cue - commands: - ./bin/grabpl package --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --sign depends_on: @@ -3558,8 +3608,18 @@ steps: - grabpl image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - make gen-go + depends_on: + - verify-gen-cue image: grafana/build-container:1.5.5 name: wire-install - commands: @@ -3833,6 +3893,16 @@ steps: - init-enterprise image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + depends_on: + - init-enterprise + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - ./bin/grabpl build-backend --jobs 8 --edition enterprise --build-id ${DRONE_BUILD_NUMBER} depends_on: @@ -3869,14 +3939,6 @@ steps: from_secret: grafana_api_key image: grafana/build-container:1.5.5 name: build-plugins -- commands: - - '# It is required that code generated from Thema/CUE be committed and in sync - with its inputs.' - - '# The following command will fail if running code generators produces any diff - in output.' - - CODEGEN_VERIFY=1 make gen-cue - image: grafana/build-container:1.5.5 - name: verify-gen-cue - commands: - ./bin/grabpl build-backend --jobs 8 --edition enterprise2 --build-id ${DRONE_BUILD_NUMBER} --variants linux-amd64 @@ -4177,6 +4239,16 @@ steps: - init-enterprise image: grafana/build-container:1.5.5 name: gen-version +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - CODEGEN_VERIFY=1 make gen-cue + depends_on: + - init-enterprise + image: grafana/build-container:1.5.5 + name: verify-gen-cue - commands: - |- echo -e "unknwon @@ -4611,6 +4683,6 @@ kind: secret name: gcp_upload_artifacts_key --- kind: signature -hmac: d2e97d6683c33ccb2dba773e3c103105227a74448fa732124e4c38d67eb464d8 +hmac: 378147a306d077b0566f5353c9e5c236c40dbb8d81392091a1346ed275b86496 ... diff --git a/scripts/drone/pipelines/main.star b/scripts/drone/pipelines/main.star index 6f82f18a47f..a5fa215904b 100644 --- a/scripts/drone/pipelines/main.star +++ b/scripts/drone/pipelines/main.star @@ -93,6 +93,7 @@ def main_test_backend(): identify_runner_step(), download_grabpl_step(), gen_version_step(ver_mode), + verify_gen_cue_step(), wire_install_step(), ] test_steps = [ @@ -113,6 +114,7 @@ def get_steps(edition): identify_runner_step(), download_grabpl_step(), gen_version_step(ver_mode), + verify_gen_cue_step(), wire_install_step(), yarn_install_step(), ] @@ -123,7 +125,6 @@ def get_steps(edition): build_frontend_step(edition=edition, ver_mode=ver_mode), build_frontend_package_step(edition=edition, ver_mode=ver_mode), build_plugins_step(edition=edition, sign=True), - verify_gen_cue_step(), ] integration_test_steps = [ postgres_integration_tests_step(edition=edition, ver_mode=ver_mode), diff --git a/scripts/drone/pipelines/pr.star b/scripts/drone/pipelines/pr.star index 4d3dbc62ec8..bdfdabc5167 100644 --- a/scripts/drone/pipelines/pr.star +++ b/scripts/drone/pipelines/pr.star @@ -91,6 +91,7 @@ def pr_test_backend(): identify_runner_step(), download_grabpl_step(), gen_version_step(ver_mode), + verify_gen_cue_step(), wire_install_step(), ] test_steps = [ @@ -114,6 +115,7 @@ def pr_pipelines(edition): identify_runner_step(), download_grabpl_step(), gen_version_step(ver_mode), + verify_gen_cue_step(), wire_install_step(), yarn_install_step(), ] @@ -123,7 +125,6 @@ def pr_pipelines(edition): build_frontend_step(edition=edition, ver_mode=ver_mode), build_frontend_package_step(edition=edition, ver_mode=ver_mode), build_plugins_step(edition=edition), - verify_gen_cue_step(), ] integration_test_steps = [ postgres_integration_tests_step(edition=edition, ver_mode=ver_mode), diff --git a/scripts/drone/pipelines/release.star b/scripts/drone/pipelines/release.star index 38248c9f829..8b3f3af3e80 100644 --- a/scripts/drone/pipelines/release.star +++ b/scripts/drone/pipelines/release.star @@ -158,6 +158,7 @@ def get_steps(edition, ver_mode): identify_runner_step(), download_grabpl_step(), gen_version_step(ver_mode), + verify_gen_cue_step(), wire_install_step(), yarn_install_step(), ] @@ -180,7 +181,6 @@ def get_steps(edition, ver_mode): build_frontend_step(edition=edition, ver_mode=ver_mode), build_frontend_package_step(edition=edition, ver_mode=ver_mode), build_plugins_step(edition=edition, sign=True), - verify_gen_cue_step(), ] integration_test_steps = [ @@ -307,7 +307,7 @@ def get_enterprise_pipelines(trigger, ver_mode): clone_enterprise_step(ver_mode), init_enterprise_step(ver_mode) ] - for step in [wire_install_step(), yarn_install_step(), gen_version_step(ver_mode)]: + for step in [wire_install_step(), yarn_install_step(), gen_version_step(ver_mode), verify_gen_cue_step()]: step.update(deps_on_clone_enterprise_step) init_steps.extend([step]) diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index db9b2a31216..60d87b9d393 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -69,6 +69,9 @@ def wire_install_step(): 'commands': [ 'make gen-go', ], + 'depends_on': [ + 'verify-gen-cue', + ], }