Repository: spring-cloud/spring-cloud-dataflow
Issue: When one app fails to deploy in a stream, the stream status is "all apps failed to deploy"

This is an incorrect message.
This is what was observed when testing with skipper and investigating the issue with escaping quote characters.  The transformer app failed to start, the runtime apps command was accurate reporting what was running and what had failed.

Changed files:
spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/StreamDefinitionController.java
spring-cloud-dataflow-server-core/src/test/java/org/springframework/cloud/dataflow/server/controller/StreamControllerTests.java

diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/StreamDefinitionController.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/StreamDefinitionController.java
index c13c32064..3f3b26596 100644
--- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/StreamDefinitionController.java
+++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/StreamDefinitionController.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2017 the original author or authors.
+ * Copyright 2015-2018 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -146,6 +146,10 @@ public class StreamDefinitionController {
 			logger.debug("aggregateState: Returning " + DeploymentState.error);
 			return DeploymentState.error;
 		}
+		if (states.contains(DeploymentState.deployed) && states.contains(DeploymentState.failed)) {
+			logger.debug("aggregateState: Returning " + DeploymentState.partial);
+			return DeploymentState.partial;
+		}
 		if (states.contains(DeploymentState.failed)) {
 			logger.debug("aggregateState: Returning " + DeploymentState.failed);
 			return DeploymentState.failed;
diff --git a/spring-cloud-dataflow-server-core/src/test/java/org/springframework/cloud/dataflow/server/controller/StreamControllerTests.java b/spring-cloud-dataflow-server-core/src/test/java/org/springframework/cloud/dataflow/server/controller/StreamControllerTests.java
index ffb734fc8..43a8bf4ba 100644
--- a/spring-cloud-dataflow-server-core/src/test/java/org/springframework/cloud/dataflow/server/controller/StreamControllerTests.java
+++ b/spring-cloud-dataflow-server-core/src/test/java/org/springframework/cloud/dataflow/server/controller/StreamControllerTests.java
@@ -889,7 +889,7 @@ public class StreamControllerTests {
 
 	@Test
 	public void testAggregateState() {
-		assertThat(StreamDefinitionController.aggregateState(EnumSet.of(deployed, failed)), is(failed));
+		assertThat(StreamDefinitionController.aggregateState(EnumSet.of(deployed, failed)), is(partial));
 		assertThat(StreamDefinitionController.aggregateState(EnumSet.of(unknown, failed)), is(failed));
 		assertThat(StreamDefinitionController.aggregateState(EnumSet.of(deployed, failed, error)), is(error));
 		assertThat(StreamDefinitionController.aggregateState(EnumSet.of(deployed, undeployed)), is(partial));