code: public static BuildData calculateBuildData(
          String parentName, String parentFullName, List<BuildData> buildDataList
      ) {
  
          if (buildDataList == null) {
              return null;
          }
  
          if (buildDataList.size() == 1) {
              return buildDataList.get(0);
          }
  
          String projectName = parentFullName.replace(parentName, "");
  
          if (projectName.endsWith("/")) {
              projectName = projectName.substring(0, projectName.lastIndexOf('/'));
          }
  
          for (BuildData buildData : buildDataList) {
              Set<String> remoteUrls = buildData.getRemoteUrls();
  
              for (String remoteUrl : remoteUrls) {
                  if (remoteUrl.contains(projectName)) {
                      return buildData;
                  }
              }
          }
  
          return null;
      }
docs: 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
  
  @param parentName name of the parent build
  @param parentFullName full name of the parent build
  @param buildDataList the list of build datas from a build run
  @return the build data related to the project, null if not found