Source:
public void startPipeline(Pipeline pipeline, TriggerSource triggerSource) { if (enabled) { try { if (pipeline.getTrigger() != null && pipeline.isRespectQuietPeriod() && quietPeriodIndicator.inQuietPeriod( System.currentTimeMillis(), pipeline.getTrigger().getType())) { log.info( "Would trigger due to but pipeline is set to ignore automatic triggers during quiet periods", pipeline, pipeline.getTrigger()); } else { log.info("Triggering due to {}", pipeline, pipeline.getTrigger()); final String templatedPipelineType = "templatedPipeline"; if (templatedPipelineType.equals(pipeline.getType())) { boolean propagateAuth = pipeline.getTrigger() != null && pipeline.getTrigger().isPropagateAuth(); log.debug("Planning templated pipeline before triggering", pipeline); pipeline = pipeline.withPlan(true); try { Map pipelineToPlan = objectMapper.convertValue(pipeline, Map.class); Map resolvedPipelineMap = AuthenticatedRequest.allowAnonymous(() -> orca.plan(pipelineToPlan, true)); pipeline = objectMapper.convertValue(resolvedPipelineMap, Pipeline.class); } catch (RetrofitError e) { String orcaResponse = "N/A"; if (e.getResponse() != null && e.getResponse().getBody() != null) { new String(((TypedByteArray) e.getResponse().getBody()).getBytes()); } log.error("Failed planning {}: \n{}", pipeline, orcaResponse); pipeline = pipeline.withPlan(false); if (pipeline.getStages() == null) { pipeline = pipeline.withStages(Collections.emptyList()); } } if (propagateAuth) { pipeline = pipeline.withTrigger(pipeline.getTrigger().atPropagateAuth(true)); } } triggerPipeline(pipeline, triggerSource); registry.counter("orca.requests").increment(); } } catch (Exception e) { log.error("Unable to trigger pipeline {}: {}", pipeline, e); logOrcaErrorMetric(e.getClass().getName(), triggerSource.name(), getTriggerType(pipeline)); } } else { log.info( "Would trigger due to but triggering is disabled", pipeline, pipeline.getTrigger()); } }

Target:
public void startPipeline(Pipeline pipeline, TriggerSource triggerSource) { if (enabled) { try { if (pipeline.getTrigger() != null && pipeline.isRespectQuietPeriod() && quietPeriodIndicator.inQuietPeriod( System.currentTimeMillis(), pipeline.getTrigger().getType())) { log.info( "Would trigger due to but pipeline is set to ignore automatic triggers during quiet periods", pipeline, pipeline.getTrigger()); } else { log.info("Triggering due to {}", pipeline, pipeline.getTrigger()); final String templatedPipelineType = "templatedPipeline"; if (templatedPipelineType.equals(pipeline.getType())) { boolean propagateAuth = pipeline.getTrigger() != null && pipeline.getTrigger().isPropagateAuth(); log.debug("Planning templated pipeline before triggering", pipeline); pipeline = pipeline.withPlan(true); try { Map pipelineToPlan = objectMapper.convertValue(pipeline, Map.class); Map resolvedPipelineMap = AuthenticatedRequest.allowAnonymous(() -> orca.plan(pipelineToPlan, true)); pipeline = objectMapper.convertValue(resolvedPipelineMap, Pipeline.class); } catch (RetrofitError e) { String orcaResponse = "N/A"; if (e.getResponse() != null && e.getResponse().getBody() != null) { orcaResponse = new String(((TypedByteArray) e.getResponse().getBody()).getBytes()); } log.error("Failed planning {}: \n{}", pipeline, orcaResponse); pipeline = pipeline.withPlan(false); if (pipeline.getStages() == null) { pipeline = pipeline.withStages(Collections.emptyList()); } } if (propagateAuth) { pipeline = pipeline.withTrigger(pipeline.getTrigger().atPropagateAuth(true)); } } triggerPipeline(pipeline, triggerSource); registry.counter("orca.requests").increment(); } } catch (Exception e) { log.error("Unable to trigger pipeline {}: {}", pipeline, e); logOrcaErrorMetric(e.getClass().getName(), triggerSource.name(), getTriggerType(pipeline)); } } else { log.info( "Would trigger due to but triggering is disabled", pipeline, pipeline.getTrigger()); } }