Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-22924

GitHUB PR job should use when clause to filter to just PRs.

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      Right now the GitHub PR checking job uses a Jenkins environment variable to stop branch builds:

      
                              # If CHANGE_URL is set (e.g., Github Branch Source plugin), process it.
                              # Otherwise exit, because we don't want HBase to do a
                              # full build.  We wouldn't normally do this check for smaller
                              # projects. :)
                              if [[ -z "${CHANGE_URL}" ]]; then
                                  echo "Full build skipped" > "${WORKSPACE}/${PATCHDIR}/report.html"
                                  exit 0
                              fi
      

      instead we should use a Jenkinsfile when clause (ref) and the changeRequest() filter to say we want to build PRs. Assuming the eventual adaptation of the JIRA precommit job properly sets that it's testing a change this should also help reuse there.

        stage ('precommit-run') {
          when { changeRequest() }
          steps {
            ...
          }
        }
      

      it would also be nice to fold things into a single stage so that we skip the yetus checkout when we're not going to run tests.

      Attachments

        Issue Links

          Activity

            People

              shankysharma Shanky Sharma
              busbey Sean Busbey
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: