From 81359c71a253a383c5a4c762b575383f01afafad Mon Sep 17 00:00:00 2001 From: spinnakerbot Date: Thu, 22 Feb 2024 12:19:30 -0500 Subject: [PATCH 1/4] chore(dependencies): Autobump korkVersion (#1226) Co-authored-by: root --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6be131a31..26076489a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ fiatVersion=1.43.0 -korkVersion=7.214.0 +korkVersion=7.215.0 org.gradle.parallel=true spinnakerGradleVersion=8.32.1 targetJava11=true From 689db3746a3f19d46b9be571e8d1fc48e4f6a43a Mon Sep 17 00:00:00 2001 From: spinnakerbot Date: Fri, 23 Feb 2024 12:47:54 -0500 Subject: [PATCH 2/4] chore(dependencies): Autobump korkVersion (#1227) Co-authored-by: root --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 26076489a..464725135 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ fiatVersion=1.43.0 -korkVersion=7.215.0 +korkVersion=7.216.0 org.gradle.parallel=true spinnakerGradleVersion=8.32.1 targetJava11=true From 097a08ac86347cc0faf3bd18964762e7e9087dea Mon Sep 17 00:00:00 2001 From: Christos Arvanitis Date: Mon, 26 Feb 2024 20:28:26 +0200 Subject: [PATCH 3/4] fix(jenkins): Enable properties and artifacts with job name as query parameter (#1230) --- .../igor/build/BuildController.groovy | 30 +++++++++++++++++++ .../igor/build/BuildControllerSpec.groovy | 15 ++++++++++ 2 files changed, 45 insertions(+) diff --git a/igor-web/src/main/groovy/com/netflix/spinnaker/igor/build/BuildController.groovy b/igor-web/src/main/groovy/com/netflix/spinnaker/igor/build/BuildController.groovy index 1bae24ea7..939a696c2 100644 --- a/igor-web/src/main/groovy/com/netflix/spinnaker/igor/build/BuildController.groovy +++ b/igor-web/src/main/groovy/com/netflix/spinnaker/igor/build/BuildController.groovy @@ -132,6 +132,20 @@ class BuildController { return Collections.emptyList() } + + @RequestMapping(value = '/builds/artifacts/{buildNumber}/{master}') + @PreAuthorize("hasPermission(#master, 'BUILD_SERVICE', 'READ')") + List getBuildResults(@PathVariable String master, @PathVariable + Integer buildNumber, @RequestParam("job") String job ,@Query("propertyFile") String propertyFile) { + def buildService = getBuildService(master) + GenericBuild build = jobStatus(buildService, master, job, buildNumber) + if (build && buildService instanceof BuildProperties && artifactExtractor != null) { + build.properties = buildService.getBuildProperties(job, build, propertyFile) + return artifactExtractor.extractArtifacts(build) + } + return Collections.emptyList() + } + @RequestMapping(value = '/builds/queue/{master}/{item}') @PreAuthorize("hasPermission(#master, 'BUILD_SERVICE', 'READ')") Object getQueueLocation(@PathVariable String master, @PathVariable int item) { @@ -335,6 +349,22 @@ class BuildController { return Collections.emptyMap() } + + @RequestMapping(value = '/builds/properties/{buildNumber}/{fileName}/{master}') + @PreAuthorize("hasPermission(#master, 'BUILD_SERVICE', 'READ')") + Map getProperties( + @PathVariable String master, + @PathVariable Integer buildNumber, @PathVariable + String fileName, @RequestParam("job") String job) { + def buildService = getBuildService(master) + if (buildService instanceof BuildProperties) { + BuildProperties buildProperties = (BuildProperties) buildService + def genericBuild = buildService.getGenericBuild(job, buildNumber) + return buildProperties.getBuildProperties(job, genericBuild, fileName) + } + return Collections.emptyMap() + } + private BuildOperations getBuildService(String master) { def buildService = buildServices.getService(master) if (buildService == null) { diff --git a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/build/BuildControllerSpec.groovy b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/build/BuildControllerSpec.groovy index 8553c4943..80baf7b4a 100644 --- a/igor-web/src/test/groovy/com/netflix/spinnaker/igor/build/BuildControllerSpec.groovy +++ b/igor-web/src/test/groovy/com/netflix/spinnaker/igor/build/BuildControllerSpec.groovy @@ -238,6 +238,21 @@ class BuildControllerSpec extends Specification { .andReturn().response } + void 'get properties of a build with job Name in query parameters' () { + given: + 1 * jenkinsService.getGenericBuild(JOB_NAME, BUILD_NUMBER) >> genericBuild + 1 * jenkinsService.getBuildProperties(JOB_NAME, genericBuild, FILE_NAME) >> ['foo': 'bar'] + + when: + MockHttpServletResponse response = mockMvc.perform( + get("/builds/properties/${BUILD_NUMBER}/${FILE_NAME}/${JENKINS_SERVICE}") + .param("job", JOB_NAME) + .accept(MediaType.APPLICATION_JSON)).andReturn().response + + then: + response.contentAsString == "{\"foo\":\"bar\"}" + } + void 'get properties of a travis build'() { given: 1 * travisService.getGenericBuild(JOB_NAME, BUILD_NUMBER) >> genericBuild From 15e27fd4678a1f46e908c07f510b1bfae956a0dc Mon Sep 17 00:00:00 2001 From: spinnakerbot Date: Tue, 27 Feb 2024 00:28:07 -0500 Subject: [PATCH 4/4] chore(dependencies): Autobump korkVersion (#1231) Co-authored-by: root --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 464725135..927f628ea 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ fiatVersion=1.43.0 -korkVersion=7.216.0 +korkVersion=7.217.0 org.gradle.parallel=true spinnakerGradleVersion=8.32.1 targetJava11=true