Interface RepositoryBuildStatus


public interface RepositoryBuildStatus
A build result associated with a commit in a repository.
Since:
7.6
  • Method Details

    • getBuildNumber

      @Nonnull Optional<String> getBuildNumber()
      An identifier for the specific run that resulted in this build status. For example, in Bamboo the URL to a build might be https://my-bamboo-url.com/browse/PROJ-PLAN123-5 for the 5th run of the PLAN123 branch plan of the parent plan PLAN in the project PROJ. In this case the build number would be '5'.
      Returns:
      the build number if one exists, or Optional.empty() otherwise
    • getBuildServer

      @Nonnull Optional<BuildServer> getBuildServer()
      Returns:
      the build server that posted this build status, if known, Optional.empty() otherwise
      Since:
      7.8
    • getCommit

      @Nonnull Optional<Commit> getCommit()
      Returns the commit this build status is attached to. This will not be present in build statuses created using the build status rest API (instead of the repository build status rest API).
      Returns:
      the commit associated with the build, if there is one, Optional.empty() otherwise
      Since:
      7.8
    • getCommitId

      @Nonnull String getCommitId()
      Returns:
      the commit ID that the build ran against
    • getBuildStatusLinks

      @Nonnull BuildStatusLinks getBuildStatusLinks()
      Returns:
      all external links associated with the build status
      Since:
      7.8
    • getCreatedDate

      @Nonnull Date getCreatedDate()
      The date tha the build status was first created. If the build status is subsequently updated (e.g. to change the state from INPROGRESS to SUCCESSFUL, the created date will remain the same but the getUpdatedDate() will change.
      Returns:
      the date that the build status was first created
    • getDescription

      @Nonnull Optional<String> getDescription()
      A human readable description of the build that was run.
      Returns:
      the description of the build that this build status represents, or Optional.empty() if none exists
    • getDuration

      @Nonnull Optional<Long> getDuration()
      Returns:
      the duration of the build in ms, or null if the duration is not provided
      Since:
      7.8
    • getKey

      @Nonnull String getKey()
      The key representing the build. The key should be a unique identifier when combined with the repository and the commit ID. For example, in Bamboo the URL to a build might be https://my-bamboo-url.com/browse/PROJ-PLAN123-5 for the 5th run of the PLAN123 branch plan of the parent plan PLAN in the project PROJ. In this case, the key would be PROJ-PLAN123
      Returns:
      the build key
    • getName

      @Nonnull Optional<String> getName()
      A human readable name of the build that was run.
      Returns:
      the name of the build, or Optional.empty() is none exists
    • getParent

      @Nonnull Optional<String> getParent()
      The key of the parent plan for this build. For example, in Bamboo the URL to a build might be https://my-bamboo-url.com/browse/PROJ-PLAN123-5 for the 5th run of the PLAN123 branch plan of the parent plan PLAN in the project PROJ. In this case, the parent key would be PROJ-PLAN (where as the key would be PROJ-PLAN123).
      Returns:
      the identifier for the parent of the plan or job that produced this build status, if there is one, Optional.empty() otherwise
    • getRef

      @Nonnull Optional<String> getRef()
      The fully qualified ref that the build is associated with.
      Returns:
      the branch or tag that this build result is associated with, or Optional.empty() if the CI tool did not provide one
    • getRepository

      @Nonnull Repository getRepository()
      The repository that the build is associated with.
      Returns:
      the repository for this build status
    • getState

      @Nonnull BuildState getState()
      The outcome of the build (BuildState.SUCCESSFUL or BuildState.FAILED or BuildState.INPROGRESS if the build hasn't completed yet.
      Returns:
      the BuildState
    • getTestResults

      @Nonnull Optional<TestResults> getTestResults()
      A high level summary of which tests passed and failed.
      Returns:
      the TestResults for the build, if there are any, Optional.empty() otherwise
    • getUpdatedDate

      @Nonnull Date getUpdatedDate()
      The date that the build status for this repository, commitId and key was last updated.
      Returns:
      the date this build status was last updated
    • getUrl

      @Nonnull String getUrl()
      A url to this build in the CI tool that ran it, so that users are able to navigate there for more information.
      Returns:
      a link to the build