jenkins.scm.api.SCMHeadEvent Java Examples

The following examples show how to use jenkins.scm.api.SCMHeadEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GHMultiBranchSubscriber.java    From github-integration-plugin with MIT License 6 votes vote down vote up
@Override
protected void onEvent(GHSubscriberEvent event) {
    try {
        BranchInfo ref = extractRefInfo(event.getGHEvent(), event.getPayload(), true);

        if (ref.isTag()) {
            SCMHeadEvent.fireNow(new GitHubTagSCMHeadEvent(
                    SCMEvent.Type.UPDATED,
                    event.getTimestamp(),
                    ref,
                    ref.getRepo())
            );
        } else {
            SCMHeadEvent.fireNow(new GitHubBranchSCMHeadEvent(
                    SCMEvent.Type.UPDATED,
                    event.getTimestamp(),
                    ref,
                    ref.getRepo())
            );
        }

    } catch (Exception e) {
        LOGGER.error("Can't process {} hook", event, e);
    }
}
 
Example #2
Source File: GitLabSCMSource.java    From gitlab-branch-source-plugin with MIT License 6 votes vote down vote up
@NonNull
@Override
protected List<Action> retrieveActions(@NonNull SCMRevision revision, SCMHeadEvent event,
        @NonNull TaskListener listener) throws IOException, InterruptedException {
    List<Action> actions = new ArrayList<>();
    if (revision instanceof SCMRevisionImpl) {
        String hash = ((SCMRevisionImpl) revision).getHash();
        String commitUrl = commitUriTemplate(serverName).set("project", splitPath(projectPath)).set("hash", hash)
                .expand();
        actions.add(GitLabLink.toCommit(commitUrl));
    }

    if (event instanceof AbstractGitLabSCMHeadEvent) {
        actions.add(new GitLabSCMCauseAction(((AbstractGitLabSCMHeadEvent) event).getCause()));
    }

    return actions;
}
 
Example #3
Source File: GHPRMultiBranchSubscriber.java    From github-integration-plugin with MIT License 6 votes vote down vote up
@Override
protected void onEvent(GHSubscriberEvent event) {
    try {
        GitHub gh = GitHub.offline();

        PullRequestInfo ref = extractPullRequestInfo(event.getGHEvent(), event.getPayload(), gh);
        SCMHeadEvent.fireNow(new GitHubPullRequestScmHeadEvent(
                SCMEvent.Type.UPDATED,
                event.getTimestamp(),
                ref,
                ref.getRepo())
        );

    } catch (Exception e) {
        LOG.error("Can't process {} hook", event, e);
    }
}
 
Example #4
Source File: SourceActions.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 6 votes vote down vote up
@Nonnull
private List<Action> retrieve(@Nonnull SCMRevisionImpl revision, @CheckForNull SCMHeadEvent event, @Nonnull TaskListener listener) throws IOException, InterruptedException {
    List<Action> actions = new ArrayList<>();

    String hash = revision.getHash();
    Action linkAction = GitLabLinkAction.toCommit(source.getProject(), hash);
    actions.add(linkAction);

    SCMHead head = revision.getHead();
    if (head instanceof GitLabSCMMergeRequestHead) {
        actions.add(createHeadMetadataAction(head.getName(), ((GitLabSCMMergeRequestHead) head).getSource(), hash, linkAction.getUrlName()));
    } else if (head instanceof GitLabSCMHead) {
        actions.add(createHeadMetadataAction(head.getName(), (GitLabSCMHead) head, hash, linkAction.getUrlName()));
    }

    if (event instanceof GitLabSCMEvent) {
        actions.add(new GitLabSCMCauseAction(((GitLabSCMEvent) event).getCause()));
    }

    return actions;
}
 
