question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sha1 parameter not present in LTS jenkins 1.651.2 + ghprb 1.32.2, parametrized jobs

See original GitHub issue

After upgrading to LTS 1.651.2 and latest stable version of ghprb plugin 1.32.2, I observe builds that have sha1 parameter undefined. Jobs were configured with DSL:

freeStyleJob('xxxx_pull-requests') {
  parameters {
    stringParam('sha1', null, null)
  }
    githubPullRequest {
      cron("${scm_poll_short}")
      useGitHubHooks()
    }
  }
...
}

Build was triggered, ghprb* variables were populated to environment, however, sha1 was not present. it can be seen here: https://ostroproject.org/jenkins/job/dsl-meta-ostro_pull-requests/1514/

After I removed stringParameter() from DSL, jobs started to be populating sha1 variable properly: https://ostroproject.org/jenkins/job/dsl-meta-ostro_pull-requests/1515/ , but that means it’s impossible to start those jobs manually anymore.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:20 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dmaichercommented, May 31, 2016

I might have the same issue today after upgrading to Jenkins 2.7 and plugin version 1.32.2. The environment variable ${ghprbSourceBranch} is suddenly empty… 😦

Could be connected?

1reaction
nickmshelleycommented, Jun 6, 2016

This is happening to us as well. We got it to run the correct PR by removing the sha1 parameter from our Jenkins job, but now all pending builds are combined into a single build and only the first one is run, so we get a job that looks like this (which will only run and comment on 2176):

GitHub pull request #2176 of commit db84c1fa12b075266382bda60be22eb6565a69ae, no merge conflicts.
GitHub pull request #2175 of commit 74ba2a1b47ccf2cbc2fb34d6226f2a72b93bee65, no merge conflicts.
GitHub pull request #2177 of commit c5137f73f140c424fdc739ad159c8afbce1ade95, no merge conflicts.
GitHub pull request #2174 of commit 77391fda7f78ffdb3c84f1471fa29e86c5c5026f, no merge conflicts.
GitHub pull request #2177 of commit 5a5e3fd09c397545b175a3e6b730ee86028ed8df, has merge conflicts.
GitHub pull request #2177 of commit 98bc00e3561e619f296a489a5d0d512fb10cb5d6, no merge conflicts.
Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Pull Request Builder - Jenkins Plugins
If you want to manually build the job, in the job setting check "This build is parameterized" and add string parameter named "sha1"....
Read more >
Plugins affected by fix for SECURITY-170 - Jenkins
The fix for this issue — which was first included in Jenkins versions 1.651.2 and Jenkins 2.3 — means that only build parameters...
Read more >
Jenkins Job Builder Documentation - Read the Docs
Jenkins Job Builder takes simple descriptions of Jenkins jobs in YAML or JSON format and uses them to configure. Jenkins.
Read more >
Jenkins Job Builder Documentation - manpages.ubuntu!
If no configuration files are found (either in the default paths or given through the command-line), jenkins-jobs will skip querying for plugin information....
Read more >
Jenkins Pull Request builder ignoring branches with ${sha1}
So step one is to make sure that the only trigger enabled is the GHPRB plugin. The next step is to recognize that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found