/** * @return DiskUsage for given project (shortcut for the view). Never null. */ public ProjectDiskUsageAction getDiskUsage(Job project) { ProjectDiskUsageAction action = project.getAction(ProjectDiskUsageAction.class); return action; }
public PromotedProjectAction getAction(Job job) { PromotedProjectAction action = job.getAction(PromotedProjectAction.class); return action; }
public <T extends Action> T superGetAction(Class<T> type) { return super.getAction(type); }
public Action superGetAction(int index) { return super.getAction(index); }
@CheckForNull public static GitHubBranchRepository getBranchRepositoryFor(Item item) { if (item instanceof Job) { Job<?, ?> job = (Job) item; return job.getAction(GitHubBranchRepository.class); } return null; }
@CheckForNull public static GitHubPRRepository getPRRepositoryFor(Item item) { if (item instanceof Job) { Job<?, ?> job = (Job) item; return job.getAction(GitHubPRRepository.class); } return null; } }
/** * Selects the action to show the results from. This default implementation * simply returns the first action that matches the given type. * * @param job * the job to get the action from * @return the action */ protected AbstractProjectAction<?> selectAction(final Job<?, ?> job) { return job.getAction(getAction()); }
private CoberturaBuildAction getAction(final Job<?, ?> project) { CoberturaProjectAction action = project.getAction(CoberturaProjectAction.class); if (action != null) { return action.getLastResult(); } return null; }
/** * Selects the action to show the results from. This default implementation * simply returns the first action that matches the given type. * * @param job * the job to get the action from * @return the action */ protected AbstractProjectAction<?> selectAction(final Job<?, ?> job) { return job.getAction(getAction()); }
private T getProjectAction(final Job<?, ?> project) { return project.getAction(getProjectAction()); }
/** * Selects the action to show the results from. This default implementation * simply returns the first action that matches the given type. * * @param job * the job to get the action from * @return the action */ @CheckForNull protected AbstractProjectAction<?> selectAction(final Job<?, ?> job) { if (job == null) { return null; } else { return job.getAction(getAction()); } } }
/** * Selects the action to show the results from. This default implementation * simply returns the first action that matches the given type. * * @param job * the job to get the action from * @return the action */ @CheckForNull protected AbstractProjectAction<?> selectAction(final Job<?, ?> job) { if (job == null) { return null; } else { return job.getAction(getAction()); } } }
private GitLabSCMHeadMetadataAction getMetadataAction(Run<?, ?> build) { GitLabSCMHeadMetadataAction metadata = build.getAction(GitLabSCMHeadMetadataAction.class); if (metadata == null) { metadata = build.getParent().getAction(GitLabSCMHeadMetadataAction.class); } return metadata; } }
/** * @return DiskUsage for given project (shortcut for the view). Never null. */ public static DiskUsage getDiskUsage(Job project) { ProjectDiskUsageAction action = project.getAction(ProjectDiskUsageAction.class); if (action != null) { return action.getDiskUsage(); } return new DiskUsage(0, 0); }
@Override public <T extends Action> T getAction(Class<T> type) { initPython(); if (pexec.isImplemented(105)) { return (T) pexec.execPython("get_action", type); } else { return super.getAction(type); } }
@Override public void onCompleted(Run<?, ?> build, @Nonnull TaskListener listener) { GitLabSCMHeadMetadataAction metadata = getMetadataAction(build); GitLabSCMPublishAction publishAction = build.getParent().getAction(GitLabSCMPublishAction.class); if (metadata != null && publishAction != null) { publishAction.publishResult(build, metadata); } if (build.getResult() == SUCCESS) { GitLabSCMAcceptMergeRequestAction acceptAction = build.getParent().getAction(GitLabSCMAcceptMergeRequestAction.class); if (acceptAction != null) { acceptAction.acceptMergeRequest(build, listener); } } }
@Override public Action getAction(int index) { initPython(); if (pexec.isImplemented(104)) { return (Action) pexec.execPython("get_action", DataConvertor.fromInt(index)); } else { return super.getAction(index); } }
@Override public void onStarted(Run<?, ?> build, TaskListener listener) { GitLabSCMHeadMetadataAction metadata = getMetadataAction(build); GitLabSCMPublishAction publishAction = build.getParent().getAction(GitLabSCMPublishAction.class); if (metadata != null && publishAction != null) { GitLabSCMCauseAction cause = build.getAction(GitLabSCMCauseAction.class); String description = (cause != null) ? cause.getDescription() : ""; publishAction.updateBuildDescription(build, description, listener); publishAction.publishStarted(build, metadata, description); } }
CoberturaProjectAction action = project.getAction(CoberturaProjectAction.class);
TestResultProjectAction testResults = job.getAction(TestResultProjectAction.class);