incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Feature][Jenkins-Data] Jenkins plugin option to add all the multibranch job to be monitored

Open KrPetrovDev opened this issue 2 years ago • 14 comments

Search before asking

  • [X] I had searched in the issues and found no similar feature requirement.

Use case

The multibranch job is used for github pull requests which will lead for every pull request created will be created on the fly a new pipeline in the multibranch job which will not be included in the data scopes of the related jenkins connection.

Description

No response

Related issues

New pipelines created in the multibranch pipeline will not be added as a data scope in the jenkins connection automatically, they will be required to be inserted manually from the data scope UI of the jenkins connection

Are you willing to submit a PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

KrPetrovDev avatar Jul 05 '23 09:07 KrPetrovDev

Thanks for the report, however, I'm having trouble understanding the problem since I never used it before, do you have any concrete example of how it works?

klesh avatar Jul 06 '23 07:07 klesh

Yes, as an example I have a multi branch job in jenkins, which inside It executes multiple separated pipelines, these pipelines are created on demand as we create pull requests in github but the issue related to devlake is that the pipelines that are generated on demand are not triggered automatically by the jenkins connection in devlake, so every time I have to go to the jenkins connection, add the new pipelines and run again the process of recollecting the data from jenkins.

As all of these pipelines pertains to the same multi branch job I think It would be possible to develop a feature that will recollect data from all the existing pipelines, inclusive the new pipelines generated after the previous recollection of metrics from this multi branch job instead of only recollecting data only from the pipelines that were initially selected when the jenkins connection was defined in the devlake project.

I hope that this explanation solves your doubt about how It works.

KrPetrovDev avatar Jul 06 '23 08:07 KrPetrovDev

@KrPetrovDev Thanks for the comprehensive explanation, I get the idea of it. However, to evaluate the possible support, we will need a working jenkins server with proper fake data so we can observe how and what the jenkins API offers, would you like to set up one?

klesh avatar Jul 10 '23 09:07 klesh

@klesh I cannot provide a server but I can provide you with a minimum installation guide which will help you to simulate part of my jenkins environment for PRs and to configure a github repository so Jenkins can communicate with It.

This is the guide where explains how to setup an existing jenkins server:

  • https://www.youtube.com/watch?v=aDmeeVDrp0o&ab_channel=CloudBeesTV

KrPetrovDev avatar Jul 18 '23 08:07 KrPetrovDev

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Sep 17 '23 00:09 github-actions[bot]

@Startrekzky Please take a look at this issue, thanks.

klesh avatar Sep 18 '23 02:09 klesh

Collecting votes

klesh avatar Sep 18 '23 03:09 klesh

Yes, as an example I have a multi branch job in jenkins, which inside It executes multiple separated pipelines, these pipelines are created on demand as we create pull requests in github but the issue related to devlake is that the pipelines that are generated on demand are not triggered automatically by the jenkins connection in devlake

Hi @KrPetrovDev , may I ask if there are some rules for the naming, folder structure, or other patterns of the auto-created Jenkins jobs in the pipelines?

Currently, DevLake needs users to define the data scope with the absolute data scope id before collecting data, which is the Jenkins job path in this case.

@klesh If the on-premise-created Jenkins jobs follow certain rules, I guess the possible solution is to allow users to input a pattern (regex) to define the relative data scope pattern to collect.

Then this issue would be similar to https://github.com/apache/incubator-devlake/issues/5002

Startrekzky avatar Sep 18 '23 04:09 Startrekzky

The jenkins mulitple branch pipeline is a job that contains multiple subjob and the subjob name is default to branch name or pull request or tags.

see this https://www.jenkins.io/zh/doc/tutorials/build-a-multibranch-pipeline-project/

haozileung avatar Oct 23 '23 05:10 haozileung

Hi team, do we have any updates regarding this? Is it planned to be implemented?

sstojak1 avatar Nov 14 '23 08:11 sstojak1

@sstojak1 I'm sorry that it's still in the backlog, as we haven't come up with a proper solution for this.

Adding Jenkins jobs by this multi-branch pipeline seems like adding a filter to get Jenkins jobs instead of specifying concrete jobs.

Startrekzky avatar Nov 15 '23 15:11 Startrekzky

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Jan 15 '24 00:01 github-actions[bot]

This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.

github-actions[bot] avatar Jan 22 '24 00:01 github-actions[bot]

Anyone with the necessary knowledge and willing to work on the issue is welcome.

klesh avatar Jan 22 '24 06:01 klesh

Anyone with the necessary knowledge and willing to work on the issue is welcome.

@klesh I'm new to Devlake but very used to Jenkins and its APIs. I will give this a try.

gustavobini avatar Feb 26 '24 16:02 gustavobini

@gustavobini Fantastic, looking forward to your PR 😊. Feel free to reach out to me on Slack if you need help.

klesh avatar Feb 27 '24 05:02 klesh

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Apr 29 '24 00:04 github-actions[bot]

This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.

github-actions[bot] avatar May 07 '24 00:05 github-actions[bot]