Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

Commit

Permalink
Update to repoURL to not include .git, add logging
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Lowe <martin.lowe@eclipse-foundation.org>
  • Loading branch information
autumnfound committed Dec 10, 2020
1 parent 3034b3a commit 06d9f7d
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiv

// create the request container
ValidationRequest.Builder req = ValidationRequest.builder();
req.repoUrl(receiveEvent.project.getNameKey().toString() + ".git");
req.repoUrl(receiveEvent.project.getNameKey().toString());
req.provider("gerrit");
req.strictMode(true);

Expand All @@ -105,6 +105,10 @@ public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiv
req.commits(Arrays.asList(getRequestCommit(commit, authorIdent, committerIdent)));
// send the request and await the response from the API
ValidationRequest requestActual = req.build();
// log if enabled
if (log.isDebugEnabled()) {
log.debug("Request object: {}", requestActual);
}
CompletableFuture<Response<ValidationResponse>> futureResponse =
this.apiService.validate(requestActual);
try {
Expand All @@ -125,6 +129,10 @@ public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiv
e);
}
}
// log if enabled
if (log.isDebugEnabled()) {
log.debug("Response object: {}", response);
}
for (CommitStatus c : response.commits().values()) {
messages.addAll(
c.messages()
Expand Down Expand Up @@ -199,7 +207,8 @@ private static Commit getRequestCommit(RevCommit src, PersonIdent author, Person
return c.build();
}

private static boolean shouldEnforceStrict(ValidationResponse response, ValidationRequest request) {
private static boolean shouldEnforceStrict(
ValidationResponse response, ValidationRequest request) {
return response.trackedProject() || request.strictMode();
}

Expand Down

0 comments on commit 06d9f7d

Please sign in to comment.