code: private PipelineResponse buildPipelineResponse(Pipeline pipeline, Long lowerBound, Long upperBound){
          /**
           * get the collector item and dashboard
           */
          CollectorItem dashboardCollectorItem = collectorItemRepository.findOne(pipeline.getCollectorItemId());
          Dashboard dashboard = dashboardRepository.findOne(new ObjectId((String)dashboardCollectorItem.getOptions().get("dashboardId")));
          
          PipelineResponse pipelineResponse = new PipelineResponse();
          pipelineResponse.setCollectorItemId(dashboardCollectorItem.getId());
          // Fix for 1254
  		pipelineResponse.setProdStage(PipelineUtils.getProdStage(dashboard));
  		pipelineResponse.setOrderMap(PipelineUtils.getOrderForStages(dashboard));
  		Map<PipelineStage, String> stageToEnvironmentNameMap = PipelineUtils.getStageToEnvironmentNameMap(dashboard);
  
  
  		List<PipelineStage> pipelineStageList = new ArrayList<>();
  
  		for (PipelineStage pl : stageToEnvironmentNameMap.keySet()) {
  			pipelineStageList.add(pl);
  		}
  
          /**
           * iterate over the pipeline stages
           * **/
          for(PipelineStage stage : pipelineStageList){
  
              List<PipelineResponseCommit> commitsForStage = findNotPropagatedCommits(dashboard, pipeline, stage,pipelineStageList);
              pipelineResponse.setStageCommits(stage, commitsForStage);
          }
         return pipelineResponse;
      }
docs: Creates the response that is returned to the client