From 8c3fb529a18bc9260f22a19efa526a081a1ced5e Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 12 Jan 2018 00:55:46 +0000 Subject: [PATCH 1/4] Update SNAPSHOT to 1.4.1.RELEASE --- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 4 ++-- spring-cloud-config-monitor/pom.xml | 2 +- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 6544b6f4..2aa68ddf 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.1.RELEASE .. diff --git a/pom.xml b/pom.xml index a19c1a14..d0a41ff0 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.1.RELEASE pom Spring Cloud Config Spring Cloud Config @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 1.3.6.RELEASE + 1.3.7.RELEASE @@ -22,7 +22,7 @@ config - 1.3.0.RELEASE + 1.3.1.RELEASE spring-cloud-config-dependencies diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index 76c99c94..39d5ec69 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.1.RELEASE .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index a8166e80..7a6a37c1 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -5,11 +5,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 1.3.6.RELEASE + 1.3.7.RELEASE spring-cloud-config-dependencies - 1.4.1.BUILD-SNAPSHOT + 1.4.1.RELEASE pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index ff39ebd1..ffc74b0c 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.1.RELEASE .. spring-cloud-config-monitor diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index 35c84ae4..46a05bb1 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.1.RELEASE .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index f19dbb1d..a0d33180 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.1.RELEASE .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index 7d796f78..8d5cb180 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -5,10 +5,10 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.1.RELEASE spring-cloud-starter-config - 1.4.1.BUILD-SNAPSHOT + 1.4.1.RELEASE spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From 2809b088f2cb9614cb1054d0d5e03882382e5fda Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 12 Jan 2018 00:57:10 +0000 Subject: [PATCH 2/4] Going back to snapshots --- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 4 ++-- spring-cloud-config-monitor/pom.xml | 2 +- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 2aa68ddf..6544b6f4 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.RELEASE + 1.4.1.BUILD-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index d0a41ff0..a19c1a14 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 1.4.1.RELEASE + 1.4.1.BUILD-SNAPSHOT pom Spring Cloud Config Spring Cloud Config @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 1.3.7.RELEASE + 1.3.6.RELEASE @@ -22,7 +22,7 @@ config - 1.3.1.RELEASE + 1.3.0.RELEASE spring-cloud-config-dependencies diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index 39d5ec69..76c99c94 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.RELEASE + 1.4.1.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 7a6a37c1..a8166e80 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -5,11 +5,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 1.3.7.RELEASE + 1.3.6.RELEASE spring-cloud-config-dependencies - 1.4.1.RELEASE + 1.4.1.BUILD-SNAPSHOT pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index ffc74b0c..ff39ebd1 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.RELEASE + 1.4.1.BUILD-SNAPSHOT .. spring-cloud-config-monitor diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index 46a05bb1..35c84ae4 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.RELEASE + 1.4.1.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index a0d33180..f19dbb1d 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.RELEASE + 1.4.1.BUILD-SNAPSHOT .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index 8d5cb180..7d796f78 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -5,10 +5,10 @@ org.springframework.cloud spring-cloud-config - 1.4.1.RELEASE + 1.4.1.BUILD-SNAPSHOT spring-cloud-starter-config - 1.4.1.RELEASE + 1.4.1.BUILD-SNAPSHOT spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From 7d20464efc11e7e59c4629ec5c15327d7181832e Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 12 Jan 2018 00:57:11 +0000 Subject: [PATCH 3/4] Bumping versions to 1.4.2.BUILD-SNAPSHOT after release --- docs/pom.xml | 2 +- pom.xml | 2 +- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 2 +- spring-cloud-config-monitor/pom.xml | 2 +- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 6544b6f4..025059ff 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.2.BUILD-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index a19c1a14..2c815063 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.2.BUILD-SNAPSHOT pom Spring Cloud Config Spring Cloud Config diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index 76c99c94..fc500283 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.2.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index a8166e80..6239dc6b 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -9,7 +9,7 @@ spring-cloud-config-dependencies - 1.4.1.BUILD-SNAPSHOT + 1.4.2.BUILD-SNAPSHOT pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index ff39ebd1..38cf62b4 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.2.BUILD-SNAPSHOT .. spring-cloud-config-monitor diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index 35c84ae4..c93c6f84 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.2.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index f19dbb1d..e9f3da48 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.2.BUILD-SNAPSHOT .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index 7d796f78..f0b26baa 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -5,10 +5,10 @@ org.springframework.cloud spring-cloud-config - 1.4.1.BUILD-SNAPSHOT + 1.4.2.BUILD-SNAPSHOT spring-cloud-starter-config - 1.4.1.BUILD-SNAPSHOT + 1.4.2.BUILD-SNAPSHOT spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From 049fbf81c16b92c7aaabe4472105e1a3be300211 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Thu, 1 Feb 2018 17:19:52 -0500 Subject: [PATCH 4/4] Env Controller support for {application} (_) fixes gh-894 --- docs/src/main/asciidoc/spring-cloud-config.adoc | 8 ++++---- .../config/server/environment/EnvironmentController.java | 5 +++++ .../EnvironmentControllerIntegrationTests.java | 9 +++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/src/main/asciidoc/spring-cloud-config.adoc b/docs/src/main/asciidoc/spring-cloud-config.adoc index 6f3db748..6213d77f 100644 --- a/docs/src/main/asciidoc/spring-cloud-config.adoc +++ b/docs/src/main/asciidoc/spring-cloud-config.adoc @@ -150,10 +150,10 @@ working copy as a cache. This repository implementation maps the `{label}` parameter of the HTTP resource to a git label (commit id, branch name or tag). If the git branch or tag name contains a slash ("/") then the label in the -HTTP URL should be specified with the special string "(\_)" instead (to +HTTP URL should be specified with the special string "(_)" instead (to avoid ambiguity with other URL paths). For example, if the label is `foo/bar`, replacing the slash would result in a label that looks like -`foo(_)bar`. The inclusion of the special string "(\_)" can also be +`foo(_)bar`. The inclusion of the special string "(_)" can also be applied to the `{application}` parameter. Be careful with the brackets in the URL if you are using a command line client like curl (e.g. escape them from the shell with quotes ''). @@ -179,7 +179,7 @@ spring: or a "one repo per profile" policy using a similar pattern but with `{profile}`. -Additionally, using the special string "(\_)" within your +Additionally, using the special string "(_)" within your `{application}` parameters can enable support for multiple organizations (for example): @@ -194,7 +194,7 @@ spring: ---- where `{application}` is provided at request time in the format -"organization(\_)application". +"organization(_)application". ===== Pattern Matching and Multiple Repositories diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/EnvironmentController.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/EnvironmentController.java index 7d040c33..3d6c0e3a 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/EnvironmentController.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/EnvironmentController.java @@ -99,6 +99,11 @@ public class EnvironmentController { @RequestMapping("/{name}/{profiles}/{label:.*}") public Environment labelled(@PathVariable String name, @PathVariable String profiles, @PathVariable String label) { + if (name != null && name.contains("(_)")) { + // "(_)" is uncommon in a git repo name, but "/" cannot be matched + // by Spring MVC + name = name.replace("(_)", "/"); + } if (label != null && label.contains("(_)")) { // "(_)" is uncommon in a git branch name, but "/" cannot be matched // by Spring MVC diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/EnvironmentControllerIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/EnvironmentControllerIntegrationTests.java index 96001840..238e1228 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/EnvironmentControllerIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/EnvironmentControllerIntegrationTests.java @@ -139,6 +139,15 @@ public class EnvironmentControllerIntegrationTests { .andExpect(MockMvcResultMatchers.content().string(Matchers.containsString("\"propertySources\":"))); } + @Test + public void environmentWithApplicationContainingSlash() throws Exception { + Mockito.when(this.repository.findOne("foo/app", "default", null)) + .thenReturn(new Environment("foo/app", "default")); + this.mvc.perform(MockMvcRequestBuilders.get("/foo(_)app/default")) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.content().string(Matchers.containsString("\"propertySources\":"))); + } + @Configuration @EnableWebMvc @Import(PropertyPlaceholderAutoConfiguration.class)