[GSOC 2018] [Student Introduction] Simple Pull-Request Job Plugin

107 views
Skip to first unread message

Andrei Vînătoru

unread,
Feb 14, 2018, 7:43:04 PM2/14/18
to Jenkins Developers
Hello Everyone,

My name is Andrei Vinatoru, and I am currently in the 4th year at the Faculty of Automatic Control and Computer Science, at Politehnica Univerity of Bucharest, Romania. 
My interests include Java, Continuous Integration, Automation, C, C++, Operating Systems and Networking.

I am familiar with Jenkins, because I worked with it during an internship last summer, and I think this is a good opportunity for me to learn about working on an open-source project and learn more about Jenkins.
This is my github profile: https://github.com/hntr94 and this is my LinkedIn profile: https://www.linkedin.com/in/andrei-v%C3%AEn%C4%83toru-36b88363/.

The project that sounds interesting to me is Simple Pull-Request Job Plugin.
I do not have many ideas about how to start, and I hope we can discuss some starting points and get some advice.

Thank you,
Andrei Vinatoru

Joseph P

unread,
Feb 15, 2018, 4:00:59 AM2/15/18
to Jenkins Developers
Hi Andrei 😊

A good place to start is by reading the plugin tutorial https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial
Or by looking at Jenkins org at Github, here is a simple search for "job" https://github.com/search?q=org%3Ajenkinsci+language%3Ajava+job
To see similar job plugins

/Joseph

Michal Vala

unread,
Feb 15, 2018, 4:15:46 AM2/15/18
to jenkin...@googlegroups.com

> The project that sounds interesting to me is Simple Pull-Request Job Plugin.
> I do not have many ideas about how to start, and I hope we can discuss some
> starting points and get some advice.

What will this plugin do? Is it something like this
https://plugins.jenkins.io/ghprb ?

--
Michal Vala
OpenJDK QE
Red Hat Czech

Joseph P

unread,
Feb 15, 2018, 4:33:58 AM2/15/18
to Jenkins Developers
https://jenkins.io/projects/gsoc/gsoc2018-project-ideas/#simple-pull-request-job-plugin
The idea is to create a YAML file similar to Travis' YAML file but it could properly be extending that plugin since the infrastructure for being a Github bot is already there :)

Michal Vala

unread,
Feb 15, 2018, 7:09:03 AM2/15/18
to jenkin...@googlegroups.com


On 02/15/2018 10:33 AM, Joseph P wrote:
> https://jenkins.io/projects/gsoc/gsoc2018-project-ideas/#simple-pull-request-job-plugin
> The idea is to create a YAML file similar to Travis' YAML file but it could
> properly be extending that plugin since the infrastructure for being a
> Github bot is already there :)

Oh, I see. I didn't know about that page. Thanks

Surya Gaddipati

unread,
Feb 15, 2018, 9:06:53 AM2/15/18
to Jenkins Developers
Hey I worked on something similar ( actually exactly the same thing looks like)


I would like if to help you if you need anything with your project 

Jesse Glick

unread,
Feb 15, 2018, 9:55:57 AM2/15/18
to Jenkins Dev
I posted a comment to the doc. The proposal suggests something far
more complex (and ultimately limited) than what you can already do
very easily with a minor extension to Pipeline.

martinda

unread,
Feb 15, 2018, 10:00:09 AM2/15/18
to Jenkins Developers
Hello Andrei and al,

The simple pull-request plugin is described in more details in the link kindly posted by Joseph P (thank you Joseph). I have added some ideas to the detailed proposal.

Regarding student participation, you should read the information for students: https://jenkins.io/projects/gsoc/students/

It can help to look at existing plugins to learn how to write plugins. I will shamelessly points to a plugin I previously mentored as I think its code is well organized and it has lots of unit tests: the external workspace manager plugin. But I am sure there are other good plugins out there that I am not familiar with.

I am hoping the plugin can work with Bitbucket Server, Cloud and Github (all three). I am also proposing that certain report types be supported by convention. For example, if JUnit XML Reports exist in a conventional location, they should automatically be published.

The plugin is different than existing pull-request plugins in a couple of ways. My idea is that the Simple Pull-Request Plugin does not detect branches and does not create a job for each pull-request automatically. Instead, all the pull-requests destined to a given branch run in the same job. This way the job has a history of all the pull-requests destined to a given branch. So it is one job per destination branch. Also, the plugin does not automatically detect pull-requests (it does not poll). Instead jobs wait to be triggered externally. For example a build could be triggered from the command line (as rudimentary as curl), or it could be triggered from Bitbucket using the pull-request notifier. I am not sure whether users should create the jobs themselves, or if there should be some kind automation when it comes to creating jobs. I see the operation of the build, and the jobs creation as two independent activities. The focus of the plugin as proposed so far is to implement the operation of the build.

Of course this proposal welcomes comments and suggestions from the community.

Best,
Martin


martinda

