Custom status support - #26
Conversation
2d32207 to
6088e3b
Compare
cgillum
left a comment
There was a problem hiding this comment.
Happy to see this coming along! See my initial feedback below. Let me know if you're still stuck on the test case and I can help debug.
| OrchestratorService.OrchestratorResponse.Builder responseBuilder = OrchestratorService.OrchestratorResponse.newBuilder(); | ||
| responseBuilder.setInstanceId(orchestratorRequest.getInstanceId()); | ||
| responseBuilder.addAllActions(actions); | ||
| if(taskOrchestrationExecutor.getCustomStatus() != null) { |
There was a problem hiding this comment.
Same comment about allowing a null custom status.
There was a problem hiding this comment.
I'm actually a bit surprised this code is duplicated in two places. Does it need to be?
davidmrdavid
left a comment
There was a problem hiding this comment.
Left some comments as well, mostly just adding to the existing discussion.
So happy to see the quick progress here, good job folks!
| OrchestratorService.OrchestratorResponse.Builder responseBuilder = OrchestratorService.OrchestratorResponse.newBuilder(); | ||
| responseBuilder.setInstanceId(orchestratorRequest.getInstanceId()); | ||
| responseBuilder.addAllActions(actions); | ||
| if(taskOrchestrationExecutor.getCustomStatus() != null) { |
There was a problem hiding this comment.
I'm actually a bit surprised this code is duplicated in two places. Does it need to be?
cgillum
left a comment
There was a problem hiding this comment.
This seems much cleaner, thanks! A few more small suggestions.
… OrchestrationMetadata
| private final String customStatus; | ||
|
|
||
| public TaskOrchestratorResult(Collection<OrchestratorService.OrchestratorAction> actions, String customStatus) { | ||
| this.actions = ImmutableList.<OrchestratorService.OrchestratorAction>builder().addAll(actions).build(); |
There was a problem hiding this comment.
Instead of using the 3rd party ImmutableList, let's just use Collections.unmodifiableCollection()
| this.actions = ImmutableList.<OrchestratorService.OrchestratorAction>builder().addAll(actions).build(); | |
| this.actions = Collections.unmodifiableCollection(actions); |
| this.customStatus = customStatus; | ||
| } | ||
|
|
||
| public Collection<OrchestratorService.OrchestratorAction> getActions() { |
There was a problem hiding this comment.
Alternatively, you could simply change the return type of this method to Iterable<OrchestratorService.OrchestratorAction> to achieve the same external immutability result.
| public Collection<OrchestratorService.OrchestratorAction> getActions() { | |
| public Iterable<OrchestratorService.OrchestratorAction> getActions() { |
Added support for custom status with integration test
resolves #7