@NonNull @Override protected List<Action> retrieveActions(SCMSourceEvent 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<>(); result.add(new ObjectMetadataAction(null, giteaRepository.getDescription(), giteaRepository.getWebsite())); result.add(new GiteaLink("icon-gitea-repo", UriTemplate.buildFromTemplate(serverUrl) .path(UriTemplateBuilder.var("owner")) .path(UriTemplateBuilder.var("repository")) .build() .set("owner", repoOwner) .set("repository", repository) .expand() )); return result; }
@Nonnull public static Map<String, String> getEnVars(@Nonnull Run<?, ?> run) throws EnvInjectException { Action envInjectAction = EnvInjectActionRetriever.getEnvInjectAction(run); if (envInjectAction != null) { try { Method method = envInjectAction.getClass().getMethod("getEnvMap"); return (Map<String, String>) method.invoke(envInjectAction); } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | ClassCastException e) { throw new EnvInjectException(e); } } // Retrieve node used for this build Node builtOn = (run instanceof AbstractBuild) ? ((AbstractBuild)run).getBuiltOn() : null; // Check if node is always on. Otherwise, gather master env vars if (builtOn == null) { return getFallBackMasterNode(run.getParent()); } if (builtOn.getRootPath() == null) { return getFallBackMasterNode(run.getParent()); } // Get envVars from the node of the last build return getDefaultEnvVarsJob(run.getParent(), builtOn); }
/** * {@inheritDoc} */ @NonNull @Override protected List<Action> retrieveActions(@NonNull SCMNavigatorOwner owner, SCMNavigatorEvent event, @NonNull TaskListener listener) throws IOException, InterruptedException { List<Action> result = new ArrayList<>(super.retrieveActions(owner, event, listener)); ASFGitSCMNavigatorContext context = new ASFGitSCMNavigatorContext().withTraits(traits); String avatarUrl = context.avatarUrl(); if (avatarUrl != null) { String avatarDescription = context.avatarDescription(); result.add(new ASFAvatarMetadataAction(avatarUrl, avatarDescription)); } String objectUrl = context.objectUrl(); String objectDescription = context.objectDescription(); String objectDisplayName = context.objectDisplayName(); if (objectUrl != null || objectDescription != null || objectDisplayName != null) { result.add(new ObjectMetadataAction(objectDisplayName, objectDescription, objectUrl)); } return result; }
@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()); if (acceptMergeRequest(head)) { boolean removeSourceBranch = mr.getRemoveSourceBranch() || removeSourceBranch(head); actions.add(new GitLabSCMAcceptMergeRequestAction(mr.getProjectId(), mr.getId(), 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; }
@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; }
public static List<Action> setJobRunParamsFromEnvAndUIParams(WorkflowJob job, JenkinsPipelineBuildStrategy strat, List<Action> buildActions, ParametersAction params) { List<EnvVar> envs = strat.getEnv(); List<ParameterValue> envVarList = new ArrayList<ParameterValue>(); if (envs.size() > 0) { // build list of env var keys for compare with existing job params for (EnvVar env : envs) { envVarList.add(new StringParameterValue(env.getName(), env.getValue())); } } if (params != null) envVarList.addAll(params.getParameters()); if (envVarList.size() > 0) buildActions.add(new ParametersAction(envVarList)); return buildActions; }
public void testGetProjectActionHavingLastBuildGivesStarWarsAction() { AbstractProject mockProject = mock(AbstractProject.class); Build mockBuild = mock(Build.class); Quote expectedQuote = generateQuote(StarWarsResult.SUCCESS); when(mockProject.getLastBuild()).thenReturn(mockBuild); when(mockBuild.getResult()).thenReturn(Result.SUCCESS); when(mockQuotesGenerator.generate(StarWarsResult.SUCCESS)).thenReturn(expectedQuote); Action action = recorder.getProjectAction(mockProject); assertTrue(action instanceof StarWarsAction); assertEquals(StarWarsResult.SUCCESS, ((StarWarsAction) action).getResult()); assertNotNull(((StarWarsAction) action).getQuote()); }
public void testPerformWithFailureResultAddsStarWarsActionWithFailResultAndExpectedQuote() throws Exception { List<Action> actions = new ArrayList<Action>(); Quote expectedQuote = generateQuote(StarWarsResult.FAIL); AbstractBuild mockBuild = mock(AbstractBuild.class); when(mockBuild.getResult()).thenReturn(Result.FAILURE); when(mockBuild.getActions()).thenReturn(actions); mockQuotesGenerator.add(expectedQuote); when(mockQuotesGenerator.generate(StarWarsResult.FAIL)).thenReturn(expectedQuote); assertEquals(0, actions.size()); Launcher mockLauncher = mock(Launcher.class); BuildListener mockBuildListener = mock(BuildListener.class); recorder.perform(mockBuild, mockLauncher, mockBuildListener); assertEquals(1, actions.size()); assertTrue(actions.get(0) instanceof StarWarsAction); StarWarsAction action = (StarWarsAction) actions.get(0); assertEquals(StarWarsResult.FAIL, action.getResult()); assertEquals(expectedQuote, action.getQuote()); }
/** * Gets the {@link DockerTraceabilityRootAction} of Jenkins instance. * @return Instance or null if it is not available */ public static @CheckForNull DockerTraceabilityRootAction getInstance() { Jenkins j = Jenkins.getInstance(); if (j == null) { return null; } @CheckForNull DockerTraceabilityRootAction action = null; for (Action rootAction : j.getActions()) { if (rootAction instanceof DockerTraceabilityRootAction) { action = (DockerTraceabilityRootAction) rootAction; break; } } return action; }
@Override public Action getProjectAction(final AbstractProject<?, ?> project) { log.info("Gebe Projektaktion aus, Klasse: " + project.getClass() + " Instanz von Projekt: " + (project instanceof Project)); if (project instanceof AbstractProject) { lastProject = project; VisualizeAction va = new VisualizeAction(project, this); lastVisulizeAction = va; log.info("Visualizer: " + va.getVisualizer().size()); collectorNames = va.getCollectorNames(); testNames = va.getTestNames(); testcases = new LinkedList<GraphVisualizer>(); for (GraphVisualizer gv : va.getVisualizer()) { log.info("Füge Testcase hinzu: " + gv.getName()); testcases.add(gv); } log.info("Aktion: " + va); return va; } else { log.log(Level.ALL, "Unexpected Class: " + project.getClass()); } return null; }
public static final void mergeParameters(List<Action> actions) { List<ParameterValue> pv = new LinkedList<ParameterValue>(); Iterator<Action> iter = actions.iterator(); while (iter.hasNext()) { Action a = iter.next(); if (!(a instanceof ParametersAction)) { continue; } ParametersAction pa = (ParametersAction) a; pv.addAll(pa.getParameters()); iter.remove(); } if (!pv.isEmpty()) { actions.add(new ParametersAction(pv)); } }
/** * Creates and returns one single <code>{@link * InheritanceListAction}</code> that will be added to the * given job. * * <p>The returned <code>{@link InheritanceListAction}</code> * will be added by Jenkins to the given job as a transient * action. Transient actions are not persisted.</p> * * The purpose of the returned <code>{@link * InheritanceListAction}</code> is to add a section to the job * detail page with an inheritance diagram in case the job is of * type inheritance project.</p> * * <p>This method is automatically called by Jenkins during the * initialisation of a job object.</p> * * @param target The job for which we are to create our action. * * @return A collection with one single <code>{@link * InheritanceListAction}</code> instance. */ @Override public Collection<? extends Action> createFor( @SuppressWarnings("rawtypes") final AbstractProject target ) { Collection<Action> result; if (target instanceof InheritanceProject) { InheritanceProject job = (InheritanceProject) target; InheritanceListService service = getService(); Action action = new InheritanceListAction(job, service); result = Collections.singleton(action); log.fine(String.format( "Added %s to job '%s'", InheritanceListAction.class.getSimpleName(), job.getFullName() )); } else { result = Collections.emptyList(); } return result; }
@SuppressWarnings("deprecation") public static List<StaticAnalysisResult> getResults(AbstractBuild<?, ?> build) { if (build != null) { if (JenkinsUtil.isPluginInstalled(ANALYSIS_CORE_PLUGIN)) { List<StaticAnalysisResult> result = new ArrayList<>(); for (Action action : build.getActions()) { if (AbstractResultAction.class.isInstance(action) || MavenResultAction.class.isInstance(action)) { @SuppressWarnings("rawtypes") final BuildResult r = ((ResultAction) action).getResult(); result.add(new StaticAnalysisResult( action.getDisplayName(), build.getUrl() + action.getUrlName(), r.getNumberOfHighPriorityWarnings(), r.getNumberOfNormalPriorityWarnings(), r.getNumberOfLowPriorityWarnings())); } } return result; } } return Collections.emptyList(); }
/** * Test method for {@see org.jenkinsci.plugins.neoload.integration.supporting.PluginUtils#addActionIfNotExists(hudson.model.AbstractBuild)}. */ @Test public void testAddActionIfNotExistsDontAdd() { final List<Action> actions = new ArrayList<Action>(); actions.add(mock(Action.class)); actions.add(mock(Action.class)); actions.add(mock(Action.class)); actions.add(mock(NeoResultsAction.class)); final AbstractBuild abstractBuild = mo.getAbstractBuild(); when(abstractBuild.getActions()).thenReturn(actions); //NeoResultsAction.addActionIfNotExists(abstractBuild); Mockito.verify(abstractBuild, Mockito.never()).addAction((Action) Matchers.any()); }
@NonNull @Override protected List<Action> retrieveActions(@NonNull SCMNavigatorOwner owner, SCMNavigatorEvent event, @NonNull TaskListener listener) throws IOException, InterruptedException { if (this.giteaOwner == null) { try (GiteaConnection c = gitea(owner).open()) { this.giteaOwner = c.fetchUser(repoOwner); if (StringUtils.isBlank(giteaOwner.getEmail())) { this.giteaOwner = c.fetchOrganization(repoOwner); } } } List<Action> result = new ArrayList<>(); String objectUrl = UriTemplate.buildFromTemplate(serverUrl) .path("owner") .build() .set("owner", repoOwner) .expand(); result.add(new ObjectMetadataAction( Util.fixEmpty(giteaOwner.getFullName()), null, objectUrl) ); if (StringUtils.isNotBlank(giteaOwner.getAvatarUrl())) { result.add(new GiteaAvatar(giteaOwner.getAvatarUrl())); } result.add(new GiteaLink("icon-gitea-org", objectUrl)); if (giteaOwner instanceof GiteaOrganization) { String website = ((GiteaOrganization) giteaOwner).getWebsite(); if (StringUtils.isBlank(website)) { listener.getLogger().println("Organization URL: unspecified"); listener.getLogger().printf("Organization URL: %s%n", HyperlinkNote.encodeTo(website, StringUtils.defaultIfBlank(giteaOwner.getFullName(), website))); } } return result; }
public Collection<? extends Action> getProjectActions() { if (this.job != null && CollectionUtils.isEmpty(this.actions)) { this.actions = Collections.singletonList(new SQSActivityAction(this.job)); } if (this.actions == null) { this.actions = Collections.emptyList(); } return this.actions; }
/** {@inheritDoc} */ @NonNull @Override protected List<Action> retrieveActions( @CheckForNull SCMSourceEvent event, @NonNull TaskListener listener) throws IOException, InterruptedException { return doRetrieve( new Retriever<List<Action>>() { @Override public List<Action> run( GitClient client, String remoteName, Changes.QueryRequest queryRequest) throws IOException, InterruptedException { Map<String, String> symrefs = client.getRemoteSymbolicReferences(getRemote(), null); if (symrefs.containsKey(Constants.HEAD)) { // Hurrah! The Server is Git 1.8.5 or newer and our client has symref reporting String target = symrefs.get(Constants.HEAD); if (target.startsWith(Constants.R_HEADS)) { // shorten standard names target = target.substring(Constants.R_HEADS.length()); } List<Action> result = new ArrayList<>(); if (StringUtils.isNotBlank(target)) { result.add(new GitRemoteHeadRefAction(getRemote(), target)); } result.add(new GerritLogo()); return result; } // Give up, there's no way to get the primary branch return new ArrayList<>(); } }, new GitSCMSourceContext<>(null, SCMHeadObserver.none()).withTraits(getTraits()), listener, false); }
@Nonnull List<Action> retrieve(@CheckForNull SCMSourceEvent event, @Nonnull TaskListener listener) throws IOException { GitLabProject project = source.getProject(); return asList( new ObjectMetadataAction(project.getNameWithNamespace(), project.getDescription(), project.getWebUrl()), new GitLabProjectAvatarMetadataAction(project.getId(), source.getSourceSettings().getConnectionName()), GitLabLinkAction.toProject(project)); }
@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(); }
@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(); }
private static boolean isOpenShiftBuildCause(List<Action> actions) { for (Action action : actions) { if (action instanceof CauseAction) { CauseAction causeAction = (CauseAction) action; for (Cause cause : causeAction.getCauses()) { if (cause instanceof BuildCause) { return true; } } } } return false; }
private static CauseAction dumpCause(List<Action> actions) { for (Action action : actions) { if (action instanceof CauseAction) { CauseAction causeAction = (CauseAction) action; if (LOGGER.isLoggable(Level.FINE)) for (Cause cause : causeAction.getCauses()) { LOGGER.fine("cause: " + cause.getShortDescription()); } return causeAction; } } return null; }
private static ParametersAction dumpParams(List<Action> actions) { for (Action action : actions) { if (action instanceof ParametersAction) { ParametersAction paramAction = (ParametersAction) action; if (LOGGER.isLoggable(Level.FINE)) for (ParameterValue param : paramAction.getAllParameters()) { LOGGER.fine("param name " + param.getName() + " param value " + param.getValue()); } return paramAction; } } return null; }
/** * Gets the StarWarsAction as the project action. This is applicable for * each job and only when there's at least one build in the job. * * @param project * @return the project action */ @Override public final Action getProjectAction(final AbstractProject<?, ?> project) { Action action = null; if (project.getLastBuild() != null) { Result result = project.getLastBuild().getResult(); StarWarsResult starWarsResult = StarWarsResult.get(result); Quote quote = quotesGenerator.generate(starWarsResult); action = new StarWarsAction(starWarsResult, quote); } return action; }
public LinkedList<Action> getMavenProjectResult(){ if (project instanceof MavenModuleSet) { MavenModuleSet mavenProject = (MavenModuleSet) project; if (mavenProject.getPrebuilders().get(CxScanBuilder.class) != null || mavenProject.getPostbuilders().get(CxScanBuilder.class) != null) { LinkedList<Action> list = new LinkedList<Action>(); list.add(new CxProjectResult(project)); return list; } } return null; }
@Override @Nonnull public Collection<? extends Action> createFor(@Nonnull Job job) { try { if (nonNull(ghPRTriggerFromJob(job))) { return singleton(forProject(job)); } } catch (Exception ex) { LOGGER.error("Bad configured project {} - {}", job.getFullName(), ex.getMessage(), ex); } return Collections.emptyList(); }
@Nonnull @Override public Collection<? extends Action> getProjectActions() { final ArrayList<Action> actions = new ArrayList<>(); if (nonNull(getPollingLogAction())) { actions.add(getPollingLogAction()); } actions.add(getErrorsAction()); return actions; }
@Nonnull @Override public Collection<? extends Action> createFor(@Nonnull Job job) { try { if (nonNull(ghBranchTriggerFromJob(job))) { return Collections.singleton(forProject(job)); } } catch (Exception ex) { LOGGER.warn("Bad configured project {} - {}", job.getFullName(), ex.getMessage(), ex); } return Collections.emptyList(); }
@Test public void createForNullTrigger() { // when(job.getTrigger(GitHubPRTrigger.class)).thenReturn(null); PowerMockito.mockStatic(JobHelper.class); given(ghPRTriggerFromJob(job)) .willReturn(null); Collection<? extends Action> repoCollection = new GitHubPRRepositoryFactory().createFor(job); Assert.assertTrue(repoCollection instanceof List); Assert.assertTrue(repoCollection.isEmpty()); }
@CheckForNull public static GitHubPRRepository getRepo(Collection<? extends Action> repoCollection) { GitHubPRRepository repo = null; for (Iterator<GitHubPRRepository> iterator = (Iterator<GitHubPRRepository>) repoCollection.iterator(); iterator.hasNext(); ) { repo = iterator.next(); } return repo; }
@Override public Action getProjectAction(AbstractProject<?, ?> project) { if (!project.getBuilds().isEmpty() /*|| !project.getActions().isEmpty()*/) { BuildAction buildAction = project.getLastBuild().getAction(BuildAction.class); if (buildAction != null) { ProjectAction lastProject = buildAction.getProjectAction(); return new ProjectAction(project, lastProject.getModules()); } } return new ProjectAction(project); }
@Test public void containerIDs_CRUD() throws Exception { // TODO: replace by a helper method from the branch JenkinsRule.WebClient client = j.createWebClient(); @CheckForNull DockerTraceabilityRootAction action = null; for (Action rootAction : j.getInstance().getActions()) { if (rootAction instanceof DockerTraceabilityRootAction) { action = (DockerTraceabilityRootAction) rootAction; break; } } assertNotNull(action); final String id1 = FingerprintTestUtil.generateDockerId("1"); final String id2 = FingerprintTestUtil.generateDockerId("2"); final String id3 = FingerprintTestUtil.generateDockerId("3"); // Check consistency of create/update commands action.addContainerID(id1); assertEquals(1, action.getContainerIDs().size()); action.addContainerID(id2); assertEquals(2, action.getContainerIDs().size()); action.addContainerID(id2); assertEquals(2, action.getContainerIDs().size()); // Remove data using API. First entry is non-existent action.doDeleteContainer(id3); assertEquals(2, action.getContainerIDs().size()); action.doDeleteContainer(id1); assertEquals(1, action.getContainerIDs().size()); action.doDeleteContainer(id1); assertEquals(1, action.getContainerIDs().size()); // Reload the data and ensure the status has been persisted correctly action = new DockerTraceabilityRootAction(); assertEquals(1, action.getContainerIDs().size()); for (String id : action.getContainerIDs()) { assertEquals(id2, id); } }
/** * Get the action to display aggregated flaky information for all the tests for the given project * * @param project the project that is running * @return the action to display aggregated flaky information for all the tests */ @Override public Collection<Action> getProjectActions(AbstractProject<?, ?> project) { Collection<Action> actions = new ArrayList<Action>(); if (!project.isBuilding()) { HistoryAggregatedFlakyTestResultAction action = new HistoryAggregatedFlakyTestResultAction( project); action.aggregate(); TestFlakyStatsOverRevision testFlakyStatsOverRevision = new TestFlakyStatsOverRevision(project, action); actions.add(testFlakyStatsOverRevision); actions.add(action); } return actions; }
@Override public Collection<? extends Action> createFor(AbstractProject target) { if (target.getProperty(DeployNowJobProperty.class) == null) { return Arrays.asList(new DeployNowProjectAction(target)); } return Collections.emptySet(); }
@Override public Collection<? extends Action> createFor(Run target) { Job job = target.getParent(); if (job instanceof AbstractProject && CapabilitiesResolver.of((AbstractProject)job).isInstantApplicable()) { if (target.getActions(DeployNowRunAction.class).isEmpty()) { return Collections.singleton(new DeployNowRunAction(target)); } } return Collections.emptySet(); }
/** * Creates resend-actions for the given build. * * @param target for which the action objects are requested. Never null. * @return Can be empty but must not be null. */ @Override public Collection<? extends Action> createFor(Run target) { if (target instanceof AbstractBuild ) { final AbstractBuild<?, ?> build = (AbstractBuild)target; return getResendAction(build); } else { return Collections.emptyList(); } }
/** * Returns all the Grapes resend action of the build (never null, empty list if there is none) * * @param build AbstractBuild<?, ?> * @return List<ResendBuildAction> */ private List<ResendBuildAction> getAllResendActions(final AbstractBuild<?, ?> build) { final List<ResendBuildAction> resendActions = new ArrayList<ResendBuildAction>(); for(Action transientAction: build.getTransientActions()){ if(transientAction instanceof ResendBuildAction){ resendActions.add((ResendBuildAction)transientAction); } } return resendActions; }
/** {@inheritDoc} */ @Override public List<Action> getActions() { YamlHistoryAction action = YamlHistoryAction.of(getLastBuild()); if (action == null) { return super.getActions(); } // Delegate to the nested build. return action.getProject(this).getActions(); }
private void handleMergeRequest(Job<?, ?> job, PushHook hook, boolean ciSkip, BranchFilter branchFilter, GitLabClient client, MergeRequest mergeRequest) { if (ciSkip && mergeRequest.getDescription() != null && mergeRequest.getDescription().contains("[ci-skip]")) { LOGGER.log(Level.INFO, "Skipping MR " + mergeRequest.getTitle() + " due to ci-skip."); return; } Boolean workInProgress = mergeRequest.getWorkInProgress(); if (skipWorkInProgressMergeRequest && workInProgress != null && workInProgress) { LOGGER.log(Level.INFO, "Skip WIP Merge Request #{0} ({1})", toArray(mergeRequest.getIid(), mergeRequest.getTitle())); return; } String targetBranch = mergeRequest.getTargetBranch(); String sourceBranch = mergeRequest.getSourceBranch(); if (targetBranch != null && branchFilter.isBranchAllowed(targetBranch) && hook.getRef().equals("refs/heads/"+targetBranch) && sourceBranch != null) { LOGGER.log(Level.INFO, "{0} triggered for push to target branch of open merge request #{1}.", LoggerUtil.toArray(job.getFullName(), mergeRequest.getId())); Branch branch = client.getBranch(mergeRequest.getSourceProjectId().toString(), sourceBranch); Project project = client.getProject(mergeRequest.getSourceProjectId().toString()); String commit = branch.getCommit().getId(); setCommitStatusPendingIfNecessary(job, mergeRequest.getSourceProjectId(), commit, branch.getName()); List<Action> actions = Arrays.<Action>asList(new CauseAction(new GitLabWebHookCause(retrieveCauseData(hook, project, mergeRequest, branch))), new RevisionParameterAction(commit, retrieveUrIish(hook))); scheduleBuild(job, actions.toArray(new Action[actions.size()])); } }
private void scheduleBuild(Job<?, ?> job, Action[] actions) { int projectBuildDelay = 0; if (job instanceof ParameterizedJobMixIn.ParameterizedJob) { ParameterizedJobMixIn.ParameterizedJob abstractProject = (ParameterizedJobMixIn.ParameterizedJob) job; if (abstractProject.getQuietPeriod() > projectBuildDelay) { projectBuildDelay = abstractProject.getQuietPeriod(); } } retrieveScheduleJob(job).scheduleBuild2(projectBuildDelay, actions); }