Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get automatic builds to work #19

Closed
ghost opened this issue Jun 13, 2014 · 10 comments
Closed

Can't get automatic builds to work #19

ghost opened this issue Jun 13, 2014 · 10 comments

Comments

@ghost
Copy link

ghost commented Jun 13, 2014

The webhook is configured properly in the github settings, and Jenkins appears to be receiving the pushes as the following can be found in the log:

Jun 13, 2014 6:07:55 PM INFO com.groupon.jenkins.github.GithubWebhook processGitHubPayload
Received POST by r04r
Jun 13, 2014 6:07:56 PM INFO com.groupon.jenkins.github.GithubWebhook processGitHubPayload
Received kicking off build for https://github.com/r04r/TinyBBS2

But when looking at https://github.com/groupon/DotCi/blob/master/src/main/java/com/groupon/jenkins/github/GithubWebhook.java#L78 it seems that it fails to find the associated project to actually schedule the build? The project itself was configured through 'New DotCI Job' and the configured associated github repository appears to correctly be https://github.com/r04r/TinyBBS2.

The payload sent by github is:

{
  "ref": "refs/heads/master",
  "after": "1e04dfdac45e65b2b67bf0c452a17bb6546892f0",
  "before": "55609434587e7de558e3c8103cfea54d6225d35b",
  "created": false,
  "deleted": false,
  "forced": false,
  "compare": "https://github.com/r04r/TinyBBS2/compare/55609434587e...1e04dfdac45e",
  "commits": [
    {
      "id": "1e04dfdac45e65b2b67bf0c452a17bb6546892f0",
      "distinct": true,
      "message": "test jenkins",
      "timestamp": "2014-06-13T18:20:57+02:00",
      "url": "https://github.com/r04r/TinyBBS2/commit/1e04dfdac45e65b2b67bf0c452a17bb6546892f0",
      "author": {
        "name": "r04r",
        "email": "r04r@minichan.org",
        "username": "r04r"
      },
      "committer": {
        "name": "r04r",
        "email": "r04r@minichan.org",
        "username": "r04r"
      },
      "added": [

      ],
      "removed": [

      ],
      "modified": [
        ".ci.yml"
      ]
    }
  ],
  "head_commit": {
    "id": "1e04dfdac45e65b2b67bf0c452a17bb6546892f0",
    "distinct": true,
    "message": "test jenkins",
    "timestamp": "2014-06-13T18:20:57+02:00",
    "url": "https://github.com/r04r/TinyBBS2/commit/1e04dfdac45e65b2b67bf0c452a17bb6546892f0",
    "author": {
      "name": "r04r",
      "email": "r04r@minichan.org",
      "username": "r04r"
    },
    "committer": {
      "name": "r04r",
      "email": "r04r@minichan.org",
      "username": "r04r"
    },
    "added": [

    ],
    "removed": [

    ],
    "modified": [
      ".ci.yml"
    ]
  },
  "repository": {
    "id": 20500920,
    "name": "TinyBBS2",
    "url": "https://github.com/r04r/TinyBBS2",
    "description": "Incomplete.",
    "homepage": "",
    "watchers": 0,
    "stargazers": 0,
    "forks": 0,
    "fork": false,
    "size": 744,
    "owner": {
      "name": "r04r",
      "email": "r04r@minichan.org"
    },
    "private": false,
    "open_issues": 0,
    "has_issues": true,
    "has_downloads": true,
    "has_wiki": true,
    "language": "JavaScript",
    "created_at": 1401916265,
    "pushed_at": 1402676480,
    "master_branch": "master"
  },
  "pusher": {
    "name": "r04r",
    "email": "r04r@minichan.org"
  }
}
@charliek
Copy link

I'm seeing this same behavior.

@suryagaddipati
Copy link
Contributor

@charliek @r04r
I am unclear as to what is causing the plugin to not see the jobs, can you try these debugging steps.

@charliek
Copy link

The Associated github repository looked correct.

When I check Grant READ permissions for Anonymous Users the webhook kicked off a build. However I can also browse the jenkins server anonymously then, which I don't want to allow. Is there a way to have the hooks work without read permissions for anonymous users?

image

If I uncheck Grant READ permissions for Anonymous Users the build no longer is kicked off.

@ghost
Copy link
Author

ghost commented Jun 24, 2014

I also disabled read permissions for anonymous users.

@charliek
Copy link

Also my callback url is not /github-webhook as show on the authentication page. It was defaulted to /githook. Not sure if that is anything?

@suryagaddipati
Copy link
Contributor

@charliek yea /githook is the right webhook url, /github-webhook was in conflict with another plugin.

@r04r @charliek I really haven't tested dotci with github authorizations do you mind opening a separate issue describing this behavior.

@charliek
Copy link

I was able to get this working when I switched so a more simple matrix based authentication.

I have to run now, but will file a separate issue later tonight if @r04r doesn't beat me to it.

@charliek
Copy link

I created #42 to capture this. Let me know if you want me to include any more info.

@suryagaddipati out of curiosity what is a tested authentication structure that you use with dot-ci? Switching to matrix based auth worked but adding new jobs seemed to break. Trying to figure out how to best authenticate jenkins and use dot-ci before #42 is addressed?

@suryagaddipati
Copy link
Contributor

Hey @charliek we use Project-based Matrix Authorization Strategy with Anonymous READ. Sorry I know thats not ideal for you.

@charliek
Copy link

Thanks for the info and for open sourcing and working on DotCi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants