Class BuildDataHelper

java.lang.Object
org.jenkinsci.plugins.github.util.BuildDataHelper

public final class BuildDataHelper extends Object
Stores common methods for BuildData handling.
Since:
1.10
Author:
Oleg Nenashev
  • Method Details

    • calculateBuildData

      public static hudson.plugins.git.util.BuildData calculateBuildData(String parentName, String parentFullName, List<hudson.plugins.git.util.BuildData> buildDataList)
      Calculate build data from downstream builds, that could be a shared library which is loaded first in a pipeline. For that reason, this method compares all remote URLs for each build data, with the real project name, to determine the proper build data. This way, the SHA returned in the build data will relate to the project
      Parameters:
      parentName - name of the parent build
      parentFullName - full name of the parent build
      buildDataList - the list of build datas from a build run
      Returns:
      the build data related to the project, null if not found
    • getCommitSHA1

      @NonNull public static org.eclipse.jgit.lib.ObjectId getCommitSHA1(@NonNull Run<?,?> build) throws IOException
      Gets SHA1 from the build.
      Parameters:
      build -
      Returns:
      SHA1 of the las
      Throws:
      IOException - Cannot get the info about commit ID