Skip to content

Commit

Permalink
Update stream apps version refs to 4.0.0
Browse files Browse the repository at this point in the history
This commit is the 1st step in the effort to update the default version
of stream apps from 3.2.1 to 4.0.0.
  • Loading branch information
onobc committed Aug 14, 2024
1 parent a362397 commit 99ae4f4
Show file tree
Hide file tree
Showing 17 changed files with 101 additions and 101 deletions.
12 changes: 6 additions & 6 deletions spring-cloud-dataflow-docs/src/main/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Sabby Anandan; Marius Bogoevici; Eric Bottard; Mark Fisher; Ilayaperumal Gopinat
:scs-stream-apps-docs: https://docs.spring.io/stream-applications/docs/current/reference/html
:dataflow-asciidoc-images: https://raw.githubusercontent.com/spring-cloud/spring-cloud-dataflow/main/spring-cloud-dataflow-docs/src/main/asciidoc/images

:docker-http-source-rabbit-version: 3.2.1
:docker-time-source-rabbit-version: 3.2.1
:docker-log-sink-rabbit-version: 3.2.1
:docker-log-sink-kafka-version: 3.2.1
:docker-http-source-kafka-version: 3.2.1
:docker-time-source-kafka-version: 3.2.1
:docker-http-source-rabbit-version: 4.0.0
:docker-time-source-rabbit-version: 4.0.0
:docker-log-sink-rabbit-version: 4.0.0
:docker-log-sink-kafka-version: 4.0.0
:docker-http-source-kafka-version: 4.0.0
:docker-time-source-kafka-version: 4.0.0
:docker-timestamp-task-version: 2.0.2

ifdef::backend-html5[]
Expand Down
26 changes: 13 additions & 13 deletions spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ applications built with the RabbitMQ binder, you could do the following:
====
[source,bash]
----
dataflow:>app register --name http --type source --uri maven://org.springframework.cloud.stream.app:http-source-rabbit:3.2.1
dataflow:>app register --name log --type sink --uri maven://org.springframework.cloud.stream.app:log-sink-rabbit:3.2.1
dataflow:>app register --name http --type source --uri maven://org.springframework.cloud.stream.app:http-source-rabbit:4.0.0
dataflow:>app register --name log --type sink --uri maven://org.springframework.cloud.stream.app:log-sink-rabbit:4.0.0
----
====

Expand All @@ -218,8 +218,8 @@ For example, to register the snapshot versions of the `http` and `log` applicati
====
[source,bash]
----
source.http=maven://org.springframework.cloud.stream.app:http-source-rabbit:3.2.1
sink.log=maven://org.springframework.cloud.stream.app:log-sink-rabbit:3.2.1
source.http=maven://org.springframework.cloud.stream.app:http-source-rabbit:4.0.0
sink.log=maven://org.springframework.cloud.stream.app:log-sink-rabbit:4.0.0
----
====

