Skip to content

Commit

Permalink
feat(core): add expand query param to execution history (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Bloch-Wehba-Seaward authored Mar 16, 2018
1 parent 44e6f9f commit 4ba994d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ class ApplicationController {
@RequestMapping(value = "/{application}/pipelines", method = RequestMethod.GET)
List getPipelines(@PathVariable("application") String application,
@RequestParam(value = "limit", required = false) Integer limit,
@RequestParam(value = "statuses", required = false) String statuses) {
@RequestParam(value = "statuses", required = false) String statuses,
@RequestParam(value = "expand", required = false) Boolean expand) {
def listLimit = limit ?: environment.getProperty(PIPELINE_EXECUTION_LIMIT, Integer, 10)
executionHistoryService.getPipelines(application, listLimit, statuses)
executionHistoryService.getPipelines(application, listLimit, statuses, expand)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class ExecutionHistoryService {
return command.execute()
}

List getPipelines(String app, Integer limit, String statuses) {
List getPipelines(String app, Integer limit, String statuses, Boolean expand) {
Preconditions.checkNotNull(app)
def command = HystrixFactory.newListCommand("pipelineExecutionHistory", "getPipelinesForApp-$app") {
orcaService.getPipelines(app, limit, statuses)
orcaService.getPipelines(app, limit, statuses, expand)
}
return command.execute()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface OrcaService {

@Headers("Accept: application/json")
@GET("/v2/applications/{application}/pipelines")
List getPipelines(@Path("application") String app, @Query("limit") Integer limit, @Query("statuses") String statuses)
List getPipelines(@Path("application") String app, @Query("limit") Integer limit, @Query("statuses") String statuses, @Query("expand") Boolean expand)

@Headers("Accept: application/json")
@GET("/projects/{projectId}/pipelines")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ class FunctionalSpec extends Specification {
thrown(ServerErrorException)
when:
executionHistoryService.getPipelines("app", 5, "TERMINAL")
executionHistoryService.getPipelines("app", 5, "TERMINAL", false)
then:
1 * orcaService.getPipelines("app", 5, "TERMINAL") >> { throw new IllegalStateException() }
1 * orcaService.getPipelines("app", 5, "TERMINAL", false) >> { throw new IllegalStateException() }
thrown(ServerErrorException)
}
Expand Down

0 comments on commit 4ba994d

Please sign in to comment.