Class GitHubChecksContext

  • public abstract class GitHubChecksContext
    extends Object
    Base class for a context that publishes GitHub checks.
    • Constructor Detail

      • GitHubChecksContext

        protected GitHubChecksContext​(Job<?,​?> job,
                                      String url,
                                      SCMFacade scmFacade)
    • Method Detail

      • getHeadSha

        public abstract String getHeadSha()
        Returns the commit sha of the run.
        the commit sha of the run
      • getRepository

        public abstract String getRepository()
        Returns the source repository's full name of the run. The full name consists of the owner's name and the repository's name, e.g. jenkins-ci/jenkins
        the source repository's full name
      • isValid

        public abstract boolean isValid​( logger)
        Returns whether the context is valid (with all properties functional) to use.
        logger - the filtered logger
        whether the context is valid to use
      • getCredentialsId

        protected abstract String getCredentialsId()
      • getCredentials

        public com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getCredentials()
        Returns the credentials to access the remote GitHub repository.
        the credentials
      • getURL

        public String getURL()
        Returns the URL of the run's summary page, e.g.
        the URL of the summary page
      • getJob

        protected Job<?,​?> getJob()
      • getScmFacade

        protected final SCMFacade getScmFacade()
      • getGitHubAppCredentials

        protected com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getGitHubAppCredentials​(String credentialsId)
      • hasGitHubAppCredentials

        protected boolean hasGitHubAppCredentials()
      • hasCredentialsId

        protected boolean hasCredentialsId()
      • hasValidCredentials

        protected boolean hasValidCredentials​( logger)
      • getId

        public Optional<Long> getId​(String name)
        Returns the id of a GitHubChecksAction for this run, if any.
        name - the name of the check
        the id of the check run
      • getRun

        protected abstract Optional<Run<?,​?>> getRun()