Example #5
Source File: HookHandler.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 6 votes vote down vote up
private void handle(String id, GitLabHookEventType eventType, HttpServletRequest request) throws IOException {
    LOGGER.fine("handling hook for " + id + " for eventType " + eventType);
    try {
        String requestBody = getRequestBody(request);
        switch (eventType) {
            case PUSH:
                SCMHeadEvent.fireNow(new GitLabSCMPushEvent(id, readHook(PushHook.class, requestBody), originOf(request)));
                break;
            case TAG_PUSH:
                SCMHeadEvent.fireNow(new GitLabSCMTagPushEvent(id, readHook(PushHook.class, requestBody), originOf(request)));
                break;
            case MERGE_REQUEST:
                argelbargel.jenkins.plugins.gitlab_branch_source.api.Hooks.MergeRequestHook hookAction= readHookTemp(argelbargel.jenkins.plugins.gitlab_branch_source.api.Hooks.MergeRequestHook.class, requestBody);
                SCMHeadEvent.fireNow(GitLabSCMMergeRequestEvent.create(id, readHook(MergeRequestHook.class, requestBody),hookAction.getObjectAttributes().getAction(), originOf(request)));
                break;
            case SYSTEM_HOOK:
                handleSystemHook(id, request,requestBody);
                break;
            default:
                LOGGER.warning("ignoring hook: " + eventType);
                throw new IllegalArgumentException("cannot handle hook-event of type " + eventType);
        }
    } catch (Exception e) {
        LOGGER.log(Level.WARNING, "GitLabHookEventType", e);
    }
}
 
Example #6
Source File: SourceActions.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 5 votes vote down vote up
@Nonnull
List<Action> retrieve(@Nonnull SCMRevision revision, @CheckForNull SCMHeadEvent event, @Nonnull TaskListener listener) throws IOException, InterruptedException {
    if (revision instanceof SCMRevisionImpl) {
        return retrieve((SCMRevisionImpl) revision, event, listener);
    }

    return emptyList();
}
 
Example #7
Source File: GitHubSourceContext.java    From github-integration-plugin with MIT License 5 votes vote down vote up
public GitHubSourceContext(@Nonnull GitHubSCMSource source,
                           @Nonnull SCMHeadObserver observer,
                           @Nonnull SCMSourceCriteria criteria,
                           @Nullable SCMHeadEvent<?> scmHeadEvent,
                           @Nonnull GitHubRepo localRepo,
                           @Nonnull GHRepository remoteRepo,
                           @Nonnull TaskListener listener) {
    this.source = source;
    this.observer = observer;
    this.criteria = criteria;
    this.scmHeadEvent = scmHeadEvent;
    this.localRepo = localRepo;
    this.remoteRepo = remoteRepo;
    this.listener = listener;
}
 
Example #8
Source File: SourceActions.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 5 votes vote down vote up
@Nonnull
private List<Action> retrieve(@Nonnull GitLabSCMHead head, @CheckForNull SCMHeadEvent event, @Nonnull TaskListener listener) throws IOException, InterruptedException {
    List<Action> actions = new ArrayList<>();

    actions.add(new GitLabSCMPublishAction(head, source.getSourceSettings()));

    Action linkAction;

    if (head instanceof ChangeRequestSCMHead) {
        GitLabMergeRequest mr = retrieveMergeRequest((ChangeRequestSCMHead) head, listener);
        linkAction = GitLabLinkAction.toMergeRequest(mr.getWebUrl());
        actions.add(createAuthorMetadataAction(mr));
        actions.add(createHeadMetadataAction(((GitLabSCMMergeRequestHead) head).getDescription(), ((GitLabSCMMergeRequestHead) head).getSource(), null, linkAction.getUrlName()));
        if (acceptMergeRequest(head)) {
            boolean removeSourceBranch = mr.getRemoveSourceBranch() || removeSourceBranch(head);
            actions.add(new GitLabSCMAcceptMergeRequestAction(mr, mr.getIid(), source.getSourceSettings().getMergeCommitMessage(), removeSourceBranch));
        }
    } else {
        linkAction = (head instanceof TagSCMHead) ? GitLabLinkAction.toTag(source.getProject(), head.getName()) : GitLabLinkAction.toBranch(source.getProject(), head.getName());
        if (head instanceof GitLabSCMBranchHead && StringUtils.equals(source.getProject().getDefaultBranch(), head.getName())) {
            actions.add(new PrimaryInstanceMetadataAction());
        }
    }

    actions.add(linkAction);
    return actions;
}
 
Example #9
Source File: SourceActions.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 5 votes vote down vote up
@Nonnull
List<Action> retrieve(@Nonnull SCMHead head, @CheckForNull SCMHeadEvent event, @Nonnull TaskListener listener) throws IOException, InterruptedException {
    if (head instanceof GitLabSCMHead) {
        return retrieve((GitLabSCMHead) head, event, listener);
    }

    return emptyList();
}
 