unread,
Feb 15, 2018, 10:19:33 AM2/15/18
to Jenkins Developers
Hi Jesse,

Yes, the plugin is a highly opinionated way of using Jenkins. I think that that is the point of the plugin: this plugin does not intent to be as flexible as a Jenkinsfile. I have implemented some of the features of this proposal in a pipeline, and it is surprisingly long and complex, and also very hard to test, even with the ATH. It has been suggested to me to convert this type of long jenkinsfile (and its associated library) into a plugin. Instead of doing this for myself in private, I thought to present the problem as a whole to the community in the form of a plugin proposal, as I am thinking that other might be in a similar situation.

I could be wrong with this whole idea, I don't know, I am just stuck with quite a complex and very difficult to test Jenkinsfile and pipeline library, while my users are not interested in anything more than saying "put my project in jenkins". My users will never write a Jenkinsfile, ever. But I was able to get them to specify a (very) small YAML file.

Maybe you are suggesting that this should be implemented as an open-source Pipeline library and Jenkinsfile (without a plugin, the testing remains the hard part)?

Martin

martinda

unread,
Feb 15, 2018, 10:27:34 AM2/15/18
to Jenkins Developers
Ah, I just saw Jesse's comment in the proposal doc. I need to do more research on multi-branch and organization folders. Last time I tried was already a few years ago.

Jesse Glick

unread,
Feb 15, 2018, 2:31:16 PM2/15/18
to Jenkins Dev
On Thu, Feb 15, 2018 at 10:19 AM, martinda <martin....@gmail.com> wrote:
> My users will never write a Jenkinsfile, ever. But I
> was able to get them to specify a (very) small YAML file.
>
> Maybe you are suggesting that this should be implemented as an open-source
> Pipeline library and Jenkinsfile

You can of course do that, though then you still need to have some
kind of boilerplate:

---%<--- Jenkinsfile
library('github.com/whatever/jenkins-yaml-lib').run('jenkins.yaml')
--->%---

CloudBees users can eliminate the need for even that using

https://go.cloudbees.com/docs/cloudbees-documentation/cje-user-guide/index.html#pipeline-custom-factories

Or you can write a small plugin which implements the same
`AbstractWorkflowBranchProjectFactory` /
`AbstractWorkflowMultiBranchProjectFactory` extension points and bakes
in an opinionated file name and script.

I am not saying that is the only way to accomplish your goal, but it
is certainly the easiest. You would get support for GitHub & BitBucket
(including pull requests, webhooks, and organization folders) for
free, as well as visualization via Blue Ocean and so on. (I suppose
you could even build an analogue to
https://github.com/jenkinsci/blueocean-plugin/tree/master/blueocean-pipeline-editor
if you wanted, though I do not know much about that.)

martinda

unread,
Feb 16, 2018, 5:47:42 AM2/16/18
to Jenkins Developers
Hi Surya,

Thank you for your input. Based on your response, you seem to have an interest in this kind of approach. Would you consider being a co-mentor on this project?

Martin

martinda

unread,
Feb 16, 2018, 5:57:39 AM2/16/18
to Jenkins Developers
Hello Andrei,

Some ideas that have been presented, IMO the project is attracting some good discussions which will likely continue for a little bit while the project is being more fully defined. Is this something you'd be interested in for GSoC?

What do you think so far on the direction this project should be going?

Martin

Surya Gaddipati

unread,
Feb 16, 2018, 10:21:31 AM2/16/18
to Jenkins Developers
Hi Martin,

Yes. I would would def like to be a co mentor on this. 

Let me know if I need to complete any steps to get that going  from my side.

Surya

On Wednesday, February 14, 2018 at 6:43:04 PM UTC-6, Andrei Vînătoru wrote:

Oleg Nenashev

unread,
Feb 17, 2018, 6:34:08 AM2/17/18
to Jenkins Developers

Surya Gaddipati

unread,
Feb 17, 2018, 11:47:57 AM2/17/18
to Jenkins Developers
Hi Oleg,

Thank you. I've added myself to the google doc.


On Wednesday, February 14, 2018 at 6:43:04 PM UTC-6, Andrei Vînătoru wrote:

Andrei Vînătoru

unread,
Feb 17, 2018, 10:27:03 PM2/17/18
to Jenkins Developers
Hi Martin,

This looks like an interesting project for GSoC. I'll do my best to understand what I have to do. Right now I'm reading the plugin tutorial and next I'll look up the external workspace manager plugin to see how it is structured.

Andrei

Oleg Nenashev

unread,
Mar 26, 2018, 7:13:58 AM3/26/18
to Jenkins Developers
Hi Andrei,

Just FYI, Mar 27 16:00 PM UTC is a deadline for proposals.
If you are still interested in the project, please make sure to submit your final proposal by this time.

We will also have the last Q&A office hours today at 18:00PM UTC. Feel free to join if you have any questions.

Best regards,
Oleg Nenashev
Reply all
Reply to author
Forward
0 new messages