Skip to content

Commit

Permalink
send only commit hash to the git plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
julioc-p committed Sep 20, 2024
1 parent 71bd948 commit 85460cf
Showing 1 changed file with 4 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.util.logging.Logger;
import javax.annotation.CheckForNull;

import hudson.plugins.git.GitSCM;
import io.jenkins.plugins.bitbucketpushandpullrequest.action.BitBucketPPRActionAbstract;
import io.jenkins.plugins.bitbucketpushandpullrequest.action.BitBucketPPRPullRequestServerAction;
import io.jenkins.plugins.bitbucketpushandpullrequest.action.BitBucketPPRServerRepositoryAction;
Expand Down Expand Up @@ -163,8 +162,7 @@ public void onPollSuccess(PollingResult pollingResult) {
BitBucketPPRTriggerCause cause =
filter.getCause(getLogFile(), bitbucketAction, bitbucketEvent);
if (shouldScheduleJob(filter, pollingResult, bitbucketAction)) {
scheduleJobs(
cause, bitbucketAction, scmTrigger, observable, filter);
scheduleJob(cause, bitbucketAction, scmTrigger, observable, filter);
}
} catch (Throwable e) {
logger.warning(
Expand Down Expand Up @@ -198,34 +196,6 @@ public void onPollError(Throwable e) {
}
}

private void scheduleJobs(
BitBucketPPRTriggerCause cause,
BitBucketPPRAction bitbucketAction,
SCM scmTrigger,
BitBucketPPRObservable observable,
BitBucketPPRTriggerFilter filter) {
((GitSCM) scmTrigger)
.getRepositories()
.forEach(
repository -> {
// for each url call schedulejob
repository
.getURIs()
.forEach(
uri -> {
try {
scheduleJob(cause, uri, bitbucketAction, observable, filter, scmTrigger);
} catch (URISyntaxException e) {
logger.warning(
String.format(
"Error: cannot schedule the job for the repository %s: %s",
uri.toPrivateString(), e.getMessage()));
e.printStackTrace();
}
});
});
}

private void checkLocalPropagationUrl(BitBucketPPRAction bitBucketPPRAction) {

if (bitBucketPPRAction == null) {
Expand Down Expand Up @@ -256,11 +226,10 @@ private boolean shouldScheduleJob(

private void scheduleJob(
BitBucketPPRTriggerCause cause,
URIish uri,
BitBucketPPRAction bitbucketAction,
SCM scmTrigger,
BitBucketPPRObservable observable,
BitBucketPPRTriggerFilter filter,
SCM scmTrigger)
BitBucketPPRTriggerFilter filter)
throws URISyntaxException {

// Jenkins will take all instances of QueueAction from this job and will try to compare these
Expand All @@ -276,7 +245,7 @@ private void scheduleJob(
5,
new CauseAction(cause),
bitbucketAction,
new RevisionParameterAction(bitbucketAction.getLatestCommit(), uri));
new RevisionParameterAction(bitbucketAction.getLatestCommit()));

Check warning on line 248 in src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/BitBucketPPRTrigger.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 248 is not covered by tests

QueueTaskFuture<? extends Run<?, ?>> f =
item != null ? (QueueTaskFuture) item.getFuture() : null;
Expand Down

0 comments on commit 85460cf

Please sign in to comment.