Seeking information about GitHub Branch Source Plugin

39 views
Skip to first unread message

Parichay Barpanda

unread,
May 15, 2019, 4:17:18 PM5/15/19
to Jenkins Developers
Hi all,

I was reading the GitHub Branch Source Plugin documentation here - https://go.cloudbees.com/docs/plugins/github-branch-source/ trying to take some inspiration from GitHub Branch Source Plugin for a similar GitLab Branch Source Plugin

Here are a few questions I would like to ask:

1) An excerpt from the GitHub PR section:

 “Pull requests will be added to Jenkins as long as the pull request originates from a remote repository, contains a Pipeline script in a Jenkinsfile, and is mergable. 
Even when you make changes to your Jenkinsfile, the checked out code is at the revision as the script.

What does the last line mean?

2) While running a GitHub folder organisation on my GitHub Account, build log shows the following:

“...19:25:39 GitHub API Usage: Current quota has 51 remaining (2 over budget). Next quota of 60 in 59 min. Sleeping for 6 min 48 sec.”

And the build simply pauses. What is the possible issue here?

3) Are there any important additions made to the plugin since the documentation was written? A list of classes would also do, I specifically want to look at their codes.
I can find some UI changes in behaviours (recent plugin wrt documentation pictures), don't see the folder computation option etc. Looking for any interesting changes which can be leveraged by new Branch Source Plugins?

Thanks.

Regards,
Parichay (baymac)


Baptiste Mathus

unread,
May 19, 2019, 11:57:55 AM5/19/19
to Jenkins Developers


Le mer. 15 mai 2019 à 22:17, Parichay Barpanda <parichay...@gmail.com> a écrit :
Hi all,

I was reading the GitHub Branch Source Plugin documentation here - https://go.cloudbees.com/docs/plugins/github-branch-source/ trying to take some inspiration from GitHub Branch Source Plugin for a similar GitLab Branch Source Plugin

Here are a few questions I would like to ask:

1) An excerpt from the GitHub PR section:

 “Pull requests will be added to Jenkins as long as the pull request originates from a remote repository, contains a Pipeline script in a Jenkinsfile, and is mergable. 
Even when you make changes to your Jenkinsfile, the checked out code is at the revision as the script.

What does the last line mean?

Not sure TBH.


2) While running a GitHub folder organisation on my GitHub Account, build log shows the following:

“...19:25:39 GitHub API Usage: Current quota has 51 remaining (2 over budget). Next quota of 60 in 59 min. Sleeping for 6 min 48 sec.”

And the build simply pauses. What is the possible issue here?

Not an issue. More a feature IIUC your question.
GitHub API has a quota. So if you hammer it too much, your code will simply start failing (and it did).
So like 1 year ago, the code was optimized (thanks Stephen and CloudBees sponsoring this) to do less calls and to introduce waits when quota was about to be reached.

3) Are there any important additions made to the plugin since the documentation was written? A list of classes would also do, I specifically want to look at their codes.
I can find some UI changes in behaviours (recent plugin wrt documentation pictures), don't see the folder computation option etc. Looking for any interesting changes which can be leveraged by new Branch Source Plugins?

Not sure for this. I'd recommend you check PRs since then and check how much/if docs were added alongside code additions. And don't hesitate to ask for clarifications in these merged PRs to be able to possibly file related docs PRs.

Thanks!

Thanks.

Regards,
Parichay (baymac)


--
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/d4215d95-55d5-4322-b945-1b272fc512df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Parichay Barpanda

unread,
May 19, 2019, 12:19:22 PM5/19/19
to jenkin...@googlegroups.com
Thanks batmat for the answers.

Robert Sandell

unread,
May 20, 2019, 7:33:57 AM5/20/19
to jenkin...@googlegroups.com
I'd suggest you first take inspiration from the Gitea plugin, last time I checked it had the most clean branch-api implementation. GitHub Branch Source and Bitbucket Branch Source are suffering from a couple of branch-api/scm-api generations of rewrites that can "muddy the waters a bit" when looking at writing a new plugin :)

/B


For more options, visit https://groups.google.com/d/optout.


--
Robert Sandell
Software Engineer
CloudBees, Inc.
CloudBees-Logo.png
Twitter: robert_sandell

Parichay Barpanda

unread,
May 20, 2019, 8:29:38 AM5/20/19
to jenkin...@googlegroups.com
Thanks Robert.

I checked the Gitea Plugin. It seems like the most recently developed plugin among other Branch Source Plugins like GitHub and BitBucket. 

My first impressions:

It has a cleaner codebase because it was inspired from other Branch Source Plugins and removed the legacy support? 

I can find this plugin handles everything related to Gitea which is auth, webhooks, APIs, build triggers and Branch Source functions. My plan for GitLab Branch Source Plugin is to follow the convention of GitHub Branch Source Plugin i.e. a suite of 3 plugins, namely 

1) GitLab API plugin, 

2) GitLab plugin and 

3) GitLab Branch Source Plugin. 

The reason behind it is:

1) removes a potential user confusion as major SCM plugins (GitHub / BitBucket) follow (or will follow) this rule

2) avoid code duplication as `GitLab Plugin` exists which does everything except Branch source functions. 

Although immaterial in this case because I can create a subset out of the Gitea Plugin to create the GitLab Branch Source Plugin. It would be interesting to note what would the differences in implementation look like.

I'll take sometime to read the Gitea Plugin codebase and come up with a clear distinction. 

Btw design document for GitLab Branch Source Plugin is in the making. It should be ready this week. 

In case you want to take a look at the partial implementation of it, here you go: 


Thanks.

Regards,
Parichay (baymac)

Liam Newman

unread,
May 20, 2019, 7:17:46 PM5/20/19
to jenkin...@googlegroups.com
Parichay, 
I look forward to seeing what you come up with. 
-L.


Reply all
Reply to author
Forward
0 new messages