webhook plugin development for multibranchPipelineJob

39 views
Skip to first unread message

John Patrick

unread,
Feb 8, 2022, 2:17:23 PM2/8/22
to jenkin...@googlegroups.com
Hi,

I'm looking adding support for `multibranchPipelineJob` to a webhook plugin for jenkins.

Using `mvn hpi:run` it boots a jenkins v1.625.3 instance and I have been able to debug the current plugin to see it working. But that jenkins instance lacks support for 'multibranchPipelineJob'.

So I'm trying to add those plugins, but am going around in circles with a plugin dependency mismatch hell.

As the plugin is 4 years old, I'm trying to pick other releases from the same timeframe, so my current list is;
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>scm-api</artifactId>
      <version>2.2.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>job-dsl</artifactId>
      <version>1.65</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-multibranch</artifactId>
      <version>2.17</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-aggregator</artifactId>
      <version>2.5</version>
      <scope>test</scope>
    </dependency>

But I'm now basically getting mismatch errors and the solutions are all install the correct version.

Anyone able to help, Ideally I don't want the answer I want to understand the magic I can work it out. i.e. start with plugin x as this is the base, then look at dependency tree for that.

Cheers,
John

Ullrich Hafner

unread,
Feb 8, 2022, 2:22:30 PM2/8/22
to JenkinsCI Developers
You should upgrade the plugin to a recent Jenkins Version like 2.303.1, then the BOM will provide a solution for all of these problems (https://github.com/jenkinsci/bom).

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAH9u10n9dA1UXr%2BjhkNEZ708W7kv4DmAUGY1qi6TttUsxWS8Zw%40mail.gmail.com.

Mark Waite

unread,
Feb 8, 2022, 2:40:33 PM2/8/22
to Jenkins Developers
The advice from Ullrich Hafner is very good.  You'll make much better progress if you modernize the plugin then let the more modernized settings help you manage the dependencies.

Darin Pope created a five part video series on modernizing Jenkins plugins.

The videos are available as:

  • Part 1 - Choosing your plugin, update the parent pom, update Jenkins base version

  • Part 2 - Spotbugs, incremental builds, dependency updates, and release drafter

  • Part 3 - Migrate docs to GitHub, add a “report an issue” link, interactive testing

  • Part 4 - Enable continuous delivery, plugin bill of materials

  • Part 5 - Topics and labels on repositories, resolving security scan reports


If you'd like to go deeper and don't mind rougher notes, refer to the notes from the "Contributing to Open Source" workshop that was part of DevOps World 2021.

The early parts of that are also available as a pull request to www.jenkins.io documentation.  The preview site can give you a view of those pages if you'd like to try them before they are available on www.jenkins.io.

Mark Waite

John Patrick

unread,
Feb 8, 2022, 3:49:53 PM2/8/22
to jenkin...@googlegroups.com
Thanks Ullrich and Mark,
Will digest those and might be back later in a week or two probably.

Cheers,
John



--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.

John Patrick

unread,
Feb 8, 2022, 7:07:37 PM2/8/22
to jenkin...@googlegroups.com
So I've;
1) updated parent
2) updated jenkins.version to 2.289.1
3) updated jenkins-test-harness.version to 2.72
4) updated junit to 4.13.2
5) added/edited some provided dependencies
6) fixed hamcrest issue
7) fixed a casting issue
8) now stuck on this one.
Caused by: hudson.util.CyclicGraphDetector$CycleDetectedException: Cycle detected: Plugin:credentials -> Plugin:external-monitor-job -> Plugin:matrix-auth -> Plugin:cloudbees-folder -> Plugin:credentials

Thoughts?

Cheers,
John

Mark Waite

unread,
Feb 8, 2022, 7:38:33 PM2/8/22
to jenkinsci-dev
Willing to share a link to your repository?

I'd guess you can break that cycle by removing one or more unnecessary dependencies from the pom.xml file, but that type of guessing is usually best supported by experiments with maven.

Daniel Beck

unread,
Feb 9, 2022, 2:21:12 AM2/9/22
to jenkin...@googlegroups.com
On Wed, Feb 9, 2022 at 1:07 AM John Patrick <nhoj.p...@gmail.com> wrote:
So I've;
1) updated parent
2) updated jenkins.version to 2.289.1
3) updated jenkins-test-harness.version to 2.72
4) updated junit to 4.13.2
5) added/edited some provided dependencies
6) fixed hamcrest issue
7) fixed a casting issue
8) now stuck on this one.
Caused by: hudson.util.CyclicGraphDetector$CycleDetectedException: Cycle detected: Plugin:credentials -> Plugin:external-monitor-job -> Plugin:matrix-auth -> Plugin:cloudbees-folder -> Plugin:credentials

Are you using the BOM to manage your dependencies as suggested above? These cycles only make sense to me if you're on plugin dependencies >6 years old.

John Patrick

unread,
Feb 9, 2022, 3:42:31 PM2/9/22
to jenkin...@googlegroups.com
New day and fresh eyes and have sorted it, now PR raised https://github.com/jenkinsci/gogs-webhook-plugin/pull/75.

Cheers,
John


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages