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
@TestOnly public Pipeline saveWithStages(Pipeline pipeline) { updateCounter(pipeline); Pipeline savedPipeline = save(pipeline); for (Stage stage : pipeline.getStages()) { stageDao.saveWithJobs(savedPipeline, stage); } return savedPipeline; }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
saveWithStages
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private void updateCounter(Pipeline pipeline) { Integer lastCount = getCounterForPipeline(pipeline.getName()); pipeline.updateCounter(lastCount); insertOrUpdatePipelineCounter(pipeline, lastCount, pipeline.getCounter()); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
updateCounter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public Pipeline pipelineWithMaterialsAndModsByBuildId(long buildId) { String cacheKey = this.cacheKeyGenerator.generate("getPipelineByBuildId", buildId); return pipelineByBuildIdCache.get(cacheKey, () -> { Pipeline pipeline = getSqlMapClientTemplate().queryForObject("getPipelin...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
pipelineWithMaterialsAndModsByBuildId
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineIdentifier mostRecentPipelineIdentifier(String pipelineName) { return getSqlMapClientTemplate().queryForObject("mostRecentPipelineIdentifier", pipelineName); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
mostRecentPipelineIdentifier
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public Pipeline pipelineByIdWithMods(long pipelineId) { Pipeline pipeline = getSqlMapClientTemplate().queryForObject("pipelineById", pipelineId); if (pipeline == null) { throw new DataRetrievalFailureException("Could not load pipeline with id " + pipelineId); } ...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
pipelineByIdWithMods
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public Pipeline loadAssociations(Pipeline pipeline, String pipelineName) { pipeline = loadStages(pipeline); pipeline = loadMaterialRevisions(pipeline); pipeline = loadEnvironmentVariables(pipeline); return pipeline == null ? new NullPipeline(pipelineName) : pipeline; }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadAssociations
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private Pipeline loadEnvironmentVariables(Pipeline pipeline) { if (pipeline == null) { return null; } pipeline.getBuildCause().setVariables(environmentVariableDao.load(pipeline.getId(), EnvironmentVariableType.Trigger)); return pipeline; }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadEnvironmentVariables
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineInstanceModels loadHistory(String pipelineName) { return PipelineInstanceModels.createPipelineInstanceModels( getSqlMapClientTemplate().queryForList("getAllPipelineHistoryByName", arguments("name", pipelineName).asMap())); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadHistory
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineInstanceModel findPipelineHistoryByNameAndCounter(String pipelineName, int pipelineCounter) { PipelineInstanceModel instanceModel = loadPipelineInstanceModelByNameAndCounter(pipelineName, pipelineCounter); loadPipelineHistoryBuildCause(instanceModel); return instance...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
findPipelineHistoryByNameAndCounter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private PipelineInstanceModel loadPipelineInstanceModelByNameAndCounter(String pipelineName, int pipelineCounter) { String cacheKey = cacheKeyForPipelineHistoryByNameAndCounter(pipelineName, pipelineCounter); PipelineInstanceModel instanceModel = goCache.get(cacheKey); if (instanceModel == null)...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadPipelineInstanceModelByNameAndCounter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
String cacheKeyForPipelineHistoryByNameAndCounter(String pipelineName, int pipelineCounter) { return cacheKeyGenerator.generate("cacheKeyForPipelineHistoryByName", pipelineName.toLowerCase(), "AndCounter", pipelineCounter); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
cacheKeyForPipelineHistoryByNameAndCounter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public Pipeline findEarlierPipelineThatPassedForStage(String pipelineName, String stageName, double naturalOrder) { return getSqlMapClientTemplate().queryForObject("findEarlierPipelineThatPassedForStage", arguments("pipelineName", pipelineName).and("stageName", stageName).and("natu...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
findEarlierPipelineThatPassedForStage
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
public void cacheActivePipelines() { LOGGER.info("Retrieving Active Pipelines from Database..."); final List<PipelineInstanceModel> pipelines = getAllPIMs(); if (pipelines.isEmpty()) { return; } List<Thread> loaderThreads = loadActivePipelineAndHistoryToCache(pipeline...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
cacheActivePipelines
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private List<PipelineInstanceModel> getAllPIMs() { return getSqlMapClientTemplate().queryForList("allActivePipelines"); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
getAllPIMs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private List<CaseInsensitiveString> getPipelineNamesInConfig() { return configFileDao.load().getAllPipelineNames(); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
getPipelineNamesInConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private void waitForLoaderThreadsToJoin(Collection<Thread> loaderThreads) { for (Thread loaderThread : loaderThreads) { try { loaderThread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
waitForLoaderThreadsToJoin
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private List<Thread> loadActivePipelineAndHistoryToCache(final List<PipelineInstanceModel> pipelines) { final Thread activePipelinesCacheLoader = new Thread(() -> { LOGGER.info("Loading Active Pipelines to cache...Started"); Map<CaseInsensitiveString, TreeSet<Long>> result = groupPipelin...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadActivePipelineAndHistoryToCache
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineInstanceModels loadActivePipelines() { return convertToPipelineInstanceModels(getAllActivePipelineNamesVsTheirInstanceIDs()); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadActivePipelines
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineInstanceModels loadActivePipelineInstancesFor(CaseInsensitiveString pipelineName) { Map<CaseInsensitiveString, TreeSet<Long>> allActivePipelineNamesVsTheirInstanceIDs = getAllActivePipelineNamesVsTheirInstanceIDs(); Map<CaseInsensitiveString, TreeSet<Long>> similarMapForSing...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadActivePipelineInstancesFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private void cacheMaterialRevisions(List<PipelineInstanceModel> models) { List<CaseInsensitiveString> pipelinesInConfig = getPipelineNamesInConfig(); if (pipelinesInConfig.isEmpty()) { LOGGER.warn("No pipelines found in Config, Skipping material revision caching."); return; ...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
cacheMaterialRevisions
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private PipelineInstanceModels convertToPipelineInstanceModels(Map<CaseInsensitiveString, TreeSet<Long>> result) { List<PipelineInstanceModel> models = new ArrayList<>(); List<CaseInsensitiveString> pipelinesInConfig = getPipelineNamesInConfig(); if (pipelinesInConfig.isEmpty()) { L...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
convertToPipelineInstanceModels
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private List<Long> loadIdsFromHistory(Map<CaseInsensitiveString, TreeSet<Long>> result) { List<Long> idsForHistory = new ArrayList<>(); try { activePipelineReadLock.lock(); for (Map.Entry<CaseInsensitiveString, TreeSet<Long>> pipelineToIds : result.entrySet()) { i...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadIdsFromHistory
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineInstanceModel loadHistoryByIdWithBuildCause(Long id) { PipelineInstanceModel model = loadHistory(id); loadPipelineHistoryBuildCause(model); return model; }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadHistoryByIdWithBuildCause
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private Map<CaseInsensitiveString, TreeSet<Long>> groupPipelineInstanceIdsByPipelineName(List<PipelineInstanceModel> pipelines) { Map<CaseInsensitiveString, TreeSet<Long>> result = new HashMap<>(); for (PipelineInstanceModel pipeline : pipelines) { TreeSet<Long> ids = initializePipelineInsta...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
groupPipelineInstanceIdsByPipelineName
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
String activePipelinesCacheKey() { return cacheKeyGenerator.generate("activePipelines"); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
activePipelinesCacheKey
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineInstanceModel loadHistory(long id) { String cacheKey = pipelineHistoryCacheKey(id); PipelineInstanceModel result = goCache.get(cacheKey); if (result == null) { synchronized (cacheKey) { result = goCache.get(cacheKey); if (r...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadHistory
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public void stageStatusChanged(Stage stage) { removeStageSpecificCache(stage); syncCachedActivePipelines(stage); updateCachedLatestSuccessfulStage(stage); String pipelineName = stage.getIdentifier().getPipelineName(); Integer pipelineCounter = stage.getIdentifier()....
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
stageStatusChanged
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private void clearPipelineHistoryCacheViaNameAndCounter(String pipelineName, Integer pipelineCounter) { goCache.remove(cacheKeyForPipelineHistoryByNameAndCounter(pipelineName, pipelineCounter)); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
clearPipelineHistoryCacheViaNameAndCounter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private void syncCachedActivePipelines(Stage stage) { Map<CaseInsensitiveString, TreeSet<Long>> activePipelinesToIds = goCache.get(activePipelinesCacheKey()); if (activePipelinesToIds == null) { return; } CaseInsensitiveString pipelineName = new CaseInsensitiveString(loadHist...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
syncCachedActivePipelines
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private void addActiveAsLatest(Stage stage, Map<CaseInsensitiveString, TreeSet<Long>> activePipelinesToIds, CaseInsensitiveString pipelineName) { if (stage.getState().isActive()) { TreeSet<Long> ids = initializePipelineInstances(a...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
addActiveAsLatest
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private void removeCompletedIfNotLatest(Stage stage, Map<CaseInsensitiveString, TreeSet<Long>> activePipelinesToIds, CaseInsensitiveString pipelineName) { if (stage.getState().completed()) { if (activePipelinesTo...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
removeCompletedIfNotLatest
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private void removeCurrentLatestIfNoLongerActive(Stage stage, TreeSet<Long> ids) { if (!ids.isEmpty()) { if (isNewerThanCurrentLatest(stage, ids) && isCurrentLatestInactive(ids)) { ids.remove(ids.last()); } } }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
removeCurrentLatestIfNoLongerActive
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private boolean isNewerThanCurrentLatest(Stage stage, TreeSet<Long> ids) { return stage.getPipelineId() > ids.last(); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
isNewerThanCurrentLatest
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private boolean isCurrentLatestInactive(TreeSet<Long> ids) { return !loadHistory(ids.last()).isAnyStageActive(); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
isCurrentLatestInactive
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private TreeSet<Long> initializePipelineInstances(Map<CaseInsensitiveString, TreeSet<Long>> pipelineToIds, CaseInsensitiveString pipelineName) { if (!pipelineToIds.containsKey(pipelineName)) { pipelineToIds.put(pipelineName, new TreeSet<>()); ...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
initializePipelineInstances
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private void removeStageSpecificCache(Stage stage) { goCache.remove(pipelineHistoryCacheKey(stage.getPipelineId())); goCache.remove(cacheKeyForLatestPassedStage(stage.getPipelineId(), stage.getName())); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
removeStageSpecificCache
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
String pipelineHistoryCacheKey(Long id) { return cacheKeyGenerator.generate("pipelineHistory", id); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
pipelineHistoryCacheKey
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineInstanceModels loadHistory(String pipelineName, int limit, int offset) { List<Long> ids = findPipelineIds(pipelineName, limit, offset); if (ids.size() == 1) { return PipelineInstanceModels.createPipelineInstanceModels(loadHistoryByIdWithBuildCause(ids.get(0))); ...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadHistory
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineInstanceModels loadHistory(String pipelineName, FeedModifier modifier, long cursor, Integer pageSize) { List<Long> ids = findPipelineIds(pipelineName, modifier, cursor, pageSize); if (ids.size() == 1) { return PipelineInstanceModels.createPipelineInstanceModels(l...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadHistory
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private List<Long> findPipelineIds(String pipelineName, FeedModifier modifier, long cursor, int pageSize) { Map<String, Object> params = arguments("pipelineName", pipelineName) .and("cursor", cursor) .and("limit", pageSize).asMap(); return ...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
findPipelineIds
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineRunIdInfo getOldestAndLatestPipelineId(String pipelineName) { Map<String, Object> params = arguments("pipelineName", pipelineName).asMap(); return getSqlMapClientTemplate().queryForObject("getOldestAndLatestPipelineRun", params); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
getOldestAndLatestPipelineId
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public int getPageNumberForCounter(String pipelineName, int pipelineCounter, int limit) { Integer maxCounter = getCounterForPipeline(pipelineName); Pagination pagination = Pagination.pageStartingAt((maxCounter - pipelineCounter), maxCounter, limit); return pagination.getCurrentPage...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
getPageNumberForCounter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineInstanceModels findMatchingPipelineInstances(String pipelineName, String pattern, int limit) { Map<String, Object> args = arguments("pipelineName", pipelineName). and("pattern", "%" + pattern.toLowerCase() + "%"). and("rawPattern", pattern.toLowerCase...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
findMatchingPipelineInstances
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
List<Long> findPipelineIds(String pipelineName, int limit, int offset) { if (wantLatestIdOnly(limit, offset)) { String cacheKey = cacheKeyForLatestPipelineIdByPipelineName(pipelineName); List<Long> ids = goCache.get(cacheKey); if (ids == null) { synchronized (...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
findPipelineIds
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private boolean wantLatestIdOnly(int limit, int offset) { return limit == 1 && offset == 0; }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
wantLatestIdOnly
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private List<Long> fetchPipelineIds(String pipelineName, int limit, int offset) { List<Long> ids; Map<String, Object> toGet = arguments("pipelineName", pipelineName) .and("limit", limit) .and("offset", offset).asMap(); ids = getSqlM...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
fetchPipelineIds
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
String cacheKeyForLatestPipelineIdByPipelineName(String pipelineName) { return cacheKeyGenerator.generate("latestPipelineIdByPipelineName", pipelineName.toLowerCase()); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
cacheKeyForLatestPipelineIdByPipelineName
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private PipelineInstanceModels loadHistory(String pipelineName, List<Long> ids) { if (ids.isEmpty()) { return PipelineInstanceModels.createPipelineInstanceModels(); } Map<String, Object> args = arguments("pipelineName", pipelineName) .and("from", Collections.min(ids)...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadHistory
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public int count(String pipelineName) { return getSqlMapClientTemplate().queryForObject("getPipelineHistoryCount", pipelineName); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
count
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private Pipeline loadStages(Pipeline pipeline) { if (pipeline == null) { return null; } Stages stages = stageDao.getStagesByPipelineId(pipeline.getId()); pipeline.setStages(stages); return pipeline; }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadStages
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
public void setStageDao(StageSqlMapDao stageDao) { this.stageDao = stageDao; }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
setStageDao
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private Pipeline loadMaterialRevisions(Pipeline pipeline) { if (pipeline == null) { return null; } long pipelineId = pipeline.getId(); MaterialRevisions revisions = materialRepository.findMaterialRevisionsForPipeline(pipelineId); pipeline.setModificationsOnBuildCause...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadMaterialRevisions
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private PipelineInstanceModel loadPipelineHistoryBuildCause(PipelineInstanceModel pipeline) { if (pipeline != null) { MaterialRevisions materialRevisions = materialRepository.findMaterialRevisionsForPipeline(pipeline.getId()); pipeline.setMaterialRevisionsOnBuildCause(materialRevisions);...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadPipelineHistoryBuildCause
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
static String getLatestRevisionFromOrderedLists(List<Modification> orderedList1, List<Modification> orderedList2) { Modification latestModification = null; if (!orderedList1.isEmpty()) { latestModification = orderedList1.get(0); } if (!orderedList2.isEmpty()) { M...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
getLatestRevisionFromOrderedLists
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
public void pause(String pipelineName, String pauseCause, String pauseBy) { String cacheKey = cacheKeyForPauseState(pipelineName); synchronized (cacheKey) { Map<String, Object> args = arguments("pipelineName", pipelineName).and("pauseCause", pauseCause).and("pauseBy", pauseBy).and("paused", ...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
pause
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
public void unpause(String pipelineName) { String cacheKey = cacheKeyForPauseState(pipelineName); synchronized (cacheKey) { Map<String, Object> args = arguments("pipelineName", pipelineName).and("pauseCause", null).and("pauseBy", null).and("paused", false).and("pausedAt", null).asMap(); ...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
unpause
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
public PipelinePauseInfo pauseState(String pipelineName) { String cacheKey = cacheKeyForPauseState(pipelineName); PipelinePauseInfo result = goCache.get(cacheKey); if (result == null) { synchronized (cacheKey) { result = goCache.get(cacheKey); if (resu...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
pauseState
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
String cacheKeyForPauseState(String pipelineName) { return cacheKeyGenerator.generate("cacheKeyForPauseState", pipelineName.toLowerCase()); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
cacheKeyForPauseState
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
String cacheKeyForLatestPassedStage(long pipelineId, String stage) { return cacheKeyGenerator.generate("cacheKeyForlatestPassedStage", pipelineId, stage.toLowerCase()); }
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
cacheKeyForLatestPassedStage
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public StageIdentifier latestPassedStageIdentifier(long pipelineId, String stage) { String cacheKey = cacheKeyForLatestPassedStage(pipelineId, stage); StageIdentifier result = goCache.get(cacheKey); if (result == null) { synchronized (cacheKey) { result ...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
latestPassedStageIdentifier
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public List<PipelineIdentifier> getPipelineInstancesTriggeredWithDependencyMaterial(String pipelineName, PipelineIdentifier dependencyPipelineIdentifier) { String cacheKey = cacheKeyForPipelineInstancesTriggere...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
getPipelineInstancesTriggeredWithDependencyMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public List<PipelineIdentifier> getPipelineInstancesTriggeredWithDependencyMaterial(String pipelineName, MaterialInstance materialInstance, ...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
getPipelineInstancesTriggeredWithDependencyMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public PipelineInstanceModels loadHistoryForDashboard(List<String> pipelineNames) { if (pipelineNames == null || pipelineNames.isEmpty()) { return PipelineInstanceModels.createPipelineInstanceModels(); } // this is done to pick up an SQL query optimized for a single pi...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadHistoryForDashboard
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private PipelineInstanceModels loadHistoryForDashboard(String pipelineName) { if (isBlank(pipelineName)) { return PipelineInstanceModels.createPipelineInstanceModels(); } Map<String, Object> args = arguments("pipelineName", pipelineName).asMap(); List<PipelineInstanceModel> ...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
loadHistoryForDashboard
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
String cacheKeyForPipelineInstancesTriggeredWithDependencyMaterial(String pipelineName, String dependencyPipelineName, Integer dependencyPipelineCounter) { return cacheKe...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
cacheKeyForPipelineInstancesTriggeredWithDependencyMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
String cacheKeyForPipelineInstancesTriggeredWithDependencyMaterial(String pipelineName, String fingerPrint, String revision) { return cacheKeyGenerator.generate("cacheKey...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
cacheKeyForPipelineInstancesTriggeredWithDependencyMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private void invalidateCacheConditionallyForPipelineInstancesTriggeredWithDependencyMaterial(Pipeline pipeline) { BuildCause buildCause = pipeline.getBuildCause(); for (MaterialRevision materialRevision : buildCause.getMaterialRevisions()) { if (DependencyMaterial.TYPE.equals(materialRevisio...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
invalidateCacheConditionallyForPipelineInstancesTriggeredWithDependencyMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@Override public void updateComment(String pipelineName, int pipelineCounter, String comment) { Map<String, Object> args = arguments("pipelineName", pipelineName).and("pipelineCounter", pipelineCounter).and("comment", comment).asMap(); getSqlMapClientTemplate().update("updatePipelineComment", args);...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
updateComment
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
private Map<CaseInsensitiveString, TreeSet<Long>> getAllActivePipelineNamesVsTheirInstanceIDs() { String cacheKey = activePipelinesCacheKey(); Map<CaseInsensitiveString, TreeSet<Long>> result = goCache.get(cacheKey); if (result == null) { synchronized (cacheKey) { res...
Please call pipelineService.save(aPipeline) instead. <p/> This is particularly bad as it does NOT do the same as what the system does in the real code. In particular it does not save the JobInstances correctly. We need to remove this method and make sure that tests are using the same behaviour as the real code.
getAllActivePipelineNamesVsTheirInstanceIDs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/PipelineSqlMapDao.java
Apache-2.0
@TestOnly @Override public Stage saveWithJobs(Pipeline pipeline, Stage stage) { if (stage.getState() == null) { stage.building(); } stage = save(pipeline, stage); clearCachedStage(new StageIdentifier(pipeline, stage));//This is bad because it should be done in after-c...
Please call pipelineService.save(aPipeline) instead
saveWithJobs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public int getMaxStageCounter(long pipelineId, String stageName) { Map<String, Object> toGet = arguments("pipelineId", pipelineId).and("name", stageName).asMap(); Integer maxCounter = getSqlMapClientTemplate().queryForObject("getMaxStageCounter", toGet); return maxCounter == null ?...
Please call pipelineService.save(aPipeline) instead
getMaxStageCounter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public int getCount(String pipelineName, String stageName) { Map<String, Object> toGet = arguments("pipelineName", pipelineName).and("stageName", stageName).asMap(); String key = cacheKeyForStageCount(pipelineName, stageName); Integer count = goCache.get(key); if (count == ...
Please call pipelineService.save(aPipeline) instead
getCount
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
String cacheKeyForStageCount(String pipelineName, String stageName) { return cacheKeyGenerator.generate("numberOfStages", pipelineName, stageName); }
Please call pipelineService.save(aPipeline) instead
cacheKeyForStageCount
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public Stages getStagesByPipelineId(long pipelineId) { Stages stageHistory = new Stages( getSqlMapClientTemplate().queryForList("getStagesByPipelineId", pipelineId)); return new Stages(stageHistory); }
Please call pipelineService.save(aPipeline) instead
getStagesByPipelineId
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public int findLatestStageCounter(PipelineIdentifier pipeline, String stageName) { Map<String, Object> toGet = arguments("pipelineName", pipeline.getName()).and("pipelineCounter", pipeline.getCounter()).and( "stageName", stageName).asMap(); Integer maxCounter = getS...
Please call pipelineService.save(aPipeline) instead
findLatestStageCounter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public Stage findStageWithIdentifier(StageIdentifier identifier) { String cacheKey = cacheKeyForStageIdentifier(identifier); String cacheKeyForIdentifiers = cacheKeyForListOfStageIdentifiers(identifier); synchronized (cacheKeyForIdentifiers) { Stage stage = (Stage) goCa...
Please call pipelineService.save(aPipeline) instead
findStageWithIdentifier
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
String cacheKeyForListOfStageIdentifiers(StageIdentifier stageIdentifier) { return cacheKeyGenerator.generate("stageRunIdentifier", stageIdentifier.getPipelineName(), stageIdentifier.getPipelineCounter(), stageIdentifier.getStageName()); }
Please call pipelineService.save(aPipeline) instead
cacheKeyForListOfStageIdentifiers
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
String cacheKeyForStageIdentifier(StageIdentifier stageIdentifier) { return cacheKeyGenerator.generate("stageIdentifier", stageIdentifier.getPipelineName(), stageIdentifier.getPipelineCounter(), stageIdentifier.getStageName(), stageIdentifier.getStageCounter()); }
Please call pipelineService.save(aPipeline) instead
cacheKeyForStageIdentifier
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public Duration getExpectedDuration(String pipelineName, String stageName, JobInstance job) { Long durationSecs = getDurationOfLastSuccessfulOnAgent(pipelineName, stageName, job); return durationSecs == null ? Duration.ZERO : Duration.ofSeconds(durationSecs); }
Please call pipelineService.save(aPipeline) instead
getExpectedDuration
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public Long getDurationOfLastSuccessfulOnAgent(String pipelineName, String stageName, JobInstance job) { String key = job.getBuildDurationKey(pipelineName, stageName); Long duration; try { duration = (Long) cache.getFromCache(key, CacheEntry.INDEFINITE_EXPIRY); ...
Please call pipelineService.save(aPipeline) instead
getDurationOfLastSuccessfulOnAgent
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
private Long recalculateBuildDuration(String pipelineName, String stageName, JobInstance job) { Map<String, Object> toGet = arguments("buildName", job.getName()) .and("agentUuid", job.getAgentUuid()) .and("stageName", stageName) .and("pipelineName", pi...
Please call pipelineService.save(aPipeline) instead
recalculateBuildDuration
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public int getMaxStageOrder(long pipelineId) { Integer order = getSqlMapClientTemplate().queryForObject("getMaxStageOrder", pipelineId); return (order == null ? 0 : order); }
Please call pipelineService.save(aPipeline) instead
getMaxStageOrder
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public Integer getStageOrderInPipeline(long pipelineId, String stageName) { Map<String, Object> params = arguments("pipelineId", pipelineId).and("stageName", stageName).asMap(); return getSqlMapClientTemplate().queryForObject("getStageOrderInPipeline", params); }
Please call pipelineService.save(aPipeline) instead
getStageOrderInPipeline
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public void updateResult(final Stage stage, final StageResult result, String username) { transactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { @Override public void afterCommit() { StageIdentifier identifier = st...
Please call pipelineService.save(aPipeline) instead
updateResult
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public void afterCommit() { StageIdentifier identifier = stage.getIdentifier(); clearStageHistoryPageCaches(stage, identifier.getPipelineName(), true); clearJobStatusDependentCaches(stage.getId(), identifier); removeFromCache(cacheKey...
Please call pipelineService.save(aPipeline) instead
afterCommit
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
private void updateLastTransitionedTime(Stage stage) { Timestamp lastTransitionedTime = getSqlMapClientTemplate().queryForObject("getLastTransitionedTimeByStageId", stage.getId()); stage.setLastTransitionedTime(lastTransitionedTime); }
Please call pipelineService.save(aPipeline) instead
updateLastTransitionedTime
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public Stage mostRecentCompleted(StageConfigIdentifier identifier) { Map<String, Object> toGet = arguments("pipelineName", identifier.getPipelineName()) .and("stageName", identifier.getStageName()).asMap(); return getSqlMapClientTemplate().queryForObject("getMostRecentCompleted...
Please call pipelineService.save(aPipeline) instead
mostRecentCompleted
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public Stage mostRecentStage(StageConfigIdentifier identifier) { Map<String, Object> toGet = arguments("pipelineName", identifier.getPipelineName()) .and("stageName", identifier.getStageName()).asMap(); return getSqlMapClientTemplate().queryForObject("getMostRecentStage", toGet...
Please call pipelineService.save(aPipeline) instead
mostRecentStage
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public List<JobInstance> mostRecentJobsForStage(String pipelineName, String stageName) { Long mostRecentId = mostRecentId(pipelineName, stageName); Stage stage = stageByIdWithBuildsWithNoAssociations(mostRecentId); return new ArrayList<>(stage.getJobInstances()); }
Please call pipelineService.save(aPipeline) instead
mostRecentJobsForStage
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public Stages getPassedStagesByName(String pipelineName, String stageName, int limit, int offset) { Map<String, Object> toGet = arguments("pipelineName", pipelineName).and("stageName", stageName) .and("limit", limit).and("offset", offset).asMap(); return new Stages(getSqlMapCli...
Please call pipelineService.save(aPipeline) instead
getPassedStagesByName
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public List<StageAsDMR> getPassedStagesAfter(StageIdentifier stageIdentifier, int limit, int offset) { Stage laterThan = findStageWithIdentifier(stageIdentifier); Map<String, Object> toGet = arguments("pipelineName", stageIdentifier.getPipelineName()).and("stageName", stageIdentifier.getS...
Please call pipelineService.save(aPipeline) instead
getPassedStagesAfter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public Stages getAllRunsOfStageForPipelineInstance(String pipelineName, Integer pipelineCounter, String stageName) { String cacheKeyForAllStages = cacheKeyForAllStageOfPipeline(pipelineName, pipelineCounter, stageName); synchronized (cacheKeyForAllStages) { List<Stage> stages =...
Please call pipelineService.save(aPipeline) instead
getAllRunsOfStageForPipelineInstance
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
String cacheKeyForAllStageOfPipeline(String pipelineName, Integer pipelineCounter, String stageName) { return cacheKeyGenerator.generate("allStageOfPipeline", new CaseInsensitiveString(pipelineName), pipelineCounter, new CaseInsensitiveString(stageName)); }
Please call pipelineService.save(aPipeline) instead
cacheKeyForAllStageOfPipeline
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public List<Stage> findStageHistoryForChart(String pipelineName, String stageName, int pageSize, int offset) { Map<String, Object> args = arguments("pipelineName", pipelineName). and("stageName", stageName). and("offset", offset). and("li...
Please call pipelineService.save(aPipeline) instead
findStageHistoryForChart
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public int getTotalStageCountForChart(String pipelineName, String stageName) { String key = cacheKeyForStageCountForGraph(pipelineName, stageName); Integer total = goCache.get(key); if (total == null) { synchronized (key) { Map<String, Object> toGet = ar...
Please call pipelineService.save(aPipeline) instead
getTotalStageCountForChart
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public List<StageIdentity> findLatestStageInstances() { String key = cacheKeyForLatestStageInstances(); List<StageIdentity> stageIdentities = goCache.get(key); if (stageIdentities == null) { synchronized (key) { stageIdentities = goCache.get(key); ...
Please call pipelineService.save(aPipeline) instead
findLatestStageInstances
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public StageHistoryPage findStageHistoryPageByNumber(final String pipelineName, final String stageName, final int pageNumber, final int...
Please call pipelineService.save(aPipeline) instead
findStageHistoryPageByNumber
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public StageInstanceModels findDetailedStageHistoryViaCursor(String pipelineName, String stageName, FeedModifier feedModifier, long cursor, Integer pageSize) { String mutex = mutexForStageHistory(pipelineName, stageName); readWriteLock.acquireReadLock(mutex); try { Stri...
Please call pipelineService.save(aPipeline) instead
findDetailedStageHistoryViaCursor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public PipelineRunIdInfo getOldestAndLatestStageInstanceId(String pipelineName, String stageName) { Map<String, Object> params = arguments("pipelineName", pipelineName) .and("stageName", stageName).asMap(); return getSqlMapClientTemplate().queryForObject("getOldestAndLatestStag...
Please call pipelineService.save(aPipeline) instead
getOldestAndLatestStageInstanceId
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0
@Override public StageHistoryPage findStageHistoryPage(final Stage stage, final int pageSize) { final StageIdentifier id = stage.getIdentifier(); return findStageHistoryPage(id.getPipelineName(), id.getStageName(), () -> { int total = getCount(id.getPipelineName(), id.getStageName()); ...
Please call pipelineService.save(aPipeline) instead
findStageHistoryPage
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/dao/StageSqlMapDao.java
Apache-2.0