Example #10
Source File: GitHubSCMSource.java    From github-integration-plugin with MIT License 5 votes vote down vote up
@Nonnull
@Override
protected List<Action> retrieveActions(@Nonnull SCMHead head,
                                       @CheckForNull SCMHeadEvent event,
                                       @Nonnull TaskListener listener)
        throws IOException, InterruptedException {
    List<Action> actions = new ArrayList<>();

    GHRepository remoteRepo = getRemoteRepo();

    boolean primary = false;
    GitHubLinkAction link = null;
    String desc = null;

    if (head instanceof GitHubBranchSCMHead) {
        // mark default branch item as primary
        primary = remoteRepo.getDefaultBranch().equals(head.getName());
        link = new GitHubBranchAction(remoteRepo, head.getName());
        desc = null;
    } else if (head instanceof GitHubTagSCMHead) {
        link = new GitHubTagAction(remoteRepo, head.getName());
        desc = null;
    } else if (head instanceof GitHubPRSCMHead) {
        GitHubPRSCMHead prHead = (GitHubPRSCMHead) head;
        link = new GitHubPRAction(remoteRepo, prHead.getPrNumber());
        desc = remoteRepo.getPullRequest(prHead.getPrNumber()).getTitle();
    }

    if (nonNull(link)) {
        actions.add(link);
    }

    actions.add(new ObjectMetadataAction(null, desc, isNull(link) ? null : link.getUrlName()));
    if (primary) {
        actions.add(new PrimaryInstanceMetadataAction());
    }

    return actions;
}
 
Example #11
Source File: GitHubSCMSource.java    From github-integration-plugin with MIT License 5 votes vote down vote up
@Nonnull
@Override
protected List<Action> retrieveActions(@Nonnull SCMRevision revision, @CheckForNull SCMHeadEvent event,
                                       @Nonnull TaskListener listener) throws IOException, InterruptedException {
    GitHubSCMRevision gitHubSCMRevision = (GitHubSCMRevision) revision;
    GitHubCause<?> cause = gitHubSCMRevision.getCause();
    if (nonNull(cause)) {
        List<ParameterValue> params = new ArrayList<>();
        cause.fillParameters(params);
        return Arrays.asList(new CauseAction(cause), new GitHubParametersAction(params));
    }

    return Collections.emptyList();
}
 
Example #12
Source File: GitHubSCMSource.java    From github-integration-plugin with MIT License 5 votes vote down vote up
@Override
protected void retrieve(SCMSourceCriteria scmSourceCriteria, @Nonnull SCMHeadObserver scmHeadObserver,
                        SCMHeadEvent<?> scmHeadEvent, // null for manual run
                        @Nonnull TaskListener taskListener) throws IOException, InterruptedException {

    try (BulkChange bc = new BulkChange(getLocalStorage());
         TreeCache.Context ctx = TreeCache.createContext()) {
        GitHubRepo localRepo = getLocalRepo();

        // latch onto local repo state
        synchronized (localRepo) {
            localRepo.actualize(getRemoteRepo());

            GitHubSourceContext context = new GitHubSourceContext(this, scmHeadObserver, scmSourceCriteria,
                    scmHeadEvent, localRepo, getRemoteRepo(), taskListener);

            getHandlers().forEach(handler -> {
                try {
                    handler.handle(context);
                } catch (Throwable e) {
                    LOG.error("Can't process handler", e);
                    e.printStackTrace(taskListener.getLogger());
                }
            });
        }

        bc.commit();
    }
}
 