Expand Down Expand Up @@ -486,9 +486,9 @@ The following listing shows the exposed properties for the `time` application:
----
dataflow:> app info --name time --type source
Information about source application 'time':
Version: '3.2.1':
Version: '4.0.0':
Default application version: 'true':
Resource URI: maven://org.springframework.cloud.stream.app:time-source-rabbit:3.2.1
Resource URI: maven://org.springframework.cloud.stream.app:time-source-rabbit:4.0.0
╔══════════════════════════════╤══════════════════════════════╤══════════════════════════════╤══════════════════════════════╗
║ Option Name │ Description │ Default │ Type ║
╠══════════════════════════════╪══════════════════════════════╪══════════════════════════════╪══════════════════════════════╣
Expand Down Expand Up @@ -521,9 +521,9 @@ The following listing shows the exposed properties for the `log` application:
----
dataflow:> app info --name log --type sink
Information about sink application 'log':
Version: '3.2.1':
Version: '4.0.0':
Default application version: 'true':
Resource URI: maven://org.springframework.cloud.stream.app:log-sink-rabbit:3.2.1
Resource URI: maven://org.springframework.cloud.stream.app:log-sink-rabbit:4.0.0
╔══════════════════════════════╤══════════════════════════════╤══════════════════════════════╤══════════════════════════════╗
║ Option Name │ Description │ Default │ Type ║
╠══════════════════════════════╪══════════════════════════════╪══════════════════════════════╪══════════════════════════════╣
Expand Down Expand Up @@ -790,13 +790,13 @@ Stream Deployment properties: {
----
====

Then the following command updates the stream to use the `3.2.1` version of the log application.
Then the following command updates the stream to use the `4.0.0` version of the log application.
Before updating the stream with the specific version of the application, we need to make sure that the application is registered with that version:

====
[source,bash]
----
dataflow:>app register --name log --type sink --uri maven://org.springframework.cloud.stream.app:log-sink-rabbit:3.2.1
dataflow:>app register --name log --type sink --uri maven://org.springframework.cloud.stream.app:log-sink-rabbit:4.0.0
Successfully registered application 'sink:log'
----
====
Expand All @@ -806,7 +806,7 @@ Then we can update the application:
====
[source,bash]
----
dataflow:>stream update --name httptest --properties version.log=3.2.1
dataflow:>stream update --name httptest --properties version.log=4.0.0
----
====

Expand All @@ -829,11 +829,11 @@ Stream Deployment properties: {
"spring.cloud.deployer.indexed" : "true",
"spring.cloud.deployer.count" : "1",
"spring.cloud.deployer.group" : "httptest",
"maven://org.springframework.cloud.stream.app:log-sink-rabbit" : "3.2.1"
"maven://org.springframework.cloud.stream.app:log-sink-rabbit" : "4.0.0"
},
"http" : {
"spring.cloud.deployer.group" : "httptest",
"maven://org.springframework.cloud.stream.app:http-source-rabbit" : "3.2.1"
"maven://org.springframework.cloud.stream.app:http-source-rabbit" : "4.0.0"
}
}
----
Expand Down
2 changes: 1 addition & 1 deletion spring-cloud-dataflow-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<joda-time.version>2.12.7</joda-time.version>
<aws-java-sdk-ecr.version>1.12.513</aws-java-sdk-ecr.version>
<!-- only used for dataflow managed stream applications, e.g., tasklauncher -->
<stream-applications.version>3.2.1</stream-applications.version>
<stream-applications.version>4.0.0</stream-applications.version>
<wavefront-spring-boot-bom.version>3.2.0</wavefront-spring-boot-bom.version>
<spring-cloud-dataflow-apps-docs-plugin.version>1.0.14</spring-cloud-dataflow-apps-docs-plugin.version>
<spring-cloud-dataflow-apps-metadata-plugin.version>1.0.14</spring-cloud-dataflow-apps-metadata-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ public class AppResourceCommonTests {

@Test
public void testBadNamedJars() throws Exception {
UrlResource urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/3.2.1/file-sink-rabbit.jar");
UrlResource urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/4.0.0/file-sink-rabbit.jar");
assertThatIllegalArgumentException().isThrownBy( () -> appResourceCommon.getUrlResourceVersion(urlResource));
}

@Test
public void testInvalidUrlResourceWithoutVersion() throws Exception {
assertThat(appResourceCommon.getUrlResourceWithoutVersion(
new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/3.2.1/file-sink-rabbit-3.2.1.jar")))
.isEqualTo("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/3.2.1/file-sink-rabbit");
new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/4.0.0/file-sink-rabbit-4.0.0.jar")))
.isEqualTo("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/4.0.0/file-sink-rabbit");
}

@Test
Expand Down Expand Up @@ -83,31 +83,31 @@ public void testDefaultResource() {

@Test
public void testDockerUriString() throws Exception {
String dockerUri = "docker:springcloudstream/log-sink-rabbit:3.2.1";
String dockerUri = "docker:springcloudstream/log-sink-rabbit:4.0.0";
Resource resource = appResourceCommon.getResource(dockerUri);
assertThat(resource instanceof DockerResource).isTrue();
assertThat(resource.getURI().toString().equals(dockerUri));
}

@Test
public void testJarMetadataUriDockerApp() throws Exception {
String appUri = "docker:springcloudstream/log-sink-rabbit:3.2.1";
String metadataUri = "https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/3.2.1/file-sink-rabbit-3.2.1.jar";
String appUri = "docker:springcloudstream/log-sink-rabbit:4.0.0";
String metadataUri = "https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/4.0.0/file-sink-rabbit-4.0.0.jar";
appResourceCommon.getMetadataResource(new URI(appUri), new URI(metadataUri));
verify(resourceLoader).getResource(eq(metadataUri));
}

@Test
public void testMetadataUriHttpApp() throws Exception {
String appUri = "https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/3.2.1/file-sink-rabbit-3.2.1.jar";
String appUri = "https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/4.0.0/file-sink-rabbit-4.0.0.jar";
Resource metadataResource = appResourceCommon.getMetadataResource(new URI(appUri), null);
assertThat(metadataResource instanceof UrlResource).isTrue();
assertThat(metadataResource.getURI().toString().equals(appUri));
}

@Test
public void testMetadataUriDockerApp() throws Exception {
String appUri = "docker:springcloudstream/log-sink-rabbit:3.2.1";
String appUri = "docker:springcloudstream/log-sink-rabbit:4.0.0";
Resource metadataResource = appResourceCommon.getMetadataResource(new URI(appUri), null);
assertThat(metadataResource).isNotNull();
assertThat(metadataResource instanceof DockerResource).isTrue();
Expand All @@ -130,73 +130,73 @@ public void testInvalidUrlResourceURI() throws Exception {
@Test
public void testJars() throws MalformedURLException {
//Dashes in artifact name
UrlResource urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/file-sink-rabbit-3.2.1.jar");
UrlResource urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/file-sink-rabbit-4.0.0.jar");
String version = appResourceCommon.getUrlResourceVersion(urlResource);
assertThat(version).isEqualTo("3.2.1");
assertThat(version).isEqualTo("4.0.0");

String theRest = appResourceCommon.getResourceWithoutVersion(urlResource);
assertThat(theRest).isEqualTo("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/file-sink-rabbit");

//No dashes in artfiact name - BUILD-SNAPSHOT
urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file/file-3.2.1-SNAPSHOT.jar");
urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file/file-4.0.1-SNAPSHOT.jar");
version = appResourceCommon.getUrlResourceVersion(urlResource);
assertThat(version).isEqualTo("3.2.1-SNAPSHOT");
assertThat(version).isEqualTo("4.0.1-SNAPSHOT");
theRest = appResourceCommon.getResourceWithoutVersion(urlResource);
assertThat(theRest).isEqualTo("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file/file");

//No dashes in artfiact name - RELEASE
urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file/file-3.2.1.jar");
urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file/file-4.0.0.jar");
version = appResourceCommon.getUrlResourceVersion(urlResource);
assertThat(version).isEqualTo("3.2.1");
assertThat(version).isEqualTo("4.0.0");
theRest = appResourceCommon.getResourceWithoutVersion(urlResource);
assertThat(theRest).isEqualTo("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file/file");

//Spring style snapshots naming scheme
urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/file-sink-rabbit-3.2.1-SNAPSHOT.jar");
urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/file-sink-rabbit-4.0.1-SNAPSHOT.jar");
version = appResourceCommon.getUrlResourceVersion(urlResource);
assertThat(version).isEqualTo("3.2.1-SNAPSHOT");
assertThat(version).isEqualTo("4.0.1-SNAPSHOT");
theRest = appResourceCommon.getResourceWithoutVersion(urlResource);
assertThat(theRest).isEqualTo("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/file-sink-rabbit");

//Standard maven style naming scheme
urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/file-sink-rabbit-3.2.1-SNAPSHOT.jar");
urlResource = new UrlResource("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/file-sink-rabbit-4.0.1-SNAPSHOT.jar");
version = appResourceCommon.getUrlResourceVersion(urlResource);
assertThat(version).isEqualTo("3.2.1-SNAPSHOT");
assertThat(version).isEqualTo("4.0.1-SNAPSHOT");
theRest = appResourceCommon.getResourceWithoutVersion(urlResource);
assertThat(theRest).isEqualTo("https://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/file-sink-rabbit/file-sink-rabbit");
}

@Test
public void testGetResourceWithoutVersion() {
assertThat(appResourceCommon.getResourceWithoutVersion(
MavenResource.parse("org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:war:exec:3.2.1")))
MavenResource.parse("org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:war:exec:4.0.0")))
.isEqualTo("maven://org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:war:exec");
assertThat(appResourceCommon.getResourceWithoutVersion(
MavenResource.parse("org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit::exec:3.2.1")))
MavenResource.parse("org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit::exec:4.0.0")))
.isEqualTo("maven://org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:jar:exec");
assertThat(appResourceCommon.getResourceWithoutVersion(
MavenResource.parse("org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:3.2.1")))
MavenResource.parse("org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:4.0.0")))
.isEqualTo("maven://org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:jar");
}

