Skip to content

Commit

Permalink
control-service: run ci on gradle version change (#1371)
Browse files Browse the repository at this point in the history
  • Loading branch information
murphp15 authored Nov 30, 2022
1 parent 8398933 commit fc54a5f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 21 deletions.
20 changes: 18 additions & 2 deletions projects/control-service/cicd/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,30 @@
when:
- always


# This grouping represents ALL files related to the control plane.
# This grouping triggers actions like new releases etc. but don't trigger unit or integration tests.before_script
# because it also includes the helm chart folders and we don't want to run unit and integration tests anytime
# the helm chart changes
.control_service_changes: &control_service_change_locations
- projects/control-service/cicd/**/*
- projects/control-service/projects/base/**/*
- projects/control-service/projects/model/**/*
- projects/control-service/projects/pipelines_control_service/**/*
- projects/control-service/projects/settings.gradle
- projects/control-service/projects/versions-of-external-dependencies.gradle
- projects/control-service/projects/helm_charts/pipelines-control-service/**/*

# This is a subset of the &control_service_change_locations which listens on changes to all code
# Changes to this group should trigger runs of runs of unit and integration tests.
.control_service_code_changes: &control_service_code_change_locations
- projects/control-service/cicd/**/*
- projects/control-service/projects/base/**/*
- projects/control-service/projects/model/**/*
- projects/control-service/projects/pipelines_control_service/**/*
- projects/control-service/projects/settings.gradle
- projects/control-service/projects/versions-of-external-dependencies.gradle

.control_service_deploy_testing_changes: &control_service_deploy_testing_changes
- projects/control-service/cicd/**/*
- projects/control-service/projects/base/**/*
Expand Down Expand Up @@ -64,7 +80,7 @@ control_service_build_image:
refs:
- external_pull_requests
- main
changes: *control_service_change_locations
changes: *control_service_code_change_locations

control_service_integration_test:
extends: .control_service_base_build
Expand Down Expand Up @@ -102,7 +118,7 @@ control_service_integration_test:
refs:
- external_pull_requests
- main
changes: *control_service_change_locations
changes: *control_service_code_change_locations
except:
changes:
- projects/control-service/projects/helm_charts/pipelines-control-service/version.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import io.netty.handler.codec.http.HttpMethod;
import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.mockserver.client.server.MockServerClient;
import org.mockserver.client.MockServerClient;
import org.mockserver.integration.ClientAndServer;
import org.mockserver.model.Header;
import org.mockserver.model.HttpResponse;
Expand Down Expand Up @@ -110,7 +110,7 @@ private void mockFailingPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format(
"/data-jobs/for-team/%s/jobs/%s",
Expand All @@ -121,7 +121,7 @@ private void mockFailingPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format(
"/data-jobs/for-team/%s/jobs/%s",
Expand All @@ -133,7 +133,7 @@ private void mockFailingPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format(
"/data-jobs/for-team/%s/jobs/%s",
Expand All @@ -146,7 +146,7 @@ private void mockFailingPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format(
"/data-jobs/for-team/%s/jobs/%s",
Expand All @@ -160,7 +160,7 @@ private void mockSuccessfulPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format("/data-jobs/for-team/%s/jobs/%s", TEST_TEAM_NAME, TEST_JOB_NAME)))
.respond(getOkResponse());
Expand All @@ -169,7 +169,7 @@ private void mockSuccessfulPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format("/data-jobs/for-team/%s/jobs/%s", TEST_TEAM_NAME, TEST_JOB_1)))
.respond(getOkResponse());
Expand All @@ -178,7 +178,7 @@ private void mockSuccessfulPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format("/data-jobs/for-team/%s/jobs/%s", TEST_TEAM_NAME, TEST_JOB_2)))
.respond(getOkResponse());
Expand All @@ -187,7 +187,7 @@ private void mockSuccessfulPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format(
"/data-jobs/for-team/%s/jobs/%s", NEW_TEST_TEAM_NAME, TEST_JOB_3)))
Expand All @@ -197,7 +197,7 @@ private void mockSuccessfulPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format(
"/data-jobs/for-team/%s/jobs/%s", NEW_TEST_TEAM_NAME, TEST_JOB_4)))
Expand All @@ -207,7 +207,7 @@ private void mockSuccessfulPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format(
"/data-jobs/for-team/%s/jobs/%s", NEW_TEST_TEAM_NAME, TEST_JOB_5)))
Expand All @@ -217,7 +217,7 @@ private void mockSuccessfulPostDeleteWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format("/data-jobs/for-team/%s/jobs/%s", TEST_TEAM_NAME, TEST_JOB_6)))
.respond(getOkResponse());
Expand All @@ -228,15 +228,15 @@ private void mockFailingPostCreateWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(String.format("/data-jobs/for-team/%s/jobs", TEST_CLIENT_ERROR_TEAM)))
.respond(getClientErrorResponse());

mockWebHookServerClient
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(String.format("/data-jobs/for-team/%s/jobs", TEST_INTERNAL_ERROR_TEAM)))
.respond(getInternalServerErrorResponse());

Expand All @@ -245,7 +245,7 @@ private void mockFailingPostCreateWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format("/data-jobs/for-team/%s/jobs", TEST_INTERNAL_ERROR_RETRIED_TEAM)),
exactly(TEST_INTERNAL_ERROR_RETRIES))
Expand All @@ -256,7 +256,7 @@ private void mockFailingPostCreateWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(
String.format("/data-jobs/for-team/%s/jobs", TEST_INTERNAL_ERROR_RETRIED_TEAM)),
exactly(TEST_INTERNAL_ERROR_RETRIES + 1))
Expand All @@ -268,15 +268,15 @@ private void mockSuccessfulPostCreateWebHook() {
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(String.format("/data-jobs/for-team/%s/jobs", TEST_TEAM_NAME)))
.respond(getOkResponse());

mockWebHookServerClient
.when(
request()
.withMethod(HttpMethod.POST.name())
.withHeader("'Content-type', 'application/json'")
.withHeader("Content-type", "application/json")
.withPath(String.format("/data-jobs/for-team/%s/jobs", NEW_TEST_TEAM_NAME)))
.respond(getOkResponse());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project.ext {
// Update the ph-client to latest.
'io.micrometer:micrometer-registry-prometheus' : 'io.micrometer:micrometer-registry-prometheus:1.7.2',
'io.springfox:springfox-swagger2' : 'io.springfox:springfox-swagger2:2.9.2', //3.0.0, //latest.release also works for swagger
'io.springfox:springfox-swagger-ui' : 'io.springfox:springfox-swagger-ui:3.0.0', //3.0.0
'io.springfox:springfox-swagger-ui' : 'io.springfox:springfox-swagger-ui:2.9.2', //3.0.0
'io.swagger:swagger-annotations' : 'io.swagger:swagger-annotations:1.5.22', //1.6.2
'org.openapitools:jackson-databind-nullable' : 'org.openapitools:jackson-databind-nullable:0.2.1',
'org.influxdb:influxdb-java' : 'org.influxdb:influxdb-java:2.21',
Expand Down

0 comments on commit fc54a5f

Please sign in to comment.