include failure detail in pipeline.build.frequency
refactor getPipelineStageBuildHistory