@Test
public void testGetResource() {
String mavenUri = "maven://org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:3.2.1";
String mavenUri = "maven://org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:4.0.0";
Resource resource = appResourceCommon.getResource(mavenUri);
assertThat(resource).isInstanceOf(MavenResource.class);
}

@Test
public void testGetResourceVersion() {
String mavenUri = "maven://org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:3.2.1";
String mavenUri = "maven://org.springframework.cloud.stream.app:aggregate-counter-sink-rabbit:4.0.0";
String version = appResourceCommon.getResourceVersion(appResourceCommon.getResource(mavenUri));
assertThat(version).isEqualTo("3.2.1");
assertThat(version).isEqualTo("4.0.0");
}

@Test
public void testGetMetadataResourceVersion() {
String httpUri = "http://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/cassandra-sink-rabbit/3.2.1-SNAPSHOT/cassandra-sink-rabbit-3.2.1-SNAPSHOT-metadata.jar";
String httpUri = "http://repo.maven.apache.org/maven2/org/springframework/cloud/stream/app/cassandra-sink-rabbit/4.0.1-SNAPSHOT/cassandra-sink-rabbit-4.0.1-SNAPSHOT-metadata.jar";
String version = appResourceCommon.getResourceVersion(appResourceCommon.getResource(httpUri));
assertThat(version).isEqualTo("3.2.1-SNAPSHOT");
assertThat(version).isEqualTo("4.0.1-SNAPSHOT");
}
}
Loading

0 comments on commit 99ae4f4

Please sign in to comment.