Skip to content

Commit

Permalink
Merge pull request #47 from salesforce/log-if-skipping-archived-repo
Browse files Browse the repository at this point in the history
Log if skipping an archived repo with Dockerfiles
  • Loading branch information
afalko authored Jan 30, 2019
2 parents 904c630 + aec6f40 commit c05b1bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ protected void changeDockerfiles(Namespace ns,
GHRepository parent = forkedRepo.getParent();

if (parent == null || !pathToDockerfilesInParentRepo.containsKey(parent.getFullName()) || parent.isArchived()) {
if (parent != null && parent.isArchived()) {
log.info("Skipping archived repo: {}", parent.getFullName());
}
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ protected void changeDockerfiles(Namespace ns,
GHRepository parent = forkedRepo.getParent();

if (parent == null || !pathToDockerfilesInParentRepo.containsKey(parent.getFullName()) || parent.isArchived()) {
if (parent != null && parent.isArchived()) {
log.info("Skipping archived repo: {}", parent.getFullName());
}
return;
}
log.info("Fixing Dockerfiles in {}", forkedRepo.getFullName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,6 @@ public void checkPullRequestNotMadeForArchived() throws Exception {
Mockito.verify(dockerfileGitHubUtil, Mockito.never())
.createPullReq(Mockito.any(), anyString(), Mockito.any(), anyString());
//Make sure we at least check if its archived
Mockito.verify(parentRepo, Mockito.times(1)).isArchived();
Mockito.verify(parentRepo, Mockito.times(2)).isArchived();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,6 @@ public void checkPullRequestNotMadeForArchived() throws Exception {
Mockito.verify(dockerfileGitHubUtil, Mockito.never())
.createPullReq(Mockito.any(), anyString(), Mockito.any(), anyString());
//Make sure we at least call the isArchived.
Mockito.verify(parentRepo, Mockito.times(1)).isArchived();
Mockito.verify(parentRepo, Mockito.times(2)).isArchived();
}
}

0 comments on commit c05b1bb

Please sign in to comment.