Skip to content

Commit

Permalink
feat(ciService): add more fields to generic ci service (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
gal-yardeni committed Aug 26, 2020
1 parent c7dd78f commit d68a1d9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Expand Up @@ -26,6 +26,8 @@
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GenericBuild {
private boolean building;
Expand Down
Expand Up @@ -32,8 +32,15 @@ public interface CiBuildService {
*
* @param projectKey the project key
* @param repoSlug the repository name
* @param buildNumber the build number
* @param commitId the commit id
* @param completionStatus filter builds based on status
* @return a list of builds
*/
List<GenericBuild> getBuilds(String projectKey, String repoSlug, String completionStatus);
List<GenericBuild> getBuilds(
String projectKey,
String repoSlug,
String buildNumber,
String commitId,
String completionStatus);
}
Expand Up @@ -40,10 +40,12 @@ public CiController(Optional<CiBuildService> ciBuildService) {

@GetMapping("/builds")
public List<GenericBuild> getBuilds(
@RequestParam(value = "projectKey") String projectKey,
@RequestParam(value = "repoSlug") String repoSlug,
@RequestParam(value = "projectKey", required = false) String projectKey,
@RequestParam(value = "repoSlug", required = false) String repoSlug,
@RequestParam(value = "buildNumber", required = false) String buildNumber,
@RequestParam(value = "commitId", required = false) String commitId,
@RequestParam(value = "completionStatus", required = false) String completionStatus) {
return getCiService().getBuilds(projectKey, repoSlug, completionStatus);
return getCiService().getBuilds(projectKey, repoSlug, buildNumber, commitId, completionStatus);
}

private CiBuildService getCiService() {
Expand Down

0 comments on commit d68a1d9

Please sign in to comment.