Example #13
Source File: GitHubPRHandler.java    From github-integration-plugin with MIT License 4 votes vote down vote up
@Override
public void handle(@Nonnull GitHubSourceContext context) throws IOException {

    Integer prNumber;

    SCMHeadEvent<?> scmHeadEvent = context.getScmHeadEvent();
    if (scmHeadEvent instanceof GitHubPullRequestScmHeadEvent) {
        PullRequestInfo info = (PullRequestInfo) scmHeadEvent.getPayload();
        prNumber = info.getNum();
    } else if (scmHeadEvent != null) {
        // not our event, skip completely
        return;
    } else {
        prNumber = null;
    }

    TaskListener listener = context.getListener();
    GHRepository remoteRepo = context.getRemoteRepo();
    GitHubPRRepository localRepo = Objects.requireNonNull(context.getLocalRepo().getPrRepository());
    GitHubPRRepository oldRepo = new GitHubPRRepository(remoteRepo);
    oldRepo.getPulls().putAll(localRepo.getPulls());

    // prepare for run and fetch remote prs
    Stream<GHPullRequest> pulls;
    if (prNumber != null) {
        listener.getLogger().println("**** Processing pull request #" + prNumber + " ****");
        pulls = ioOptStream(() -> execute(() -> remoteRepo.getPullRequest(prNumber)));
        localRepo.getPulls().remove(prNumber);
    } else {
        listener.getLogger().println("**** Processing all pull requests ****");
        pulls = fetchRemotePRs(localRepo, remoteRepo);
        localRepo.getPulls().clear();
    }

    processCauses(context, pulls
            // filter out uninteresting
            .filter(iop(pr -> context.checkCriteria(new GitHubPRCause(pr, localRepo, "Check", false))))
            // update local state
            .map(updateLocalRepo(localRepo))
            // filter out bad ones
            .filter(badState(localRepo, listener))
            // TODO: move this logic to an event?
            // .filter(notUpdated(localRepo, listener))
            // create causes
            .map(toCause(context, oldRepo)));

    listener.getLogger().println("**** Done processing pull requests ****");
}
 
Example #14
Source File: EventsTest.java    From github-branch-source-plugin with MIT License 4 votes vote down vote up
public void onSCMHeadEvent(SCMHeadEvent<?> event) {
    receiveEvent(event.getType(), event.getOrigin());
}
 
Example #15
Source File: FreeStyleMultiBranchProjectTest.java    From multi-branch-project-plugin with MIT License 4 votes vote down vote up
private void fire(MockSCMHeadEvent event) throws Exception {
    long watermark = SCMEvents.getWatermark();
    SCMHeadEvent.fireNow(event);
    SCMEvents.awaitAll(watermark);
    r.waitUntilNoActivity();
}
 
Example #16
Source File: GitHubBranchHandler.java    From github-integration-plugin with MIT License 4 votes vote down vote up
@Override
public void handle(@Nonnull GitHubSourceContext context) throws IOException {

    String branchName;

    SCMHeadEvent<?> scmHeadEvent = context.getScmHeadEvent();
    if (scmHeadEvent instanceof GitHubBranchSCMHeadEvent) {
        BranchInfo info = (BranchInfo) scmHeadEvent.getPayload();
        branchName = info.getBranchName();
    } else if (scmHeadEvent != null) {
        // not our event, skip completely
        return;
    } else {
        branchName = null;
    }

    TaskListener listener = context.getListener();
    GHRepository remoteRepo = context.getRemoteRepo();
    GitHubBranchRepository localRepo = Objects.requireNonNull(context.getLocalRepo().getBranchRepository());
    GitHubBranchRepository oldRepo = new GitHubBranchRepository(remoteRepo);
    oldRepo.getBranches().putAll(localRepo.getBranches());

    // prepare for run and fetch remote branches
    Stream<GHBranch> branches;
    if (branchName != null) {
        listener.getLogger().println("**** Processing branch " + branchName + " ****");
        branches = ioOptStream(() -> remoteRepo.getBranch(branchName));
        localRepo.getBranches().remove(branchName);
    } else {
        listener.getLogger().println("**** Processing all branches ****");
        branches = fetchRemoteBranches(remoteRepo).values().stream();
        localRepo.getBranches().clear();
    }

    processCauses(context, branches
            // filter out uninteresting
            .filter(iop(b -> context.checkCriteria(new GitHubBranchCause(b, localRepo, "Check", false))))
            // update local state
            .map(updateLocalRepo(localRepo))
            // create causes
            .map(toCause(context, oldRepo)));

    listener.getLogger().println("**** Done processing branches ****");
}
 
Example #17
Source File: GitHubSourceContext.java    From github-integration-plugin with MIT License 4 votes vote down vote up
public SCMHeadEvent<?> getScmHeadEvent() {
    return scmHeadEvent;
}
 
