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

Ghprb cannot manage webhooks when credentials are configured using init.d scripts #468

Open
brandon-fryslie opened this issue Jun 27, 2017 · 0 comments

Comments

@brandon-fryslie
Copy link

I'm unable to get the ghprb plugin to properly manage my github webhooks when used with the Job DSL. After looking at the code, I believe this is an architectural issue with the plugin. I'll describe my setup and then I'll describe the problem more in-depth. Maybe someone can help me find a solution.

I'm running Jenkins 2.67, GHPRB 1.38.0 and Job DSL 1.63. I'm running Jenkins in docker with the Jenkins home directory stored on a persistent volume. We rebuild the docker image and redeploy once a week or more so we're on the newest version of everything most of the time. We configure Jenkins entirely using init.d scripts including all plugins and credentials.

When Jenkins comes up, it initializes itself, then the plugins, then any existing jobs in its data directory, then runs the init.d scripts. These init scripts configure the credentials and also create the seed job to run the Job DSL and configure/reconfigure any existing jobs.

When there are no existing jobs, the init scripts create the credentials first, and then the Job DSL runs which starts the GHPRB plugin. The plugin can then successfully create the webhooks.

However, if there are existing jobs, the GHPRB plugin starts before the init.d scripts run and the credentials are created, which causes the plugin to attempt to create the webhook using an anonymous credential. This fails causing an error.

I'm wondering if there is a way to have the plugin defer creating the webhook until after the init scripts have been processed?

Steps to reproduce:

  1. Install Jenkins & GHPRB plugin in a docker image w/ JENKINS_HOME mounted to a persistent volume
  2. Configure credentials and GHPRB plugin w/ init.d script
  3. Use Job DSL to create a job w/ GHPRB trigger that uses github webhooks
  4. Start container
  5. On the first startup, GHPRB will create the webhook when the DSL is processed (after init.d scripts)
  6. Kill & delete Jenkins container
  7. Start new container from image w/ volume mount
  8. GHPRB plugin is now started BEFORE init.d scripts, so it fails to manage the github webhooks properly

Please get in touch if there are any more questions. Thanks

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

1 participant