-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Ubuntu 16.04.2 (Xenial)
Jenkins 2.60.1
GitHub plugin 1.27.0
WORKAROUND After creating a job, make a build, then Manage Jenkins > Configure System > GitHub > Advanced > Re-register hooks for all jobs.
Steps to reproduce:
1. Generate personal access token on GitHub with repo and admin:repo_hook scopes.
2. Add "Secret text" credentials with the token from the previous step.
3. In Manage Jenkins > Configure System add GitHub server with credentials from the previous step.
4. Create Pipeline job.
4.1. Check "GitHub project" and specify a repository URL.
4.2. Check "GitHub hook trigger for GITScm polling."
4.3. Click "Save."
In System Log I see:
GitHub webhooks activated for job p1 with [] (events: [PUSH])
When I create Freestyle Project with repository URL and credentials specified on Source Code Management tab and "GitHub hook trigger for GITScm polling" checked, I see:
GitHub webhooks activated for job fsp1 with [GitHubRepositoryName[host=github.com,username=user,repository=repo]] (events: [PUSH]) PING webhook received from repo <[https://github.com/user/repo]>!
I must admit that even for Freestyle project just checking "GitHub project" and specifying repository URL doesn't cut it. Which is strange. Isn't that enough info to create a webhook?
—
UPD I was about to report it again, but found this issue. So let me report again after all.
Environment: Jenkins 2.277, Docker version 18.06.3-ce build d7080c1, Debian GNU/Linux 8, GitHub API Plugin 1.122, GitHub plugin 1.32.0.
Steps to reproduce:
# docker-compose.yml
version: '3'
services:
jenkins:
image: jenkins/jenkins:2.277
ports:
- 8080:8080
$ docker-compose up
- Unlock Jenkins
- Install suggested plugins
- Create a user
- https://github.com/settings/tokens
- Generate new token
- Scopes: repo, admin:repo_hook
- Generate token
- Manage Jenkins > Manage Credentials > (Jenkins/global) > Add credentials
- Kind: Secret text
- Scope: System
- Secret: (the token)
- OK
- Manage Jenkins > Manage Credentials > (Jenkins/global) Add credentials
- Kind: Username with password
- Scope: Global
- Username: (email)
- Password: (password)
- Manage Jenkins > Configure System > GitHub > Add GitHub Server > GitHub Server
- Choose the token credentials
- Test connection (succeeds)
- Check Manage hooks
- Save
- Create a public repository on GitHub with the following Jenkinsfile in the master branch:
pipeline { agent any stages { stage('Stage 1') { steps { sh 'echo $GIT_COMMIT' } } } }
- New Item
- Enter an item name
- Pipeline
- OK
- Check GitHub project
- Enter the URL: https://github.com/USER/REPO
- Check GitHub hook trigger for GITScm polling
- Pipeline: Pipeline from SCM
- SCM: Git
- Repository URL: https://github.com/USER/REPO
- Credentials: (credentials)
- Branch specifier: */master (the default)
- Save
- https://github.com/USER/REPO/settings/hooks
No new hooks.
[JENKINS-45120] GitHub plugin doesn't automatically add webhooks on GitHub for a Pipeline job
Description |
Original:
Steps to reproduce: 1. Generate personal access token on GitHub with `repo` and `admin:repo_hook` scopes. 2. Add "Secret text" credentials with the token from the previous step. 3. In Manage Jenkins > Configure System add GitHub server with credentials from the previous step. 4. Create Pipeline job. 4.1. Check "GitHub project" and specify repository URL. 4.2. Check "GitHub hook trigger for GITScm polling." 4.3. Click "Save." In System Log I see: {code:java} GitHub webhooks activated for job p1 with [] (events: [PUSH]) {code} When I create Freestyle Project with repository URL and credentials specified on Source Code Management tab and "GitHub hook trigger for GITScm polling" checked, I see: {code:java} GitHub webhooks activated for job fsp1 with [GitHubRepositoryName[host=github.com,username=user,repository=repo]] (events: [PUSH]) PING webhook received from repo <[https://github.com/user/repo]>! {code} I must admit that even for Freestyle project just checking "GitHub project" and specifying repository URL doesn't cut it. Which is strange. Isn't that enough info to create a webhook? |
New:
Steps to reproduce: 1. Generate personal access token on GitHub with "repo" and "admin:repo_hook" scopes. 2. Add "Secret text" credentials with the token from the previous step. 3. In Manage Jenkins > Configure System add GitHub server with credentials from the previous step. 4. Create Pipeline job. 4.1. Check "GitHub project" and specify repository URL. 4.2. Check "GitHub hook trigger for GITScm polling." 4.3. Click "Save." In System Log I see: {code:java} GitHub webhooks activated for job p1 with [] (events: [PUSH]) {code} When I create Freestyle Project with repository URL and credentials specified on Source Code Management tab and "GitHub hook trigger for GITScm polling" checked, I see: {code:java} GitHub webhooks activated for job fsp1 with [GitHubRepositoryName[host=github.com,username=user,repository=repo]] (events: [PUSH]) PING webhook received from repo <[https://github.com/user/repo]>! {code} I must admit that even for Freestyle project just checking "GitHub project" and specifying repository URL doesn't cut it. Which is strange. Isn't that enough info to create a webhook? |
Summary | Original: GitHub plugin doesn't automatically add webhooks to GitHub for Pipeline job | New: GitHub plugin doesn't automatically add webhooks on GitHub for Pipeline job |
Description |
Original:
Steps to reproduce: 1. Generate personal access token on GitHub with "repo" and "admin:repo_hook" scopes. 2. Add "Secret text" credentials with the token from the previous step. 3. In Manage Jenkins > Configure System add GitHub server with credentials from the previous step. 4. Create Pipeline job. 4.1. Check "GitHub project" and specify repository URL. 4.2. Check "GitHub hook trigger for GITScm polling." 4.3. Click "Save." In System Log I see: {code:java} GitHub webhooks activated for job p1 with [] (events: [PUSH]) {code} When I create Freestyle Project with repository URL and credentials specified on Source Code Management tab and "GitHub hook trigger for GITScm polling" checked, I see: {code:java} GitHub webhooks activated for job fsp1 with [GitHubRepositoryName[host=github.com,username=user,repository=repo]] (events: [PUSH]) PING webhook received from repo <[https://github.com/user/repo]>! {code} I must admit that even for Freestyle project just checking "GitHub project" and specifying repository URL doesn't cut it. Which is strange. Isn't that enough info to create a webhook? |
New:
Steps to reproduce:
1. Generate personal access token on GitHub with "repo" and "admin:repo_hook" scopes. 2. Add "Secret text" credentials with the token from the previous step. 3. In Manage Jenkins > Configure System add GitHub server with credentials from the previous step. 4. Create Pipeline job. 4.1. Check "GitHub project" and specify repository URL. 4.2. Check "GitHub hook trigger for GITScm polling." 4.3. Click "Save." In System Log I see: {code:java} GitHub webhooks activated for job p1 with [] (events: [PUSH]) {code} When I create Freestyle Project with repository URL and credentials specified on Source Code Management tab and "GitHub hook trigger for GITScm polling" checked, I see: {code:java} GitHub webhooks activated for job fsp1 with [GitHubRepositoryName[host=github.com,username=user,repository=repo]] (events: [PUSH]) PING webhook received from repo <[https://github.com/user/repo]>! {code} I must admit that even for Freestyle project just checking "GitHub project" and specifying repository URL doesn't cut it. Which is strange. Isn't that enough info to create a webhook? --- *UPD* I was about to report it again, but found this issue. So let me report again after all. Environment: Jenkins 2.277, Docker version 18.06.3-ce build d7080c1, Debian GNU/Linux 8, GitHub API Plugin 1.122, GitHub plugin 1.32.0. * https://github.com/settings/tokens ** Generate new token ** Scopes: repo, admin:repo_hook ** Generate token * Manage Jenkins > Manage Credentials > (Jenkins/global) > Add credentials ** Kind: Secret text ** Scope: System ** Secret: (the token) ** OK * Manage Jenkins > Configure System > GitHub > Add GitHub Server > GitHub Server ** Choose the credentials ** Test connection (succeeds) ** Check Manage hooks ** Save * New Item ** Enter an item name ** Pipeline ** OK ** Check GitHub project ** Enter the URL: https://github.com/REPO/NAME ** Check GitHub hook trigger for GITScm polling ** Pipeline: Pipeline from SCM ** SCM: Git ** Repository URL: https://github.com/REPO/NAME ** Credentials: (credentials) ** Branch specifier: */master (the default) ** Save * https://github.com/USER/REPO/settings/hooks No new hooks. |
Description |
Original:
Steps to reproduce:
1. Generate personal access token on GitHub with "repo" and "admin:repo_hook" scopes. 2. Add "Secret text" credentials with the token from the previous step. 3. In Manage Jenkins > Configure System add GitHub server with credentials from the previous step. 4. Create Pipeline job. 4.1. Check "GitHub project" and specify repository URL. 4.2. Check "GitHub hook trigger for GITScm polling." 4.3. Click "Save." In System Log I see: {code:java} GitHub webhooks activated for job p1 with [] (events: [PUSH]) {code} When I create Freestyle Project with repository URL and credentials specified on Source Code Management tab and "GitHub hook trigger for GITScm polling" checked, I see: {code:java} GitHub webhooks activated for job fsp1 with [GitHubRepositoryName[host=github.com,username=user,repository=repo]] (events: [PUSH]) PING webhook received from repo <[https://github.com/user/repo]>! {code} I must admit that even for Freestyle project just checking "GitHub project" and specifying repository URL doesn't cut it. Which is strange. Isn't that enough info to create a webhook? --- *UPD* I was about to report it again, but found this issue. So let me report again after all. Environment: Jenkins 2.277, Docker version 18.06.3-ce build d7080c1, Debian GNU/Linux 8, GitHub API Plugin 1.122, GitHub plugin 1.32.0. * https://github.com/settings/tokens ** Generate new token ** Scopes: repo, admin:repo_hook ** Generate token * Manage Jenkins > Manage Credentials > (Jenkins/global) > Add credentials ** Kind: Secret text ** Scope: System ** Secret: (the token) ** OK * Manage Jenkins > Configure System > GitHub > Add GitHub Server > GitHub Server ** Choose the credentials ** Test connection (succeeds) ** Check Manage hooks ** Save * New Item ** Enter an item name ** Pipeline ** OK ** Check GitHub project ** Enter the URL: https://github.com/REPO/NAME ** Check GitHub hook trigger for GITScm polling ** Pipeline: Pipeline from SCM ** SCM: Git ** Repository URL: https://github.com/REPO/NAME ** Credentials: (credentials) ** Branch specifier: */master (the default) ** Save * https://github.com/USER/REPO/settings/hooks No new hooks. |
New:
Steps to reproduce:
1. Generate personal access token on GitHub with "repo" and "admin:repo_hook" scopes. 2. Add "Secret text" credentials with the token from the previous step. 3. In Manage Jenkins > Configure System add GitHub server with credentials from the previous step. 4. Create Pipeline job. 4.1. Check "GitHub project" and specify repository URL. 4.2. Check "GitHub hook trigger for GITScm polling." 4.3. Click "Save." In System Log I see: {code:java} GitHub webhooks activated for job p1 with [] (events: [PUSH]) {code} When I create Freestyle Project with repository URL and credentials specified on Source Code Management tab and "GitHub hook trigger for GITScm polling" checked, I see: {code:java} GitHub webhooks activated for job fsp1 with [GitHubRepositoryName[host=github.com,username=user,repository=repo]] (events: [PUSH]) PING webhook received from repo <[https://github.com/user/repo]>! {code} I must admit that even for Freestyle project just checking "GitHub project" and specifying repository URL doesn't cut it. Which is strange. Isn't that enough info to create a webhook? --- *UPD* I was about to report it again, but found this issue. So let me report again after all. Environment: Jenkins 2.277, Docker version 18.06.3-ce build d7080c1, Debian GNU/Linux 8, GitHub API Plugin 1.122, GitHub plugin 1.32.0. Steps to reproduce: {code} # docker-compose.yml version: '3' services: jenkins: image: jenkins/jenkins:2.277 ports: - 8080:8080 {code} {code} $ docker-compose up {code} * Unlock Jenkins * Install suggested plugins * Create a user * https://github.com/settings/tokens ** Generate new token ** Scopes: repo, admin:repo_hook ** Generate token * Manage Jenkins > Manage Credentials > (Jenkins/global) > Add credentials ** Kind: Secret text ** Scope: System ** Secret: (the token) ** OK * Manage Jenkins > Configure System > GitHub > Add GitHub Server > GitHub Server ** Choose the credentials ** Test connection (succeeds) ** Check Manage hooks ** Save * New Item ** Enter an item name ** Pipeline ** OK ** Check GitHub project ** Enter the URL: https://github.com/REPO/NAME ** Check GitHub hook trigger for GITScm polling ** Pipeline: Pipeline from SCM ** SCM: Git ** Repository URL: https://github.com/REPO/NAME ** Credentials: (credentials) ** Branch specifier: */master (the default) ** Save * https://github.com/USER/REPO/settings/hooks No new hooks. |
I am seeing the exact same issue. Brand new instance (2.73.2) with a similar Pipeline job, but all I see is:
GitHub webhooks activated for job <jobname> with [] (events: [PUSH])
If I check on the GitHub side there are no new webhooks added, even though there is a Global config server for GitHub with credentials that test successfully via the Test Connection button.
Feels like something is missing from the workflow/documentation.