Example #18
Source File: GitHubTagHandler.java    From github-integration-plugin with MIT License 4 votes vote down vote up
@Override
public void handle(@Nonnull GitHubSourceContext context) throws IOException {

    String tagName;

    SCMHeadEvent<?> scmHeadEvent = context.getScmHeadEvent();
    if (scmHeadEvent instanceof GitHubTagSCMHeadEvent) {
        BranchInfo info = (BranchInfo) scmHeadEvent.getPayload();
        tagName = info.getBranchName();
    } else if (scmHeadEvent != null) {
        // not our event, skip completely
        return;
    } else {
        tagName = null;
    }

    TaskListener listener = context.getListener();
    GHRepository remoteRepo = context.getRemoteRepo();
    GitHubTagRepository localRepo = Objects.requireNonNull(context.getLocalRepo().getTagRepository());
    GitHubTagRepository oldRepo = new GitHubTagRepository(remoteRepo);
    oldRepo.getTags().putAll(localRepo.getTags());

    // prepare for run and fetch remote tags
    Stream<GHTag> tags;
    if (tagName != null) {
        listener.getLogger().println("**** Processing tag " + tagName + " ****");
        tags = ioOptStream(() -> GitHubTag.findRemoteTag(remoteRepo, tagName));
        localRepo.getTags().remove(tagName);
    } else {
        listener.getLogger().println("**** Processing all tags ****");
        tags = GitHubTag.getAllTags(remoteRepo).stream();
        localRepo.getTags().clear();
    }

    processCauses(context, tags
            // filter out uninteresting
            .filter(iop(t -> context.checkCriteria(new GitHubTagCause(t, localRepo, "Check", false))))
            // update local state
            .map(updateLocalRepo(localRepo))
            // create causes
            .map(toCause(context, oldRepo)));

    listener.getLogger().println("**** Done processing tags ****");
}
 
Example #19
Source File: GitLabWebHookListener.java    From gitlab-branch-source-plugin with MIT License 4 votes vote down vote up
@Override
public void onMergeRequestEvent(MergeRequestEvent mrEvent) {
    LOGGER.log(Level.FINE, mrEvent.toString());
    GitLabMergeRequestSCMEvent trigger = new GitLabMergeRequestSCMEvent(mrEvent, origin);
    SCMHeadEvent.fireNow(trigger);
}
 
Example #20
Source File: PushGHEventSubscriber.java    From github-branch-source-plugin with MIT License 4 votes vote down vote up
private void fireAfterDelay(final SCMHeadEventImpl e) {
    SCMHeadEvent.fireLater(e, GitHubSCMSource.getEventDelaySeconds(), TimeUnit.SECONDS);
}
 
Example #21
Source File: PullRequestGHEventSubscriber.java    From github-branch-source-plugin with MIT License 4 votes vote down vote up
private void fireAfterDelay(final SCMHeadEventImpl e) {
    SCMHeadEvent.fireLater(e, GitHubSCMSource.getEventDelaySeconds(), TimeUnit.SECONDS);
}
 
Example #22
Source File: GitLabSCMSource.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 4 votes vote down vote up
@Nonnull
@Override
protected List<Action> retrieveActions(@Nonnull SCMRevision revision, @CheckForNull SCMHeadEvent event, @Nonnull TaskListener listener) throws IOException, InterruptedException {
    return actions.retrieve(revision, event, listener);
}
 
Example #23
Source File: GitLabSCMSource.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 4 votes vote down vote up
@Nonnull
@Override
protected List<Action> retrieveActions(@Nonnull SCMHead head, @CheckForNull SCMHeadEvent event, @Nonnull TaskListener listener) throws IOException, InterruptedException {
    return actions.retrieve(head, event, listener);
}
 
Example #24
Source File: GitLabSCMSource.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void retrieve(@CheckForNull SCMSourceCriteria criteria, @Nonnull SCMHeadObserver observer, @CheckForNull SCMHeadEvent<?> event, @Nonnull TaskListener listener) throws IOException, InterruptedException {
    listener.getLogger().format(Messages.GitLabSCMSource_retrievingHeadsForProject(project.getPathWithNamespace()) + "\n");
    heads.retrieve(criteria, observer, event, listener);
}
 
