code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
private void syncAssociatedAgentFromDB(AgentInstance agentInstance) { Agent agent = agentInstance.getAgent(); String uuid = agent.getUuid(); List<String> envNames = agent.getEnvironmentsAsList(); addAgentToNewlyAssociatedEnvironments(uuid, envNames); }
Understands grouping of agents and pipelines within an environment
syncAssociatedAgentFromDB
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/EnvironmentConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/EnvironmentConfigService.java
Apache-2.0
private boolean isEnvironmentAssociatedWithAgentLocally(EnvironmentConfig envConfig, String uuid) { return envConfig != null && envConfig.hasAgent(uuid) && !envConfig.containsAgentRemotely(uuid); }
Understands grouping of agents and pipelines within an environment
isEnvironmentAssociatedWithAgentLocally
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/EnvironmentConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/EnvironmentConfigService.java
Apache-2.0
private boolean isEnvironmentNotAssociatedWithAgent(EnvironmentConfig envConfig, String uuid) { return envConfig != null && !envConfig.hasAgent(uuid); }
Understands grouping of agents and pipelines within an environment
isEnvironmentNotAssociatedWithAgent
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/EnvironmentConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/EnvironmentConfigService.java
Apache-2.0
private List<EnvironmentPipelineModel> getAllPipelinesForUser(Username user, List<PipelineConfig> pipelineConfigs) { List<EnvironmentPipelineModel> pipelines = new ArrayList<>(); for (PipelineConfig pipelineConfig : pipelineConfigs) { String pipelineName = str(pipelineConfig.name()); ...
Understands grouping of agents and pipelines within an environment
getAllPipelinesForUser
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/EnvironmentConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/EnvironmentConfigService.java
Apache-2.0
private void update(EntityConfigUpdateCommand<?> updateEnvCmd, EnvironmentConfig config, Username currentUser, HttpLocalizedOperationResult result, String actionFailed) { try { goConfigService.updateConfig(updateEnvCmd, currentUser); } catch (Exception e) { ...
Understands grouping of agents and pipelines within an environment
update
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/EnvironmentConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/EnvironmentConfigService.java
Apache-2.0
private boolean forceIncludeEmptyGroup(final boolean allowEmpty, GoDashboardPipelineGroup dashboardGroup, Username user) { return allowEmpty && !dashboardGroup.hasDefinedPipelines() && dashboardGroup.canBeViewedBy(user); }
Determines whether or not to include a (potentially) empty pipeline group on the dashboard. This consults the feature toggle, view permissions, and whether or the not the pipeline group has any defined pipeline regardless of permissions and personalization filters. @param allowEmpty - flag from feature toggle @param d...
forceIncludeEmptyGroup
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/GoDashboardService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/GoDashboardService.java
Apache-2.0
private void updateCache(PipelineConfigs group, PipelineConfig pipelineConfig) { if (group == null) { removePipelineFromCache(pipelineConfig.name()); return; } cache.put(dashboardCurrentStateLoader.pipelineFor(pipelineConfig, group)); }
Determines whether or not to include a (potentially) empty pipeline group on the dashboard. This consults the feature toggle, view permissions, and whether or the not the pipeline group has any defined pipeline regardless of permissions and personalization filters. @param allowEmpty - flag from feature toggle @param d...
updateCache
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/GoDashboardService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/GoDashboardService.java
Apache-2.0
private void removePipelineFromCache(CaseInsensitiveString pipelineName) { cache.remove(pipelineName); dashboardCurrentStateLoader.clearEntryFor(pipelineName); }
Determines whether or not to include a (potentially) empty pipeline group on the dashboard. This consults the feature toggle, view permissions, and whether or the not the pipeline group has any defined pipeline regardless of permissions and personalization filters. @param allowEmpty - flag from feature toggle @param d...
removePipelineFromCache
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/GoDashboardService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/GoDashboardService.java
Apache-2.0
private void internalUpdateJobStateAndResult(final JobInstance job) { transactionTemplate.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { jobInstanceDao.updateStateAndResult(job); ...
This method exists only so that we can scope the transaction properly
internalUpdateJobStateAndResult
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
@Override protected void doInTransactionWithoutResult(TransactionStatus status) { jobInstanceDao.updateStateAndResult(job); }
This method exists only so that we can scope the transaction properly
doInTransactionWithoutResult
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
@Override public JobPlan loadOriginalJobPlan(JobIdentifier jobId) { JobIdentifier actualId = jobResolverService.actualJobIdentifier(jobId); return jobInstanceDao.loadPlan(actualId.getBuildId()); }
This method exists only so that we can scope the transaction properly
loadOriginalJobPlan
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public List<JobPlan> orderedScheduledBuilds() { return jobInstanceDao.orderedScheduledBuilds(); }
This method exists only so that we can scope the transaction properly
orderedScheduledBuilds
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public List<WaitingJobPlan> waitingJobPlans(Username username) { List<JobPlan> jobPlans = orderedScheduledBuilds(); boolean isUserAdmin = securityService.isUserAdmin(username); return jobPlans.stream() .filter((jobPlan) -> isUserAdmin || securityService.hasViewPermissionForPipeli...
This method exists only so that we can scope the transaction properly
waitingJobPlans
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public JobInstances findHungJobs(List<String> liveAgentIdList) { return jobInstanceDao.findHungJobs(liveAgentIdList); }
This method exists only so that we can scope the transaction properly
findHungJobs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public void cancelJob(final JobInstance job) { LOGGER.info("cancelling job [{}]", job); boolean cancelled = job.cancel(); if (cancelled) { updateStateAndResult(job); notifyJobCancelled(job); } }
This method exists only so that we can scope the transaction properly
cancelJob
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
private void notifyJobCancelled(final JobInstance instance) { if (instance.isAssignedToAgent()) { transactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { @Override public void afterCommit() { jobResultTop...
This method exists only so that we can scope the transaction properly
notifyJobCancelled
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
@Override public void afterCommit() { jobResultTopic.post(new JobResultMessage(instance.getIdentifier(), instance.getResult(), instance.getAgentUuid())); }
This method exists only so that we can scope the transaction properly
afterCommit
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public void save(StageIdentifier stageIdentifier, long stageId, final JobInstance job) { jobInstanceDao.save(stageId, job); job.setIdentifier(new JobIdentifier(stageIdentifier, job)); notifyJobStatusChangeListeners(job); }
This method exists only so that we can scope the transaction properly
save
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public JobInstances currentJobsOfStage(String pipelineName, StageConfig stageConfig) { JobInstances jobs = new JobInstances(); for (JobConfig jobConfig : stageConfig.allBuildPlans()) { JobConfigIdentifier jobConfigIdentifier = new JobConfigIdentifier(pipelineName, CaseInsensitiveString.str(s...
This method exists only so that we can scope the transaction properly
currentJobsOfStage
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public List<JobIdentifier> allBuildingJobs() { return jobInstanceDao.getBuildingJobs(); }
This method exists only so that we can scope the transaction properly
allBuildingJobs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public List<JobInstance> allRunningJobs() { return jobInstanceDao.getRunningJobs(); }
This method exists only so that we can scope the transaction properly
allRunningJobs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public void registerJobStateChangeListener(JobStatusListener jobStatusListener) { synchronized (LISTENERS_MODIFICATION_MUTEX) { listeners.add(jobStatusListener); } }
This method exists only so that we can scope the transaction properly
registerJobStateChangeListener
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public void failJob(JobInstance jobInstance) { jobInstance.fail(); if (jobInstance.isFailed()) { updateStateAndResult(jobInstance); notifyJobCancelled(jobInstance); } }
This method exists only so that we can scope the transaction properly
failJob
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public JobInstancesModel completedJobsOnAgent(String uuid, JobHistoryColumns columnName, SortOrder order, int pageNumber, int pageSize) { int total = totalCompletedJobsCountOn(uuid); Pagination pagination = Pagination.pageByNumber(pageNumber, total, pageSize); return completedJobsOnAgent(uuid, c...
This method exists only so that we can scope the transaction properly
completedJobsOnAgent
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public int totalCompletedJobsCountOn(String uuid) { return jobInstanceDao.totalCompletedJobsOnAgent(uuid); }
This method exists only so that we can scope the transaction properly
totalCompletedJobsCountOn
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public JobInstancesModel completedJobsOnAgent(String uuid, JobHistoryColumns columnName, SortOrder order, Pagination pagination) { List<JobInstance> jobInstances = jobInstanceDao.completedJobsOnAgent(uuid, columnName, order, pagination.getOffset(), pagination.getPageSize()); CruiseConfig cruiseConfig = ...
This method exists only so that we can scope the transaction properly
completedJobsOnAgent
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
@Override public void onConfigChange(CruiseConfig newCruiseConfig) { serverHealthService.removeByScopeMatcher(HealthStateScope::isForJob); }
This method exists only so that we can scope the transaction properly
onConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
@Override public void onEntityConfigChange(PipelineConfig pipelineConfig) { serverHealthService.removeByScopeMatcher(scope -> scope.isForJob() && isForThisPipelineConfig(scope, pipelineConfig.name())); }
This method exists only so that we can scope the transaction properly
onEntityConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
private static boolean isForThisPipelineConfig(HealthStateScope currentScope, CaseInsensitiveString pipelineConfigName) { String[] split = currentScope.getScope().split("/"); return split.length > 0 && new CaseInsensitiveString(split[0]).equals(pipelineConfigName); }
This method exists only so that we can scope the transaction properly
isForThisPipelineConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public String getColumnName() { return columnName; }
This method exists only so that we can scope the transaction properly
getColumnName
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public PipelineRunIdInfo getOldestAndLatestJobInstanceId(Username username, String pipelineName, String stageName, String jobConfigName) { checkForExistenceAndAccess(username, pipelineName); return jobInstanceDao.getOldestAndLatestJobInstanceId(pipelineName, stageName, jobConfigName); }
This method exists only so that we can scope the transaction properly
getOldestAndLatestJobInstanceId
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public JobInstances getJobHistoryViaCursor(Username username, String pipelineName, String stageName, String jobConfigName, long afterCursor, long beforeCursor, Integer pageSize) { checkForExistenceAndAccess(username, pipelineName); JobInstances jobInstances; if (validateCursor(afterCursor, "afte...
This method exists only so that we can scope the transaction properly
getJobHistoryViaCursor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
private void checkForExistenceAndAccess(Username username, String pipelineName) { if (!goConfigService.currentCruiseConfig().hasPipelineNamed(new CaseInsensitiveString(pipelineName))) { throw new RecordNotFoundException(EntityType.Pipeline, pipelineName); } if (!securityService.hasVi...
This method exists only so that we can scope the transaction properly
checkForExistenceAndAccess
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobInstanceService.java
Apache-2.0
public JobIdentifier actualJobIdentifier(JobIdentifier oldId) { return jobDao.findOriginalJobIdentifier(oldId.getStageIdentifier(), oldId.getBuildName()); }
Understands resolving actual job in case of copy-for-rerun
actualJobIdentifier
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/JobResolverService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/JobResolverService.java
Apache-2.0
@Override public BuildCause onModifications(MaterialRevisions materialRevisions, boolean materialConfigurationChanged, MaterialRevisions previousMaterialRevisions) { if (materialRevisions == null || materialRevisions.isEmpty()) { throw new RuntimeException("Cannot find modifications, please chec...
Understands operations related to a pipeline that was forced
onModifications
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
Apache-2.0
@Override public BuildCause onEmptyModifications(PipelineConfig pipelineConfig, MaterialRevisions materialRevisions) { return onModifications(materialRevisions, false, null); }
Understands operations related to a pipeline that was forced
onEmptyModifications
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
Apache-2.0
@Override public void canProduce(PipelineConfig pipelineConfig, SchedulingCheckerService schedulingChecker, ServerHealthService serverHealthService, OperationResult operationResult) { schedulingChecker.canTriggerManualPipeline(pipelineConfig, CaseInsensi...
Understands operations related to a pipeline that was forced
canProduce
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
Apache-2.0
@Override public boolean isValidBuildCause(PipelineConfig pipelineConfig, BuildCause buildCause) { return true; }
Understands operations related to a pipeline that was forced
isValidBuildCause
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
Apache-2.0
@Override public boolean shouldCheckWhetherOlderRunsHaveRunWithLatestMaterials() { return true; }
Understands operations related to a pipeline that was forced
shouldCheckWhetherOlderRunsHaveRunWithLatestMaterials
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
Apache-2.0
@Override public void notifyPipelineNotScheduled(PipelineConfig pipelineConfig) { }
Understands operations related to a pipeline that was forced
notifyPipelineNotScheduled
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/ManualBuild.java
Apache-2.0
public MaterialConfigs getMaterialConfigs(String username) { MaterialConfigs materialConfigs = new MaterialConfigs(); Set<String> materialFingerprints = new HashSet<>(); for (PipelineConfigs pipelineGroup : goConfigService.groups()) { if (securityService.hasViewPermissionForGroup(use...
Understands providing services around a pipeline configuration
getMaterialConfigs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialConfigService.java
Apache-2.0
public MaterialConfig getMaterialConfig(String username, String materialFingerprint, OperationResult result) { MaterialConfig materialConfig = null; boolean hasViewPermissionForMaterial = false; for (PipelineConfigs pipelineGroup : goConfigService.groups()) { boolean hasViewPermissio...
Understands providing services around a pipeline configuration
getMaterialConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialConfigService.java
Apache-2.0
public List<String> getUsagesForMaterial(String username, String fingerprint) { return goConfigService.groups() .stream() .filter((grp) -> securityService.hasViewPermissionForGroup(username, grp.getGroup())) .flatMap((grp) -> grp.getPipelines() ...
Understands providing services around a pipeline configuration
getUsagesForMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialConfigService.java
Apache-2.0
public Map<MaterialConfig, Boolean> getMaterialConfigsWithPermissions(String username) { Map<MaterialConfig, Boolean> materialConfigs = new HashMap<>(); Map<String, Boolean> materialFingerprints = new HashMap<>(); goConfigService.groups() .stream() .filter((grp) -...
Understands providing services around a pipeline configuration
getMaterialConfigsWithPermissions
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialConfigService.java
Apache-2.0
public MaterialConfig getMaterialConfig(String username, String materialFingerprint) { MaterialConfig materialConfig = null; boolean hasViewPermissionForMaterial = false; boolean hasOperatePermissionForMaterial = false; for (PipelineConfigs pipelineGroup : goConfigService.groups()) { ...
Understands providing services around a pipeline configuration
getMaterialConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialConfigService.java
Apache-2.0
private void populatePollerImplementations() { materialPollerMap.put(GitMaterial.class, new GitPoller()); materialPollerMap.put(HgMaterial.class, new HgPoller()); materialPollerMap.put(SvnMaterial.class, new SvnPoller()); materialPollerMap.put(TfsMaterial.class, new TfsPoller()); ...
Understands interactions between material-config, repository and modifications
populatePollerImplementations
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public boolean hasModificationFor(Material material) { return !materialRepository.findLatestModification(material).isEmpty(); }
Understands interactions between material-config, repository and modifications
hasModificationFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public List<MatchedRevision> searchRevisions(String pipelineName, String fingerprint, String searchString, Username username, ...
Understands interactions between material-config, repository and modifications
searchRevisions
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public List<Modification> latestModification(Material material, File baseDir, final SubprocessExecutionContext execCtx) { resolveSecretParams(material); return getPollerImplementation(material).latestModifi...
Understands interactions between material-config, repository and modifications
latestModification
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public List<Modification> modificationsSince(Material material, File baseDir, Revision revision, final SubprocessExecutionContext execCtx) { resolveSecretParams(mate...
Understands interactions between material-config, repository and modifications
modificationsSince
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public void checkout(Material material, File baseDir, Revision revision, final SubprocessExecutionContext execCtx) { resolveSecretParams(material); getPollerImplementation(material).checkout(material, baseDir, revision, execCtx); }
Understands interactions between material-config, repository and modifications
checkout
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
protected MaterialPoller<Material> getPollerImplementation(Material material) { Class<? extends Material> materialClass = getMaterialClass(material); @SuppressWarnings("unchecked") MaterialPoller<Material> materialPoller = (MaterialPoller<Material>) materialPollerMap.get(materialClass); return ...
Understands interactions between material-config, repository and modifications
getPollerImplementation
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public Long getTotalModificationsFor(MaterialConfig materialConfig) { MaterialInstance materialInstance = materialRepository.findMaterialInstance(materialConfig); return materialRepository.getTotalModificationsFor(materialInstance); }
Understands interactions between material-config, repository and modifications
getTotalModificationsFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public Modifications getModificationsFor(MaterialConfig materialConfig, Pagination pagination) { MaterialInstance materialInstance = materialRepository.findMaterialInstance(materialConfig); return materialRepository.getModificationsFor(materialInstance, pagination); }
Understands interactions between material-config, repository and modifications
getModificationsFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
private void resolveSecretParams(Material material) { if ((material instanceof SecretParamAware)) { this.secretParamResolver.resolve(material); } }
Understands interactions between material-config, repository and modifications
resolveSecretParams
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
Class<? extends Material> getMaterialClass(Material material) { return material.getClass(); }
Understands interactions between material-config, repository and modifications
getMaterialClass
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public Map<String, Modification> getLatestModificationForEachMaterial() { List<Modification> modifications = materialRepository.getLatestModificationForEachMaterial(); return modifications .stream() .collect(toMap(mod -> mod.getMaterialInstance().getFingerprint(), Functio...
Understands interactions between material-config, repository and modifications
getLatestModificationForEachMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public PipelineRunIdInfo getLatestAndOldestModification(MaterialConfig materialConfig, String pattern) { MaterialInstance materialInstance = materialRepository.findMaterialInstance(materialConfig); if (materialInstance == null) { return null; } return materialRepository.getOl...
Understands interactions between material-config, repository and modifications
getLatestAndOldestModification
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public List<Modification> getModificationsFor(MaterialConfig materialConfig, String pattern, long after, long before, Integer pageSize) { MaterialInstance materialInstance = materialRepository.findMaterialInstance(materialConfig); if (materialInstance == null) { return null; } ...
Understands interactions between material-config, repository and modifications
getModificationsFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
private List<Modification> getModificationsFor(MaterialInstance materialInstance, long afterCursor, long beforeCursor, Integer pageSize) { Pair<Long, FeedModifier> cursor = cursor(afterCursor, beforeCursor); return materialRepository.loadHistory(materialInstance.getId(), cursor.last(), cursor.first(), ...
Understands interactions between material-config, repository and modifications
getModificationsFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
private List<Modification> findMatchingModifications(MaterialInstance materialInstance, String pattern, long afterCursor, long beforeCursor, Integer pageSize) { Pair<Long, FeedModifier> cursor = cursor(afterCursor, beforeCursor); return materialRepository.findMatchingModifications(materialInstance.getI...
Understands interactions between material-config, repository and modifications
findMatchingModifications
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
private Pair<Long, FeedModifier> cursor(long afterCursor, long beforeCursor) { if (validateCursor(afterCursor, "after")) { return new Pair<>(afterCursor, FeedModifier.After); } else if (validateCursor(beforeCursor, "before")) { return new Pair<>(beforeCursor, FeedModifier.Before)...
Understands interactions between material-config, repository and modifications
cursor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/MaterialService.java
Apache-2.0
public Map<CaseInsensitiveString, CanDeleteResult> canDeletePipelines() { CruiseConfig cruiseConfig = goConfigService.getCurrentConfig(); Map<CaseInsensitiveString, CanDeleteResult> nameToCanDeleteIt = new HashMap<>(); Hashtable<CaseInsensitiveString, Node> hashtable = cruiseConfig.getDependency...
Understands providing services around a pipeline configuration
canDeletePipelines
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
private ConfigOrigin pipelineConfigOrigin(CruiseConfig cruiseConfig, final CaseInsensitiveString pipelineName) { PipelineConfig pipelineConfig = cruiseConfig.pipelineConfigByName(pipelineName); if (pipelineConfig == null) return null; return pipelineConfig.getOrigin(); }
Understands providing services around a pipeline configuration
pipelineConfigOrigin
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
private CaseInsensitiveString downstreamOf(Hashtable<CaseInsensitiveString, Node> pipelineToUpstream, final CaseInsensitiveString pipelineName) { for (Map.Entry<CaseInsensitiveString, Node> entry : pipelineToUpstream.entrySet()) { if (entry.getValue().h...
Understands providing services around a pipeline configuration
downstreamOf
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
private CaseInsensitiveString environmentUsedIn(CruiseConfig cruiseConfig, final CaseInsensitiveString pipelineName) { return cruiseConfig.getEnvironments().findEnvironmentNameForPipeline(pipelineName); }
Understands providing services around a pipeline configuration
environmentUsedIn
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public PipelineConfig pipelineConfigNamed(String pipelineName) { return goConfigService.pipelineConfigNamed(new CaseInsensitiveString(pipelineName)); }
Understands providing services around a pipeline configuration
pipelineConfigNamed
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public PipelineConfig getPipelineConfig(String pipelineName) { return goConfigService.getMergedConfigForEditing().getPipelineConfigByName(new CaseInsensitiveString(pipelineName)); }
Understands providing services around a pipeline configuration
getPipelineConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
private void update(Username currentUser, PipelineConfig pipelineConfig, LocalizedOperationResult result, EntityConfigUpdateCommand<?> command) { try { goConfigService.updateConfig(command, currentUser); } catch (Excepti...
Understands providing services around a pipeline configuration
update
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public void updatePipelineConfig(final Username currentUser, final PipelineConfig pipelineConfig, String updatedGroupName, final String md5, final LocalizedOperationResult ...
Understands providing services around a pipeline configuration
updatePipelineConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public PipelineGroups viewableGroupsFor(Username username) { return groupsMatchingFilter(goConfigService.cruiseConfig(), pipelineConfigs -> securityService.hasViewPermissionForGroup(str(username.getUsername()), pipelineConfigs.getGroup())); }
Understands providing services around a pipeline configuration
viewableGroupsFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public PipelineGroups adminGroupsForIncludingConfigRepos(Username username) { return groupsMatchingFilter(goConfigService.cruiseConfig(), pipelineConfigs -> securityService.isUserAdminOfGroup(username.getUsername(), pipelineConfigs.getGroup())); }
Understands providing services around a pipeline configuration
adminGroupsForIncludingConfigRepos
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public PipelineGroups viewableOrOperatableGroupsForIncludingConfigRepos(Username username) { return groupsMatchingFilter(goConfigService.cruiseConfig(), pipelineConfigs -> securityService.hasOperatePermissionForGroup(username.getUsername(), pipelineConfigs.getGroup())); }
Understands providing services around a pipeline configuration
viewableOrOperatableGroupsForIncludingConfigRepos
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public PipelineGroups viewableGroupsForUserIncludingConfigRepos(Username username) { return groupsMatchingFilter(goConfigService.getMergedConfigForEditing(), pipelineConfigs -> securityService.hasViewPermissionForGroup(str(username.getUsername()), pipelineConfigs.getGroup())); }
Understands providing services around a pipeline configuration
viewableGroupsForUserIncludingConfigRepos
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
private PipelineGroups groupsMatchingFilter(CruiseConfig cruiseConfig, Predicate<PipelineConfigs> predicate) { return cruiseConfig .getGroups() .stream() .filter(predicate) .collect(Collectors.toCollection(PipelineGroups::new)); }
Understands providing services around a pipeline configuration
groupsMatchingFilter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public void createPipelineConfig(final Username currentUser, final PipelineConfig pipelineConfig, final LocalizedOperationResult result, final String groupName) { CreatePipelineConfigCommand createPipe...
Understands providing services around a pipeline configuration
createPipelineConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public CreatePipelineConfigCommand createPipelineConfigCommand(Username currentUser, PipelineConfig pipelineConfig, LocalizedOperationResult result, ...
Understands providing services around a pipeline configuration
createPipelineConfigCommand
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public void deletePipelineConfig(final Username currentUser, final PipelineConfig pipelineConfig, final LocalizedOperationResult result) { DeletePipelineConfigCommand deletePipelineConfigCommand = new DeletePipelineConfigCommand(goConfigS...
Understands providing services around a pipeline configuration
deletePipelineConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
private void validatePluggableTasks(PipelineConfig config) { for (PluggableTask task : pluggableTask(config)) { pluggableTaskService.isValid(task); } }
Understands providing services around a pipeline configuration
validatePluggableTasks
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
private List<PluggableTask> pluggableTask(PipelineConfig config) { List<PluggableTask> tasks = new ArrayList<>(); for (StageConfig stageConfig : config.getStages()) { for (JobConfig jobConfig : stageConfig.getJobs()) { for (Task task : jobConfig.getTasks()) { ...
Understands providing services around a pipeline configuration
pluggableTask
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public int totalPipelinesCount() { return goConfigService.getAllPipelineConfigs().size(); }
Understands providing services around a pipeline configuration
totalPipelinesCount
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public void extractTemplateFromPipeline(String pipelineName, String templateName, Username currentUser) { goConfigService.updateConfig(new ExtractTemplateFromPipelineEntityConfigUpdateCommand(securityService, pipelineName, t...
Understands providing services around a pipeline configuration
extractTemplateFromPipeline
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineConfigService.java
Apache-2.0
public void initialize() { goConfigService.register(this); goConfigService.register(pipelineConfigChangedListener()); }
Understands how/whether to lock/unlock a pipeline instance
initialize
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
Apache-2.0
protected EntityConfigChangedListener<PipelineConfig> pipelineConfigChangedListener() { return new EntityConfigChangedListener<>() { @Override public void onEntityConfigChange(PipelineConfig pipelineConfig) { for (String lockedPipeline : pipelineStateDao.lockedPipelines()...
Understands how/whether to lock/unlock a pipeline instance
pipelineConfigChangedListener
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
Apache-2.0
@Override public void onEntityConfigChange(PipelineConfig pipelineConfig) { for (String lockedPipeline : pipelineStateDao.lockedPipelines()) { if (pipelineConfig.name().equals(new CaseInsensitiveString(lockedPipeline)) && !pipelineConfig.isLockable()) { ...
Understands how/whether to lock/unlock a pipeline instance
onEntityConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
Apache-2.0
public void lockIfNeeded(Pipeline pipeline) { if (goConfigService.isLockable(pipeline.getName())) { pipelineStateDao.lockPipeline(pipeline, status -> { if(status == TransactionSynchronization.STATUS_COMMITTED) { notifyListeners(PipelineLockStatusChangeListener.Eve...
Understands how/whether to lock/unlock a pipeline instance
lockIfNeeded
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
Apache-2.0
public boolean isLocked(String pipelineName) { return lockedPipeline(pipelineName) != null; }
Understands how/whether to lock/unlock a pipeline instance
isLocked
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
Apache-2.0
public StageIdentifier lockedPipeline(String pipelineName) { PipelineState pipelineState = pipelineStateDao.pipelineStateFor(pipelineName); if (pipelineState != null && pipelineState.isLocked()) { return pipelineState.getLockedBy(); } else { return null; } }
Understands how/whether to lock/unlock a pipeline instance
lockedPipeline
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
Apache-2.0
public void unlock(String pipelineName) { pipelineStateDao.unlockPipeline(pipelineName, status -> { if (status != TransactionSynchronization.STATUS_COMMITTED) { return; } notifyListeners(PipelineLockStatusChangeListener.Event.unLock(pipelineName)); });...
Understands how/whether to lock/unlock a pipeline instance
unlock
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
Apache-2.0
public boolean canScheduleStageInPipeline(PipelineIdentifier pipeline) { if (!goConfigService.isLockable(pipeline.getName())) { return true; } StageIdentifier locked = lockedPipeline(pipeline.getName()); return locked == null || locked.pipelineIdentifier().equals(pipeline); ...
Understands how/whether to lock/unlock a pipeline instance
canScheduleStageInPipeline
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
Apache-2.0
@Override public void onConfigChange(CruiseConfig newCruiseConfig) { for (String lockedPipeline : pipelineStateDao.lockedPipelines()) { if (!newCruiseConfig.hasPipelineNamed(new CaseInsensitiveString(lockedPipeline)) || !newCruiseConfig.isPipelineLockable(lockedPipeline)) { unloc...
Understands how/whether to lock/unlock a pipeline instance
onConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
Apache-2.0
private void notifyListeners(PipelineLockStatusChangeListener.Event event) { for (PipelineLockStatusChangeListener listener : listeners) { try { LOGGER.debug("START Notifying listener ({}) of event: {}", listener, event); listener.lockStatusChanged(event); ...
Understands how/whether to lock/unlock a pipeline instance
notifyListeners
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineLockService.java
Apache-2.0
public void unlock(String pipelineName, Username username, OperationResult result) { if (canUnlock(pipelineName, username, result)) { pipelineLockService.unlock(pipelineName); result.ok("Pipeline lock released for " + pipelineName); } }
Understands forced unlocking of pipeline by a user <p> unlock belongs in PipelineLockService but had to be pulled into a separate service because of circular dependency between CachedCurrentActivityService and PipelineLockService (unlock still is in PipelineLockService, the unlock here does necessary validity checks an...
unlock
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineUnlockApiService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineUnlockApiService.java
Apache-2.0
public boolean canUnlock(String pipelineName, Username username, OperationResult result) { if (!goConfigService.hasPipelineNamed(new CaseInsensitiveString(pipelineName))) { String msg = format("pipeline name %s is incorrect", pipelineName); result.notFound(msg, msg, HealthStateType.gener...
Understands forced unlocking of pipeline by a user <p> unlock belongs in PipelineLockService but had to be pulled into a separate service because of circular dependency between CachedCurrentActivityService and PipelineLockService (unlock still is in PipelineLockService, the unlock here does necessary validity checks an...
canUnlock
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineUnlockApiService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineUnlockApiService.java
Apache-2.0
public boolean isUnlockable(String pipelineName) { return isUnlockable(pipelineName, new ServerHealthStateOperationResult()); }
Understands forced unlocking of pipeline by a user <p> unlock belongs in PipelineLockService but had to be pulled into a separate service because of circular dependency between CachedCurrentActivityService and PipelineLockService (unlock still is in PipelineLockService, the unlock here does necessary validity checks an...
isUnlockable
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineUnlockApiService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineUnlockApiService.java
Apache-2.0
private boolean isUnlockable(String pipelineName, OperationResult result) { if (!goConfigService.isLockable(pipelineName)) { String msg = format("No lock exists within the pipeline configuration for %s", pipelineName); result.conflict(msg, msg, HealthStateType.general(HealthStateScope.GL...
Understands forced unlocking of pipeline by a user <p> unlock belongs in PipelineLockService but had to be pulled into a separate service because of circular dependency between CachedCurrentActivityService and PipelineLockService (unlock still is in PipelineLockService, the unlock here does necessary validity checks an...
isUnlockable
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/PipelineUnlockApiService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/PipelineUnlockApiService.java
Apache-2.0
public JobIdentifier findJob(String pipelineName, String pipelineCounter, String stageName, String stageCounter, String buildName, Long buildId) { JobConfigIdentifier jobConfigIdentifier = goConfigService.translateToActualCase(new JobConfigIdentifier(pipelineName, stageName, buildName)); PipelineIdenti...
buildId should only be given when caller is absolutely sure about the job instance (makes sense in agent-uploading artifacts/properties scenario because agent won't run a job if its copied over(it only executes real jobs)) -JJ <p> This does not return pipelineLabel
findJob
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/RestfulService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/RestfulService.java
Apache-2.0
public JobIdentifier findJob(String pipelineName, String pipelineCounter, String stageName, String stageCounter, String buildName) { return findJob(pipelineName, pipelineCounter, stageName, stageCounter, buildName, null); }
buildId should only be given when caller is absolutely sure about the job instance (makes sense in agent-uploading artifacts/properties scenario because agent won't run a job if its copied over(it only executes real jobs)) -JJ <p> This does not return pipelineLabel
findJob
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/RestfulService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/RestfulService.java
Apache-2.0
public StageIdentifier translateStageCounter(PipelineIdentifier pipelineIdentifier, String stageName, String stageCounter) { if (JobIdentifier.LATEST.equalsIgnoreCase(stageCounter)) { int latestCounter = stageDao.findLatestStageCounter(pipelineIdentifier, stageName); return new StageIden...
buildId should only be given when caller is absolutely sure about the job instance (makes sense in agent-uploading artifacts/properties scenario because agent won't run a job if its copied over(it only executes real jobs)) -JJ <p> This does not return pipelineLabel
translateStageCounter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/RestfulService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/RestfulService.java
Apache-2.0
public Pipeline pipelineWithPasswordAwareBuildCauseByBuildId(final long buildId) { Pipeline pipeline = pipelineDao.pipelineWithMaterialsAndModsByBuildId(buildId); MaterialRevisions scheduledRevs = pipeline.getBuildCause().getMaterialRevisions(); MaterialConfigs knownMaterials = knownMaterials(pi...
Understands loads scheduled pipeline for creating work
pipelineWithPasswordAwareBuildCauseByBuildId
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/ScheduledPipelineLoader.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/ScheduledPipelineLoader.java
Apache-2.0