private Map < String , PipelineCommit > findCommitsForStage ( Dashboard dashboard , Pipeline pipeline , PipelineStage stage ) { Map < String , PipelineCommit > commitMap = new HashMap <> ( ) ; // The environment name including the pseudo environments "Build" and "Commit" String psuedoEnvironmentName = PipelineStage . COMMIT . equals ( stage ) || PipelineStage . BUILD . equals ( stage ) ? stage . getName ( ) : PipelineUtils . getStageToEnvironmentNameMap ( dashboard ) . get ( stage ) ; if ( psuedoEnvironmentName != null ) { commitMap = pipeline . getCommitsByEnvironmentName ( psuedoEnvironmentName ) ; } return commitMap ; }
Gets all commits for a given pipeline stage taking into account the mappings for environment stages