Example #25
Source File: GiteaSCMSource.java    From gitea-plugin with MIT License 4 votes vote down vote up
@NonNull
@Override
protected List<Action> retrieveActions(@NonNull SCMRevision revision, SCMHeadEvent event,
                                       @NonNull TaskListener listener) throws IOException, InterruptedException {
    return super.retrieveActions(revision, event, listener);
}
 
Example #26
Source File: GiteaSCMSource.java    From gitea-plugin with MIT License 4 votes vote down vote up
@NonNull
@Override
protected List<Action> retrieveActions(@NonNull SCMHead head, SCMHeadEvent event, @NonNull TaskListener listener)
        throws IOException, InterruptedException {
    if (giteaRepository == null) {
        try (GiteaConnection c = gitea().open()) {
            listener.getLogger().format("Looking up repository %s/%s%n", repoOwner, repository);
            giteaRepository = c.fetchRepository(repoOwner, repository);
        }
    }
    List<Action> result = new ArrayList<>();
    if (head instanceof BranchSCMHead) {
        String branchUrl = UriTemplate.buildFromTemplate(serverUrl)
                .path(UriTemplateBuilder.var("owner"))
                .path(UriTemplateBuilder.var("repository"))
                .literal("/src/branch")
                .path(UriTemplateBuilder.var("branch"))
                .build()
                .set("owner", repoOwner)
                .set("repository", repository)
                .set("branch", head.getName())
                .expand();
        result.add(new ObjectMetadataAction(
                null,
                null,
                branchUrl
        ));
        result.add(new GiteaLink("icon-gitea-branch", branchUrl));
        if (head.getName().equals(giteaRepository.getDefaultBranch())) {
            result.add(new PrimaryInstanceMetadataAction());
        }
    } else if (head instanceof TagSCMHead) {
        String tagUrl = UriTemplate.buildFromTemplate(serverUrl)
                .path(UriTemplateBuilder.var("owner"))
                .path(UriTemplateBuilder.var("repository"))
                .literal("/src/tag")
                .path(UriTemplateBuilder.var("tag"))
                .build()
                .set("owner", repoOwner)
                .set("repository", repository)
                .set("tag", head.getName())
                .expand();
        result.add(new ObjectMetadataAction(
                null,
                null,
                tagUrl
        ));
        result.add(new GiteaLink("icon-gitea-branch", tagUrl));
        if (head.getName().equals(giteaRepository.getDefaultBranch())) {
            result.add(new PrimaryInstanceMetadataAction());
        }
    } else if (head instanceof PullRequestSCMHead) {
        String pullUrl = UriTemplate.buildFromTemplate(serverUrl)
                .path(UriTemplateBuilder.var("owner"))
                .path(UriTemplateBuilder.var("repository"))
                .literal("/pulls")
                .path(UriTemplateBuilder.var("id"))
                .build()
                .set("owner", repoOwner)
                .set("repository", repository)
                .set("id", ((PullRequestSCMHead) head).getId())
                .expand();
        result.add(new ObjectMetadataAction(
                null,
                null,
                pullUrl
        ));
        result.add(new GiteaLink("icon-gitea-branch", pullUrl));
    }
    return result;
}
 
Example #27
Source File: GiteaPullSCMEvent.java    From gitea-plugin with MIT License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void process(GiteaPullSCMEvent event) {
    SCMHeadEvent.fireNow(event);
}
 
Example #28
Source File: GiteaCreateSCMEvent.java    From gitea-plugin with MIT License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void process(GiteaCreateSCMEvent event) {
    SCMHeadEvent.fireNow(event);
}
 
Example #29
Source File: GiteaPushSCMEvent.java    From gitea-plugin with MIT License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void process(GiteaPushSCMEvent event) {
    SCMHeadEvent.fireNow(event);
}
 
Example #30
Source File: SkipInitialBuildOnFirstBranchIndexingTest.java    From basic-branch-build-strategies-plugin with MIT License 4 votes vote down vote up
private void fire(MockSCMHeadEvent event) throws Exception {
    long watermark = SCMEvents.getWatermark();
    SCMHeadEvent.fireNow(event);
    SCMEvents.awaitAll(watermark);
    j.waitUntilNoActivity();
}