Re: [Question] How to add value to a field dynamically in the UI?

2020-05-21 Thread Parichay Barpanda
I made a hacky solution for this by padding a random 4 digit number to 
secret-textbox and gen-button with RandomStringUtils.randomNumeric(4). The 
possibility of conflicts is less as number of properties added is usually 
1-2 (max 5). What do you think?

On Friday, May 22, 2020 at 4:36:36 AM UTC+5:30, Parichay Barpanda wrote:
>
> I am kinda confused bcz this doesn't solve my problem. If I click on a 
> button then the secret-text of that particular property should change but 
> if all buttons have same listener then all secret-text fields will change. 
> I want some ability to set different id to buttons in different 
> properties(read: array inside repeatableHeteroProperty).
>
> On Friday, May 22, 2020 at 4:29:43 AM UTC+5:30, Gavin Mogan wrote:
>>
>> So it looks like forEach doesn't work in ie11 - 
>> https://caniuse.com/#feat=mdn-api_nodelist_foreach, so you'll have to 
>> use a normal loop, something like 
>>
>> var buttons = document.getElementByClassName("gen-secret")
>> for (var i = 0; i < buttons.length; i++) {
>>buttons[i].addEventListener('click', function(e) {
>> e.preventDefault();
>> document.getElementByClassName("secret-text").value = token;
>> });
>> }
>>
>> On Thu, May 21, 2020 at 3:54 PM Parichay Barpanda  
>> wrote:
>>
>>> Yes having adding an Id to the element instead of class solves the 
>>> problem. But this config is inside a repeatableHeteroProperty which means 
>>> there could be multiple buttons with the same ids which will change 
>>> multiple fields so it is an issue. Can I some way get the index of 
>>> individual properties?
>>>
>>> On Friday, May 22, 2020 at 4:17:04 AM UTC+5:30, Gavin Mogan wrote:
>>>>
>>>> Get element by class name returns an array. It should have spit out an 
>>>> error in your browser console.
>>>>
>>>> Id = one
>>>> Class = sharable = many
>>>>
>>>> I'm guessing the button is inside a form or something? A button by 
>>>> itself won't do any page navigation, and it should need to be a submit 
>>>> button to submit a form, but maybe by default if there's only a single 
>>>> button browser treats it as a submit.
>>>>
>>>> I would say if you fix your errors, then it shouldn't redirect with 
>>>> prevent default
>>>>
>>>>
>>>> On Thu., May 21, 2020, 3:37 p.m. Parichay Barpanda, <
>>>> parichay...@gmail.com> wrote:
>>>>
>>>>> Np. 
>>>>>
>>>>> I am trying to create a button element:
>>>>>
>>>>> f.entry() {
>>>>> raw("""
>>>>> 
>>>>> Generate Secret Token
>>>>> 
>>>>> """)
>>>>> }
>>>>>
>>>>> then the listener:
>>>>>
>>>>> raw("""
>>>>> 
>>>>> 
>>>>> document.getElementByClassName("gen-secret").addEventListener('click', 
>>>>> function(e) {
>>>>> e.preventDefault();
>>>>> document.getElementByClassName("secret-text").value = 
>>>>> token;
>>>>> });
>>>>> 
>>>>> """)
>>>>>
>>>>>
>>>>> So when I click on the button it takes me to home page. How can I 
>>>>> prevent this behaviour?
>>>>>
>>>>> On Friday, May 22, 2020 at 3:51:45 AM UTC+5:30, Gavin Mogan wrote:
>>>>>>
>>>>>> Sorry, I got distracted when i hit enter.
>>>>>> you want a click event for the button
>>>>>>
>>>>>> document.getElementById("buttonid").addEventListener('click', 
>>>>>> function(e) {
>>>>>>document.getElementById("idname").value = "foo";
>>>>>> });
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, May 21, 2020 at 3:11 PM Parichay Barpanda <
>>>>>> parichay...@gmail.com> wrote:
>>>>>>
>>>>>>> Thanks Gavin. That was helpful. :)
>>>>>>>
>>>>>>> On Fri 22 May, 2020, 03:10 'Gavin Mogan' via Jenkins Developers, <
>>>>>>> jenkin...@googlegroups.com> w

Re: [Question] How to add value to a field dynamically in the UI?

2020-05-21 Thread Parichay Barpanda
I am kinda confused bcz this doesn't solve my problem. If I click on a 
button then the secret-text of that particular property should change but 
if all buttons have same listener then all secret-text fields will change. 
I want some ability to set different id to buttons in different 
properties(read: array inside repeatableHeteroProperty).

On Friday, May 22, 2020 at 4:29:43 AM UTC+5:30, Gavin Mogan wrote:
>
> So it looks like forEach doesn't work in ie11 - 
> https://caniuse.com/#feat=mdn-api_nodelist_foreach, so you'll have to use 
> a normal loop, something like 
>
> var buttons = document.getElementByClassName("gen-secret")
> for (var i = 0; i < buttons.length; i++) {
>buttons[i].addEventListener('click', function(e) {
> e.preventDefault();
> document.getElementByClassName("secret-text").value = token;
>     });
> }
>
> On Thu, May 21, 2020 at 3:54 PM Parichay Barpanda  > wrote:
>
>> Yes having adding an Id to the element instead of class solves the 
>> problem. But this config is inside a repeatableHeteroProperty which means 
>> there could be multiple buttons with the same ids which will change 
>> multiple fields so it is an issue. Can I some way get the index of 
>> individual properties?
>>
>> On Friday, May 22, 2020 at 4:17:04 AM UTC+5:30, Gavin Mogan wrote:
>>>
>>> Get element by class name returns an array. It should have spit out an 
>>> error in your browser console.
>>>
>>> Id = one
>>> Class = sharable = many
>>>
>>> I'm guessing the button is inside a form or something? A button by 
>>> itself won't do any page navigation, and it should need to be a submit 
>>> button to submit a form, but maybe by default if there's only a single 
>>> button browser treats it as a submit.
>>>
>>> I would say if you fix your errors, then it shouldn't redirect with 
>>> prevent default
>>>
>>>
>>> On Thu., May 21, 2020, 3:37 p.m. Parichay Barpanda, <
>>> parichay...@gmail.com> wrote:
>>>
>>>> Np. 
>>>>
>>>> I am trying to create a button element:
>>>>
>>>> f.entry() {
>>>> raw("""
>>>> 
>>>> Generate Secret Token
>>>> 
>>>> """)
>>>> }
>>>>
>>>> then the listener:
>>>>
>>>> raw("""
>>>> 
>>>> 
>>>> document.getElementByClassName("gen-secret").addEventListener('click', 
>>>> function(e) {
>>>> e.preventDefault();
>>>> document.getElementByClassName("secret-text").value = token;
>>>> });
>>>> 
>>>> """)
>>>>
>>>>
>>>> So when I click on the button it takes me to home page. How can I 
>>>> prevent this behaviour?
>>>>
>>>> On Friday, May 22, 2020 at 3:51:45 AM UTC+5:30, Gavin Mogan wrote:
>>>>>
>>>>> Sorry, I got distracted when i hit enter.
>>>>> you want a click event for the button
>>>>>
>>>>> document.getElementById("buttonid").addEventListener('click', 
>>>>> function(e) {
>>>>>document.getElementById("idname").value = "foo";
>>>>> });
>>>>>
>>>>>
>>>>>
>>>>> On Thu, May 21, 2020 at 3:11 PM Parichay Barpanda <
>>>>> parichay...@gmail.com> wrote:
>>>>>
>>>>>> Thanks Gavin. That was helpful. :)
>>>>>>
>>>>>> On Fri 22 May, 2020, 03:10 'Gavin Mogan' via Jenkins Developers, <
>>>>>> jenkin...@googlegroups.com> wrote:
>>>>>>
>>>>>>> document.getElementById("buttonid").addEventListener(function(e) {
>>>>>>>document.getElementById("idname").value = "foo";
>>>>>>> });
>>>>>>>
>>>>>>> On Thu, May 21, 2020 at 2:27 PM Parichay Barpanda <
>>>>>>> parichay...@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I want to set value of a Describable field using an UI button. 
>>>>>>>> There is a text box Token and there is a button Generate, i

Re: [Question] How to add value to a field dynamically in the UI?

2020-05-21 Thread Parichay Barpanda
Yes having adding an Id to the element instead of class solves the problem. 
But this config is inside a repeatableHeteroProperty which means there 
could be multiple buttons with the same ids which will change multiple 
fields so it is an issue. Can I some way get the index of individual 
properties?

On Friday, May 22, 2020 at 4:17:04 AM UTC+5:30, Gavin Mogan wrote:
>
> Get element by class name returns an array. It should have spit out an 
> error in your browser console.
>
> Id = one
> Class = sharable = many
>
> I'm guessing the button is inside a form or something? A button by itself 
> won't do any page navigation, and it should need to be a submit button to 
> submit a form, but maybe by default if there's only a single button browser 
> treats it as a submit.
>
> I would say if you fix your errors, then it shouldn't redirect with 
> prevent default
>
>
> On Thu., May 21, 2020, 3:37 p.m. Parichay Barpanda,  > wrote:
>
>> Np. 
>>
>> I am trying to create a button element:
>>
>> f.entry() {
>> raw("""
>> 
>> Generate Secret Token
>> 
>> """)
>> }
>>
>> then the listener:
>>
>> raw("""
>> 
>> 
>> document.getElementByClassName("gen-secret").addEventListener('click', 
>> function(e) {
>> e.preventDefault();
>> document.getElementByClassName("secret-text").value = token;
>> });
>> 
>> """)
>>
>>
>> So when I click on the button it takes me to home page. How can I prevent 
>> this behaviour?
>>
>> On Friday, May 22, 2020 at 3:51:45 AM UTC+5:30, Gavin Mogan wrote:
>>>
>>> Sorry, I got distracted when i hit enter.
>>> you want a click event for the button
>>>
>>> document.getElementById("buttonid").addEventListener('click', 
>>> function(e) {
>>>document.getElementById("idname").value = "foo";
>>> });
>>>
>>>
>>>
>>> On Thu, May 21, 2020 at 3:11 PM Parichay Barpanda  
>>> wrote:
>>>
>>>> Thanks Gavin. That was helpful. :)
>>>>
>>>> On Fri 22 May, 2020, 03:10 'Gavin Mogan' via Jenkins Developers, <
>>>> jenkin...@googlegroups.com> wrote:
>>>>
>>>>> document.getElementById("buttonid").addEventListener(function(e) {
>>>>>document.getElementById("idname").value = "foo";
>>>>> });
>>>>>
>>>>> On Thu, May 21, 2020 at 2:27 PM Parichay Barpanda <
>>>>> parichay...@gmail.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I want to set value of a Describable field using an UI button. There 
>>>>>> is a text box Token and there is a button Generate, if Generate Button 
>>>>>> is 
>>>>>> clicked then Token text box should be filled with a desired value. 
>>>>>>
>>>>>> Thanks and Regards,
>>>>>> Parichay
>>>>>>
>>>>>> -- 
>>>>>> 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 jenkin...@googlegroups.com.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/jenkinsci-dev/f24e4719-9050-4470-bbb0-f09cde79d8ad%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/f24e4719-9050-4470-bbb0-f09cde79d8ad%40googlegroups.com?utm_medium=email_source=footer>
>>>>>> .
>>>>>>
>>>>> -- 
>>>>> 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 jenkin...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuuZp%3DhZC7%3Dr%3DovyMVa72B9WqAV%2ByMbxx37kEA_uVqKZrw%40mail.gmail.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuuZp%3DhZC7%3Dr%3DovyMVa72B9WqAV%2ByMbxx37kEA_uVqK

Re: [Question] How to add value to a field dynamically in the UI?

2020-05-21 Thread Parichay Barpanda
Np. 

I am trying to create a button element:

f.entry() {
raw("""

Generate Secret Token

""")
}

then the listener:

raw("""


document.getElementByClassName("gen-secret").addEventListener('click', 
function(e) {
e.preventDefault();
document.getElementByClassName("secret-text").value = token;
});

""")


So when I click on the button it takes me to home page. How can I prevent 
this behaviour?

On Friday, May 22, 2020 at 3:51:45 AM UTC+5:30, Gavin Mogan wrote:
>
> Sorry, I got distracted when i hit enter.
> you want a click event for the button
>
> document.getElementById("buttonid").addEventListener('click', function(e) {
>    document.getElementById("idname").value = "foo";
> });
>
>
>
> On Thu, May 21, 2020 at 3:11 PM Parichay Barpanda  > wrote:
>
>> Thanks Gavin. That was helpful. :)
>>
>> On Fri 22 May, 2020, 03:10 'Gavin Mogan' via Jenkins Developers, <
>> jenkin...@googlegroups.com > wrote:
>>
>>> document.getElementById("buttonid").addEventListener(function(e) {
>>>document.getElementById("idname").value = "foo";
>>> });
>>>
>>> On Thu, May 21, 2020 at 2:27 PM Parichay Barpanda >> > wrote:
>>>
>>>> Hi,
>>>>
>>>> I want to set value of a Describable field using an UI button. There is 
>>>> a text box Token and there is a button Generate, if Generate Button is 
>>>> clicked then Token text box should be filled with a desired value. 
>>>>
>>>> Thanks and Regards,
>>>> Parichay
>>>>
>>>> -- 
>>>> 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 jenkin...@googlegroups.com .
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/jenkinsci-dev/f24e4719-9050-4470-bbb0-f09cde79d8ad%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/f24e4719-9050-4470-bbb0-f09cde79d8ad%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> -- 
>>> 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 jenkin...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuuZp%3DhZC7%3Dr%3DovyMVa72B9WqAV%2ByMbxx37kEA_uVqKZrw%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuuZp%3DhZC7%3Dr%3DovyMVa72B9WqAV%2ByMbxx37kEA_uVqKZrw%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> -- 
>> 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 jenkin...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAOLKjHVGPT2uYRiHDUc2H%3DEwHxmAZtu%2BFadEdVYNKzkYA%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAOLKjHVGPT2uYRiHDUc2H%3DEwHxmAZtu%2BFadEdVYNKzkYA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/39bc0fbb-4657-4ef4-9625-d776a2a4d498%40googlegroups.com.


Re: [Question] How to add value to a field dynamically in the UI?

2020-05-21 Thread Parichay Barpanda
Thanks Gavin. That was helpful. :)

On Fri 22 May, 2020, 03:10 'Gavin Mogan' via Jenkins Developers, <
jenkinsci-dev@googlegroups.com> wrote:

> document.getElementById("buttonid").addEventListener(function(e) {
>document.getElementById("idname").value = "foo";
> });
>
> On Thu, May 21, 2020 at 2:27 PM Parichay Barpanda <
> parichay.barpa...@gmail.com> wrote:
>
>> Hi,
>>
>> I want to set value of a Describable field using an UI button. There is a
>> text box Token and there is a button Generate, if Generate Button is
>> clicked then Token text box should be filled with a desired value.
>>
>> Thanks and Regards,
>> Parichay
>>
>> --
>> 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-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/f24e4719-9050-4470-bbb0-f09cde79d8ad%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/f24e4719-9050-4470-bbb0-f09cde79d8ad%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuuZp%3DhZC7%3Dr%3DovyMVa72B9WqAV%2ByMbxx37kEA_uVqKZrw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuuZp%3DhZC7%3Dr%3DovyMVa72B9WqAV%2ByMbxx37kEA_uVqKZrw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAOLKjHVGPT2uYRiHDUc2H%3DEwHxmAZtu%2BFadEdVYNKzkYA%40mail.gmail.com.


[Question] How to add value to a field dynamically in the UI?

2020-05-21 Thread Parichay Barpanda
Hi,

I want to set value of a Describable field using an UI button. There is a 
text box Token and there is a button Generate, if Generate Button is 
clicked then Token text box should be filled with a desired value. 

Thanks and Regards,
Parichay

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/f24e4719-9050-4470-bbb0-f09cde79d8ad%40googlegroups.com.


Re: Adding Javascript to config.groovy

2020-05-21 Thread Parichay Barpanda
Thanks. I first saw groovy style config in GitHub Plugin and feel it more
convenient over jelly because lack of IDE support make tags unreadable.

On Fri, May 22, 2020 at 1:54 AM 'Gavin Mogan' via Jenkins Developers <
jenkinsci-dev@googlegroups.com> wrote:

> Oh wow, I didn't know that was a thing.
>
> Apparently you can use raw()
>
>
> https://github.com/jenkinsci/embeddable-build-status-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/badge/actions/RunBadgeAction/index.groovy#L11-L40
>
> My grepping didn't turn up any other options. I'd be concerned that raw()
> isn't doing any xss escaping though, so someone else will have to speak to
> that.
>
> On Thu, May 21, 2020 at 1:07 PM Parichay Barpanda <
> parichay.barpa...@gmail.com> wrote:
>
>> Yes. See
>> https://github.com/jenkinsci/gitlab-branch-source-plugin/blob/master/src/main/resources/io/jenkins/plugins/gitlabserverconfig/servers/GitLabServer/config.groovy
>>
>> On Friday, May 22, 2020 at 1:26:09 AM UTC+5:30, Gavin Mogan wrote:
>>>
>>> Whats a config.groovy compared to config.jelly? Are you writing a plugin
>>> using groovy?
>>>
>>> On Thu, May 21, 2020 at 12:54 PM Parichay Barpanda <
>>> parichay...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am looking for a way to add Javascript to config.groovy files in my
>>>> resources. It is possible to do so in jelly with 

Re: Adding Javascript to config.groovy

2020-05-21 Thread Parichay Barpanda
Yes. See 
https://github.com/jenkinsci/gitlab-branch-source-plugin/blob/master/src/main/resources/io/jenkins/plugins/gitlabserverconfig/servers/GitLabServer/config.groovy

On Friday, May 22, 2020 at 1:26:09 AM UTC+5:30, Gavin Mogan wrote:
>
> Whats a config.groovy compared to config.jelly? Are you writing a plugin 
> using groovy?
>
> On Thu, May 21, 2020 at 12:54 PM Parichay Barpanda  > wrote:
>
>> Hi,
>>
>> I am looking for a way to add Javascript to config.groovy files in my 
>> resources. It is possible to do so in jelly with 

Adding Javascript to config.groovy

2020-05-21 Thread Parichay Barpanda
Hi,

I am looking for a way to add Javascript to config.groovy files in my 
resources. It is possible to do so in jelly with 

Re: Rechecking Pull Requests

2019-10-06 Thread Parichay Barpanda
Hi Oleg,

For implementing the same feature for GitLab Branch Source Plugin, I took
some inspiration from one of the existing plugin for GitHub Branch Source
https://github.com/jenkinsci/github-pr-comment-build-plugin. Take a look at
it, either decide to implement this feature in GitHub Branch Source or use
this plugin. In case of implementation I can help, let me know.

Regards,
Parichay

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAO5p0xq6Nxbt_po_GgFCq1g-h_xkYuo3zpEpMOgGBoVPg%40mail.gmail.com.


Re: Unable to configure Fork Change Request Trait using Job DSL

2019-08-19 Thread Parichay Barpanda
Thanks for clarifying it. Also nice to know a fix is at work.

On Tue 20 Aug, 2019, 00:47 Daniel Spilker,  wrote:

> Hi Parichay,
>
> I meant changing the constructor to
>
> public ForkMergeRequestDiscoveryTrait(int strategyId, SCMHeadAuthority
> trust) {
>
> until Structs plugin supports parameters with parameterized type.
>
> I opened a pull request to add some support for parameterized types to
> Structs plugin:
> https://github.com/jenkinsci/structs-plugin/pull/52
>
> I tested the fix with Job DSL. It will enable the DSL syntax from my
> previous post.
>
> Regards,
> Daniel
>
>
> On Mon, Aug 19, 2019 at 5:39 PM Parichay Barpanda <
> parichay.barpa...@gmail.com> wrote:
>
>> Thanks Daniel. But I didn't understand by what you meant "remove the type
>> parameters". I was able to configure the trait using `configure` block.
>> https://gist.github.com/baymac/f1a2249a0ec7b999c057056937e752a6
>>
>> On Saturday, August 17, 2019 at 5:09:03 PM UTC+5:30, Daniel Spilker wrote:
>>>
>>> Hi Parichay,
>>>
>>> the Job DSL script would be this:
>>>
>>> organizationFolder('example') {
>>>   organizations {
>>> gitLabSCMNavigator {
>>>   projectOwner('test')
>>>   traits {
>>> gitLabForkDiscovery {
>>>   strategyId(42)
>>>   trust {
>>> gitLabTrustNobody()
>>>   }
>>> }
>>>   }
>>> }
>>>   }
>>> }
>>>
>>> But the script will fail. The problem is caused by the "trust"
>>> constructor parameter of ForkMergeRequestDiscoveryTrait. Job DSL uses
>>> the Structs plugin for introspection of Describables. Unfortunately Structs
>>> does not handle parameter types with generics except for sub classes of
>>> java.util.Collection. So the trait will not be shown in the API viewer.
>>>
>>> To check if a class is supported by Structs (and Job DSL), run the
>>> following in the Jenkins script console:
>>>
>>> org.jenkinsci.plugins.structs.describable.DescribableModel.of(io.jenkins.plugins.gitlabbranchsource.ForkMergeRequestDiscoveryTrait)
>>>
>>> The result will be
>>>
>>> ForkMergeRequestDiscoveryTrait(strategyId: int, trust: 
>>> java.lang.UnsupportedOperationException: do not know how to categorize 
>>> attributes of type jenkins.scm.api.trait.SCMHeadAuthority>> io.jenkins.plugins.gitlabbranchsource.GitLabSCMSourceRequest, ? extends 
>>> jenkins.scm.api.mixin.ChangeRequestSCMHead2, ? extends 
>>> jenkins.scm.api.SCMRevision>)
>>>
>>> As a workaround, you can remove the type parameters from the "trust"
>>> constructor parameter.
>>>
>>> @Jesse: would it be feasible to fallback to the raw type when a
>>> parameterized type is detected?
>>>
>>> https://github.com/jenkinsci/structs-plugin/blob/structs-parent-1.20/plugin/src/main/java/org/jenkinsci/plugins/structs/describable/ParameterType.java#L104
>>>
>>> Regards,
>>> Daniel
>>>
>>>
>>> On Fri, Aug 16, 2019 at 3:11 PM Parichay Barpanda 
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I am trying to configure GitLab Branch Source Plugin organizational
>>>> folder using Job DSL. But unfortunately job dsl api viewer doesn't detect 
>>>> Fork
>>>> Merge Request Trait
>>>> <https://github.com/jenkinsci/gitlab-branch-source-plugin/blob/develop/src/main/java/io/jenkins/plugins/gitlabbranchsource/ForkMergeRequestDiscoveryTrait.java>.
>>>> All the detected traits in Job dsl api viewer takes either
>>>> int/boolean/string values. But in Fork Merge Request Trait the trust field
>>>> takes an SCMHeadAuthority object. How does one configure Job DSL with fork
>>>> `change request` trait for any of the branch source plugin?
>>>>
>>>> Can someone help me with figuring out what is wrong here. I have the
>>>> following cases:
>>>>
>>>> 1. Job DSL doesn't support Fork Merge Request Trait.
>>>>
>>>> 2. There is something wrong with the impl of Fork Merge Request Trait.
>>>>
>>>> 3. Our Job DSL configuration is incorrect (note unable to configure
>>>> fork merge request in this configuration):
>>>>
>>>> organizationFolder(name) {
>>>>   organizations {
>>>> displayName(config.displayNa

Re: Unable to configure Fork Change Request Trait using Job DSL

2019-08-19 Thread Parichay Barpanda
Thanks Daniel. But I didn't understand by what you meant "remove the type 
parameters". I was able to configure the trait using `configure` block. 
https://gist.github.com/baymac/f1a2249a0ec7b999c057056937e752a6 

On Saturday, August 17, 2019 at 5:09:03 PM UTC+5:30, Daniel Spilker wrote:
>
> Hi Parichay,
>
> the Job DSL script would be this:
>
> organizationFolder('example') {
>   organizations {
> gitLabSCMNavigator {
>   projectOwner('test')
>   traits {
> gitLabForkDiscovery {
>   strategyId(42)
>   trust {
> gitLabTrustNobody()
>   }
> }
>   }
> }
>   }
> }
>
> But the script will fail. The problem is caused by the "trust" constructor 
> parameter of ForkMergeRequestDiscoveryTrait. Job DSL uses the Structs 
> plugin for introspection of Describables. Unfortunately Structs does not 
> handle parameter types with generics except for sub classes of 
> java.util.Collection. So the trait will not be shown in the API viewer.
>
> To check if a class is supported by Structs (and Job DSL), run the 
> following in the Jenkins script console:
>
> org.jenkinsci.plugins.structs.describable.DescribableModel.of(io.jenkins.plugins.gitlabbranchsource.ForkMergeRequestDiscoveryTrait)
>
> The result will be
>
> ForkMergeRequestDiscoveryTrait(strategyId: int, trust: 
> java.lang.UnsupportedOperationException: do not know how to categorize 
> attributes of type jenkins.scm.api.trait.SCMHeadAuthority io.jenkins.plugins.gitlabbranchsource.GitLabSCMSourceRequest, ? extends 
> jenkins.scm.api.mixin.ChangeRequestSCMHead2, ? extends 
> jenkins.scm.api.SCMRevision>)
>
> As a workaround, you can remove the type parameters from the "trust" 
> constructor parameter. 
>
> @Jesse: would it be feasible to fallback to the raw type when a 
> parameterized type is detected?
>
> https://github.com/jenkinsci/structs-plugin/blob/structs-parent-1.20/plugin/src/main/java/org/jenkinsci/plugins/structs/describable/ParameterType.java#L104
>
> Regards,
> Daniel
>
>
> On Fri, Aug 16, 2019 at 3:11 PM Parichay Barpanda  > wrote:
>
>> Hi all,
>>
>> I am trying to configure GitLab Branch Source Plugin organizational 
>> folder using Job DSL. But unfortunately job dsl api viewer doesn't detect 
>> Fork 
>> Merge Request Trait 
>> <https://github.com/jenkinsci/gitlab-branch-source-plugin/blob/develop/src/main/java/io/jenkins/plugins/gitlabbranchsource/ForkMergeRequestDiscoveryTrait.java>.
>>  
>> All the detected traits in Job dsl api viewer takes either 
>> int/boolean/string values. But in Fork Merge Request Trait the trust field 
>> takes an SCMHeadAuthority object. How does one configure Job DSL with fork 
>> `change request` trait for any of the branch source plugin?
>>
>> Can someone help me with figuring out what is wrong here. I have the 
>> following cases:
>>
>> 1. Job DSL doesn't support Fork Merge Request Trait.
>>
>> 2. There is something wrong with the impl of Fork Merge Request Trait.
>>
>> 3. Our Job DSL configuration is incorrect (note unable to configure fork 
>> merge request in this configuration):
>>
>> organizationFolder(name) {
>>   organizations {
>> displayName(config.displayName)
>> description(orgDescription)
>> gitLabSCMNavigator {
>>   projectOwner(config.group)
>>   credentialsId('gitlab_ssh_key')
>>   serverName('git.3shape.local')
>>   traits {
>> subGroupProjectDiscoveryTrait() // discover projects inside 
>> subgroups
>> gitLabBranchDiscovery {
>>   strategyId(3) // discover all branches
>> }
>> originMergeRequestDiscoveryTrait {
>>   strategyId(1) // discover MRs and merge them with target 
>> branch
>> }
>> gitLabTagDiscovery() // discover tags
>> gitLFSPullTrait()
>>   }
>> }
>>   }
>>   orphanedItemStrategy {
>> discardOldItems {
>>   daysToKeep(7)
>>   numToKeep(10)
>> }
>>   }
>>   if (!isSandbox()) {
>> triggers {
>>   periodicFolderTrigger {
>> interval('1d')
>>   }
>> }
>>   }
>>   projectFactories {
>> workflowMultiBranchProjectFactory {
>>   scriptPath('Jenkinsfile')
>> }
>>   }
>> }
>>
>> 4. or something else?
>>
>> T

Re: Unable to configure Fork Change Request Trait using Job DSL

2019-08-16 Thread Parichay Barpanda
Can you tell how to do it? We are unable to find the configuration in the
api viewer.

Thanks.

On Fri 16 Aug, 2019, 20:07 Jesse Glick,  wrote:

> On Fri, Aug 16, 2019 at 9:11 AM Parichay Barpanda
>  wrote:
> > All the detected traits in Job dsl api viewer takes either
> int/boolean/string values. But in Fork Merge Request Trait the trust field
> takes an SCMHeadAuthority object. How does one configure Job DSL with fork
> `change request` trait for any of the branch source plugin?
>
> I presume like any other `Describable`: you need to pick an
> implementation with a `@Symbol`, like
>
>
> https://github.com/jenkinsci/gitlab-branch-source-plugin/blob/c0c8236ff87b9bc48110690de8eba99a10966e81/src/main/java/io/jenkins/plugins/gitlabbranchsource/ForkMergeRequestDiscoveryTrait.java#L230
>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1UjomXq8GKBa0GDsHcCPVMswTGUO64csqDCfC0mVadYw%40mail.gmail.com
> .
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAOYbhfBBFWqVt9YOFgojr2u8UapSOX2XBpK%3DzRbQaVaig%40mail.gmail.com.


Unable to configure Fork Change Request Trait using Job DSL

2019-08-16 Thread Parichay Barpanda
Hi all,

I am trying to configure GitLab Branch Source Plugin organizational folder 
using Job DSL. But unfortunately job dsl api viewer doesn't detect Fork 
Merge Request Trait 
.
 
All the detected traits in Job dsl api viewer takes either 
int/boolean/string values. But in Fork Merge Request Trait the trust field 
takes an SCMHeadAuthority object. How does one configure Job DSL with fork 
`change request` trait for any of the branch source plugin?

Can someone help me with figuring out what is wrong here. I have the 
following cases:

1. Job DSL doesn't support Fork Merge Request Trait.

2. There is something wrong with the impl of Fork Merge Request Trait.

3. Our Job DSL configuration is incorrect (note unable to configure fork 
merge request in this configuration):

organizationFolder(name) {
  organizations {
displayName(config.displayName)
description(orgDescription)
gitLabSCMNavigator {
  projectOwner(config.group)
  credentialsId('gitlab_ssh_key')
  serverName('git.3shape.local')
  traits {
subGroupProjectDiscoveryTrait() // discover projects inside 
subgroups
gitLabBranchDiscovery {
  strategyId(3) // discover all branches
}
originMergeRequestDiscoveryTrait {
  strategyId(1) // discover MRs and merge them with target 
branch
}
gitLabTagDiscovery() // discover tags
gitLFSPullTrait()
  }
}
  }
  orphanedItemStrategy {
discardOldItems {
  daysToKeep(7)
  numToKeep(10)
}
  }
  if (!isSandbox()) {
triggers {
  periodicFolderTrigger {
interval('1d')
  }
}
  }
  projectFactories {
workflowMultiBranchProjectFactory {
  scriptPath('Jenkinsfile')
}
  }
}

4. or something else?

Thanks and Regards,
Parichay

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/ba6639f7-a735-4e2f-9e69-61f58762d7fa%40googlegroups.com.


Beta Release of GitLab Branch Source Plugin

2019-08-02 Thread Parichay Barpanda
Hi all,

For the past couple of months I have been working on a new GitLab Branch 
Source Plugin as a part of my Google Summer of Code Project. It has a lot 
to offer for Jenkins and GitLab intergration.

What new features this plugin provides?

   - Mutlibranch Pipeline Job
   - Folder Organisation
   - Webhooks Support
   - Pipeline Status Notifications
   - New SCM Traits APIs
   - New GitLab API Plugin
   - Reduced API calls
   - Improved Server Configuration Options
   - .. and more!

There were a lot of hiccups on the road but with fantastic support from my 
mentors and other Jenkins community developers we are able to make our 
plugin open to testing. You can find the beta release here - 
https://github.com/jenkinsci/gitlab-branch-source-plugin/releases/tag/gitlab-branch-source-0.0.6-beta-1
. 

I would like to request interested developers to test the plugin and report 
to us any bugs or feature request. You can either join our gitter channel 
https://gitter.im/jenkinsci/gitlab-branch-source-plugin or create JIRA 
ticket with `gitlab-branch-source-plugin` component. 

We have a lot more planned for the plugin including build trigger on 
comment, system hooks support, improve Job DSL configuration etc. Looking 
forward to your valuable feedbacks.

Special thanks,

Marky Jackson
Justin Harringa
Joseph Peterson
Zhao Xiaojie

Best Regards,
Parichay.


-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/97f40e90-3d4f-475c-b4e5-a91cb81ffce7%40googlegroups.com.


Re: [Working Hours Plugin] Asking UI Feedback

2019-08-02 Thread Parichay Barpanda
Hi Jack,

It is really nice to host it on the cloud and let users test it. I like the
UI. I would suggest few things (more like my personal opinions):

1. The captions could be more prominent. The light grey colour makes it a
bit less readable.

2. Maybe in future, implement a custom alert box for removing any items. It
would be nice to have a do not ask again option.

3. The `Exclude Dates` section could be nicer if had some more space and
the boxes align.

The UI is almost clean. You have done a great job.

Regards,
Parichay

On Thu, Aug 1, 2019 at 6:02 PM Jack Shen  wrote:

> Hi,
>   I'm Jack Shen, I'm currently working on Working Hours Plugin, and we had
> built a brand new UI with react, and we are currently asking for some
> suggestions on the UI.
>
>   If you are interested, you can visit the sample plugin page at
> http://api.shenjack.cn:8080/working-hours/ with USERNAME: guest
> PASSWORD:password.
>
>   This plugin is intended to help user customize their task's allowed
> working period, and it'll blocked tasks during times such as holidays and
> weekends according to user's setting.
>
>   We would be really appreciated if you could give some suggestion on the
> plugin's UI.
>
>   And this plugin also provides Holidays Presets to help people select
> holidays as excluded dates to set the working periods, If you find any
> holidays which you think are popular but not listed in the presets, you
> could fill a form at
> https://docs.google.com/forms/d/1uj4XEMgc_GpPZPtTojV6bjIxjD4fTCb84wERjBNS12E/edit
> .
>
>   Thanks for reading!
>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/f56661d2-4da2-4e07-b273-da181137fae5%40googlegroups.com
> 
> .
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAPp92RgjSFzg7ZV%2Bzk_2yvEr-983GQ3WN_b7_OfhveR0g%40mail.gmail.com.


Re: Setting up webhook in a SCM branch source plugin

2019-07-26 Thread Parichay Barpanda
Thanks for the pointer. I have done same mapping of the event payload to
SCM API Event. Also created a RootAction for the webhook.

Can you tell me what happens when SCMHeadEvent.fireNow(event) is called
upon? My understanding is that it takes the SCM API mapped event then
iterates through all the SCMEventListeners and based on `isMatch` method it
triggers the event. In my case either my GitLabSCMSource doesn't have an
SCMEventListener or isMatch method returns false for the required source.
If it is the latter case then my mapping maybe incorrect?

On Sat 27 Jul, 2019, 01:22 Jesse Glick,  wrote:

> On Fri, Jul 26, 2019 at 3:32 PM Parichay Barpanda
>  wrote:
> > Some toplevel idea of how SCMHeadEvent works will also be a big help for
> me.
>
>
> https://github.com/jenkinsci/scm-api-plugin/blob/master/docs/implementation.adoc#implementing-event-support
>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1EqmtqF09BQO569WvoU2-c1X-nh%3DbgOCstzg%3DEZjw7mA%40mail.gmail.com
> .
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAMxcAW2wURz0g9i2Gi3E6iu8%3DRq5kCPgfCeRVymneEejQ%40mail.gmail.com.


Setting up webhook in a SCM branch source plugin

2019-07-26 Thread Parichay Barpanda
Hi all,

I am working on adding webhook support in GitLab Branch Source Plugin. 

Current implementation looks like this:

1. When `afterSave()` method is called upon in `GitLabSCMSource` or 
`GitLabSCMNavigator` then a webhook url is created in the GitLab Server by 
`GitLabWebhookCreator` class. Creation of webhook depend on the mode chosen 
by user.

2. When an event occurs in GitLab Server, `GitLabWebhookAction` class which 
implements an `UnprotectedRootAction` processes the http request.

3. The request is then sent to `GitLabWebhookManager` class which is 
provided with a listener called `GitLabWebhookListener` which listens to 
the GitLabEvent.

4. `GitLabWebhookListener` provides the onEvent methods like 
`onMergeRequest`, `onPushEvent` etc. The `GitLabWebhookListener` works 
correctly and each method gets their respective GitLab event. (as is logged)

5. With the help of GitLab specific event object(`PushEvent`, 
`MergeRequestEvent` etc) now I am creating a Jenkins specific SCMHeadEvent 
e.g. `GitLabPushSCMEvent`, `GitLabMergeRequestSCMEvent` etc. 

6. Now when I fire any of these event e.g. 
`SCMHeadEvent.fireNow(GitLabPushSCMEvent)`, it doesn't fire the event.

I know all this is confusing, looking at the codebase can help? 
https://github.com/jenkinsci/gitlab-branch-source-plugin/.

I want to know how does an `SCMSource` or `SCMNavigator` listen to a 
SCMHeadEvent? I think in all the above implementation I have missed the 
part of setting a listener on source and navigator itself as they don't 
receive any project events. At the same time I am unable to figure out how 
to setup a listener on them. Can someone help me with this? Some toplevel 
idea of how SCMHeadEvent works will also be a big help for me.

Thanks in advance.

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/b69258ed-b68d-4440-ab3d-fa274ae485a0%40googlegroups.com.


Re: Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-20 Thread Parichay Barpanda
Hi Gavin,

I don't exactly understand what you are saying. It would be great if you
send a pr or point to the code where the problem is when you find time.
Thanks in advance.

On Sat 20 Jul, 2019, 12:51 Gavin,  wrote:

> Arg. Can't navigate jira well on the phone. I'll comment there tomorrow if
> I remember.
>
> Unless some weird transpiler, you can't interpolate variables inside
> double quotes in JavaScript (you could in coffee script). You need
> backticks or concatenation.
>
> I'll try to submit a PR or something but wanted to write it down incase I
> forgot
>
> On Tue., Jul. 16, 2019, 8:53 p.m. Parichay Barpanda, <
> parichay.barpa...@gmail.com> wrote:
>
>> I raised a ticket here - https://issues.jenkins-ci.org/browse/INFRA-2183.
>> Please let me know if I can assign it to someone or you can ping someone
>> who can help fix it. Thanks in advance.
>>
>> On Wednesday, July 17, 2019 at 12:26:46 AM UTC+5:30, Jesse Glick wrote:
>>>
>>> On Tue, Jul 16, 2019 at 2:47 PM Parichay Barpanda
>>>  wrote:
>>> > Invalid archive retrieved from Jenkins, perhaps the plugin is not
>>> properly incrementalized?
>>>
>>> Well Tyler added this particular error message, perhaps related to
>>> INFRA-2125:
>>>
>>>
>>> https://github.com/jenkins-infra/community-functions/commit/d4bf3d3c68961b6a778325397336bdb7d99fe4a4
>>>
>>> Since I lack access to the server logs (INFRA-2094), and the `err`
>>> mentioned there was apparently not included in the HTTP response, I
>>> cannot help further. You can file an `INFRA` ticket to request
>>> assistance.
>>>
>> --
>> 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-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/7bdd5fad-1804-4234-975a-58f7d891a878%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/7bdd5fad-1804-4234-975a-58f7d891a878%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Duvjp8zsX3gVT-JUky0c15vnUJOeQyd%3Db%2BgVgc-aEUfp-Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Duvjp8zsX3gVT-JUky0c15vnUJOeQyd%3Db%2BgVgc-aEUfp-Q%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAP_pJFQ%3DR4g6HMFYJs2HsQOuq1QhRfqMd8OmuXZ68Dimg%40mail.gmail.com.


Re: Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-16 Thread Parichay Barpanda
I raised a ticket here - https://issues.jenkins-ci.org/browse/INFRA-2183. 
Please let me know if I can assign it to someone or you can ping someone 
who can help fix it. Thanks in advance.

On Wednesday, July 17, 2019 at 12:26:46 AM UTC+5:30, Jesse Glick wrote:
>
> On Tue, Jul 16, 2019 at 2:47 PM Parichay Barpanda 
> > wrote: 
> > Invalid archive retrieved from Jenkins, perhaps the plugin is not 
> properly incrementalized? 
>
> Well Tyler added this particular error message, perhaps related to 
> INFRA-2125: 
>
>
> https://github.com/jenkins-infra/community-functions/commit/d4bf3d3c68961b6a778325397336bdb7d99fe4a4
>  
>
> Since I lack access to the server logs (INFRA-2094), and the `err` 
> mentioned there was apparently not included in the HTTP response, I 
> cannot help further. You can file an `INFRA` ticket to request 
> assistance. 
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/7bdd5fad-1804-4234-975a-58f7d891a878%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-16 Thread Parichay Barpanda
By specifying the binary files in .gitattributes the build passed but the 
plugin is not deployed incrementally. The deploy stage fails with a message:

Invalid archive retrieved from Jenkins, perhaps the plugin is not properly 
incrementalized?
The build result for the latest commit can be found here - 
https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgitlab-branch-source-plugin/detail/develop/9/pipeline

Any idea why it fails? Btw the plugin has github field in 
`repository-permissions-updater`.

On Tuesday, July 16, 2019 at 4:02:54 PM UTC+5:30, Parichay Barpanda wrote:
>
> Awesome Gavin. It was .gitattributes that caused the binary files to 
> change. Thanks. 
>
> On Tue, Jul 16, 2019 at 3:47 PM Gavin  wrote:
>
>> Oh shot in the dark here.
>>
>>
>> https://github.com/jenkinsci/gitlab-branch-source-plugin/blob/develop/.gitattributes
>>  
>> is set to change the endings of all files. That could potentially mess with 
>> binary files.
>>
>> I'm not certain about this but you might need to say your images are 
>> binary. Especially if your committing in windows and the builds that are 
>> failing are in Linux.
>>
>> https://help.github.com/en/articles/configuring-git-to-handle-line-endings
>>
>> On Tue., Jul. 16, 2019, 3:07 a.m. Gavin,  wrote:
>>
>>> Whats the deploy stage? In the jenkins pipeline? In maven?
>>>
>>> Have you tried a clean clone of your develop branch. Running mvn clean 
>>> install, then checking git status to see what if anything is generated.
>>>
>>> Develop seems to be running properly. 
>>> https://ci.jenkins.io/job/Plugins/job/gitlab-branch-source-plugin/job/develop/
>>>  
>>> the other branches that still have docs/ in them seem to be failing.
>>>
>>> Why would you want the webapp directory ignored? As Jessie said, 
>>> everything in your src directory should be your actual files which you want 
>>> committed.
>>>
>>>
>>>
>>> On Tue., Jul. 16, 2019, 2:43 a.m. Parichay Barpanda, <
>>> parichay.barpa...@gmail.com> wrote:
>>>
>>>> Hi Jesse,
>>>>
>>>> I had added the webapp directory to .gitignore to test the build. Now I 
>>>> tried to remove classes that might have affected the images such as 
>>>> GitLabAvatarCache (didn't work), refixed svgs and the pngs (didn't work). 
>>>> The current work can be found in this commit - 
>>>> https://github.com/jenkinsci/gitlab-branch-source-plugin/commit/57c5f1705a78a5a3c6012ebfc0ded91a4c93dcab
>>>> .
>>>>
>>>> I am unable to understand the issue, if it was bug in the code it would 
>>>> have also returned error about the webapp images but it also returns 
>>>> errors 
>>>> with the docs images. 
>>>>
>>>> On Tuesday, July 16, 2019 at 12:32:01 AM UTC+5:30, Jesse Glick wrote:
>>>>>
>>>>> On Sun, Jul 14, 2019 at 11:53 AM Parichay Barpanda 
>>>>>  wrote: 
>>>>> > We can also avoid the error by adding `-Dignore.dirt` flag to Maven 
>>>>> config as was suggested by Marky Jackson. 
>>>>>
>>>>> No, fix your build process. 
>>>>>
>>>>>
>>>>> https://github.com/jenkinsci/gitlab-branch-source-plugin/compare/master...jenkinsci:develop
>>>>>  
>>>>>
>>>>> is rather suspicious: nothing in `src/` should ever be in 
>>>>> `.gitignore`. 
>>>>>
>>>> -- 
>>>> 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-dev+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/jenkinsci-dev/8e7cc1c9-5298-461c-afd4-4210153eac19%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/8e7cc1c9-5298-461c-afd4-4210153eac19%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>> 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-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Dut1bYFsY6j4urdBU1XxFJxJkzkL-rO_YN6w0Eb%2BKiZLFQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Dut1bYFsY6j4urdBU1XxFJxJkzkL-rO_YN6w0Eb%2BKiZLFQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/01100d97-c658-48df-a228-b7178f8dee6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-16 Thread Parichay Barpanda
Awesome Gavin. It was .gitattributes that caused the binary files to
change. Thanks.

On Tue, Jul 16, 2019 at 3:47 PM Gavin  wrote:

> Oh shot in the dark here.
>
>
> https://github.com/jenkinsci/gitlab-branch-source-plugin/blob/develop/.gitattributes
> is set to change the endings of all files. That could potentially mess with
> binary files.
>
> I'm not certain about this but you might need to say your images are
> binary. Especially if your committing in windows and the builds that are
> failing are in Linux.
>
> https://help.github.com/en/articles/configuring-git-to-handle-line-endings
>
> On Tue., Jul. 16, 2019, 3:07 a.m. Gavin,  wrote:
>
>> Whats the deploy stage? In the jenkins pipeline? In maven?
>>
>> Have you tried a clean clone of your develop branch. Running mvn clean
>> install, then checking git status to see what if anything is generated.
>>
>> Develop seems to be running properly.
>> https://ci.jenkins.io/job/Plugins/job/gitlab-branch-source-plugin/job/develop/
>> the other branches that still have docs/ in them seem to be failing.
>>
>> Why would you want the webapp directory ignored? As Jessie said,
>> everything in your src directory should be your actual files which you want
>> committed.
>>
>>
>>
>> On Tue., Jul. 16, 2019, 2:43 a.m. Parichay Barpanda, <
>> parichay.barpa...@gmail.com> wrote:
>>
>>> Hi Jesse,
>>>
>>> I had added the webapp directory to .gitignore to test the build. Now I
>>> tried to remove classes that might have affected the images such as
>>> GitLabAvatarCache (didn't work), refixed svgs and the pngs (didn't work).
>>> The current work can be found in this commit -
>>> https://github.com/jenkinsci/gitlab-branch-source-plugin/commit/57c5f1705a78a5a3c6012ebfc0ded91a4c93dcab
>>> .
>>>
>>> I am unable to understand the issue, if it was bug in the code it would
>>> have also returned error about the webapp images but it also returns errors
>>> with the docs images.
>>>
>>> On Tuesday, July 16, 2019 at 12:32:01 AM UTC+5:30, Jesse Glick wrote:
>>>>
>>>> On Sun, Jul 14, 2019 at 11:53 AM Parichay Barpanda
>>>>  wrote:
>>>> > We can also avoid the error by adding `-Dignore.dirt` flag to Maven
>>>> config as was suggested by Marky Jackson.
>>>>
>>>> No, fix your build process.
>>>>
>>>>
>>>> https://github.com/jenkinsci/gitlab-branch-source-plugin/compare/master...jenkinsci:develop
>>>>
>>>> is rather suspicious: nothing in `src/` should ever be in `.gitignore`.
>>>>
>>> --
>>> 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-dev+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-dev/8e7cc1c9-5298-461c-afd4-4210153eac19%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-dev/8e7cc1c9-5298-461c-afd4-4210153eac19%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Dut1bYFsY6j4urdBU1XxFJxJkzkL-rO_YN6w0Eb%2BKiZLFQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Dut1bYFsY6j4urdBU1XxFJxJkzkL-rO_YN6w0Eb%2BKiZLFQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAOW9KEhUMCMAO%3DwHBgh6DCxizkGp9-V2ajszd2puko6jA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-16 Thread Parichay Barpanda
Hi Gavin,

I'm trying to fix it in
https://github.com/jenkinsci/gitlab-branch-source-plugin/pull/1. I tried to
see git status after `mvn clean install`, it says tree is clean and build
still fails.

On Tue 16 Jul, 2019, 15:38 Gavin,  wrote:

> Whats the deploy stage? In the jenkins pipeline? In maven?
>
> Have you tried a clean clone of your develop branch. Running mvn clean
> install, then checking git status to see what if anything is generated.
>
> Develop seems to be running properly.
> https://ci.jenkins.io/job/Plugins/job/gitlab-branch-source-plugin/job/develop/
> the other branches that still have docs/ in them seem to be failing.
>
> Why would you want the webapp directory ignored? As Jessie said,
> everything in your src directory should be your actual files which you want
> committed.
>
>
>
> On Tue., Jul. 16, 2019, 2:43 a.m. Parichay Barpanda, <
> parichay.barpa...@gmail.com> wrote:
>
>> Hi Jesse,
>>
>> I had added the webapp directory to .gitignore to test the build. Now I
>> tried to remove classes that might have affected the images such as
>> GitLabAvatarCache (didn't work), refixed svgs and the pngs (didn't work).
>> The current work can be found in this commit -
>> https://github.com/jenkinsci/gitlab-branch-source-plugin/commit/57c5f1705a78a5a3c6012ebfc0ded91a4c93dcab
>> .
>>
>> I am unable to understand the issue, if it was bug in the code it would
>> have also returned error about the webapp images but it also returns errors
>> with the docs images.
>>
>> On Tuesday, July 16, 2019 at 12:32:01 AM UTC+5:30, Jesse Glick wrote:
>>>
>>> On Sun, Jul 14, 2019 at 11:53 AM Parichay Barpanda
>>>  wrote:
>>> > We can also avoid the error by adding `-Dignore.dirt` flag to Maven
>>> config as was suggested by Marky Jackson.
>>>
>>> No, fix your build process.
>>>
>>>
>>> https://github.com/jenkinsci/gitlab-branch-source-plugin/compare/master...jenkinsci:develop
>>>
>>> is rather suspicious: nothing in `src/` should ever be in `.gitignore`.
>>>
>> --
>> 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-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/8e7cc1c9-5298-461c-afd4-4210153eac19%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/8e7cc1c9-5298-461c-afd4-4210153eac19%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DutSqsVzdw_xfHQvcEpkPV_mhOiCzXRptZtasFoR8w%3DDKw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DutSqsVzdw_xfHQvcEpkPV_mhOiCzXRptZtasFoR8w%3DDKw%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAPJkEF%3DwJpDaKXggQWO2FERRTiVLBJ-AzWJ8srOV%3DPm4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-16 Thread Parichay Barpanda
Hi Jesse,

I had added the webapp directory to .gitignore to test the build. Now I 
tried to remove classes that might have affected the images such as 
GitLabAvatarCache (didn't work), refixed svgs and the pngs (didn't work). 
The current work can be found in this commit - 
https://github.com/jenkinsci/gitlab-branch-source-plugin/commit/57c5f1705a78a5a3c6012ebfc0ded91a4c93dcab
.

I am unable to understand the issue, if it was bug in the code it would 
have also returned error about the webapp images but it also returns errors 
with the docs images. 

On Tuesday, July 16, 2019 at 12:32:01 AM UTC+5:30, Jesse Glick wrote:
>
> On Sun, Jul 14, 2019 at 11:53 AM Parichay Barpanda 
> > wrote: 
> > We can also avoid the error by adding `-Dignore.dirt` flag to Maven 
> config as was suggested by Marky Jackson. 
>
> No, fix your build process. 
>
>
> https://github.com/jenkinsci/gitlab-branch-source-plugin/compare/master...jenkinsci:develop
>  
>
> is rather suspicious: nothing in `src/` should ever be in `.gitignore`. 
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/8e7cc1c9-5298-461c-afd4-4210153eac19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-15 Thread Parichay Barpanda
Thank Abyudaya. I think maybe the error is caused to some misconfiguration 
of incrementals. I am also getting an error message in the deploy stage 
[2019-07-14T15:58:59.299Z] 
Invalid archive retrieved from Jenkins, perhaps the plugin is not properly 
incrementalized? Still I haven't been able figure it out.

On Monday, July 15, 2019 at 12:08:20 PM UTC+5:30, Abhyudaya Sharma wrote:
>
> Hi Parichay!
>
> There's the Role Strategy Plugin 
> <https://github.com/jenkinsci/role-strategy-plugin> that has incrementals 
> enabled and has images in the repository too.
>
> On Sunday, 14 July 2019 21:06:47 UTC+5:30, Parichay Barpanda wrote:
>>
>> I don't think in our code we are optimisation the docs images or making 
>> changes to the docs images. I was thinking the images were indented in the 
>> markdown, so the markdown parser could be doing some changes with images. 
>> But that is also not the case. 
>>
>> Does anyone know a plugin with incrementals support and images in the 
>> repo?
>>
>> On Sunday, July 14, 2019 at 8:31:07 PM UTC+5:30, Mark Waite wrote:
>>>
>>> That seems like it would indicate that something is modifying those 
>>> files in the build process on the CI server.
>>>
>>> Any chance there is an image optimization process running in the build, 
>>> or something else that would change those files?
>>>
>>> On Sun, Jul 14, 2019 at 8:51 AM Parichay Barpanda  
>>> wrote:
>>>
>>>> Thanks Mark and Batmat. I am not sure if it was due to #1218 not being 
>>>> merged. Because soon as it was merged the pipeline still failed with the 
>>>> same results. 
>>>>
>>>> Based on the logs:
>>>>
>>>> [2019-07-14T04:05:22.417Z] [ERROR] Make sure git status -s is empty 
>>>> before using -Dset.changelist: [docs/img/gitlab-credentials.png, docs/
>>>> img/gitlab-section.png, docs/img/gitlab-server.png, docs/img/gitlab-
>>>> token-creator.png] (use -Dignore.dirt to make this nonfatal) -> [Help 1
>>>> ]
>>>> [2019-07-14T04:05:22.417Z]
>>>>
>>>>
>>>> we tried to remove the docs dir, it happened to work(build passes now). 
>>>> Earlier it also gave similar errors with webapp dir, so I had to remove it 
>>>> and add to .gitignore. Maybe Mark is right but again I am not sure.
>>>>
>>>> On Sunday, July 14, 2019 at 3:55:32 PM UTC+5:30, Parichay Barpanda 
>>>> wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> GitLab Branch Source Plugin was recently hosted on `jenkinsci` org. 
>>>>> But the build is failing on Jenkins CI. I am unable to figure out the 
>>>>> error. Can someone help me figure this out? The build information can be 
>>>>> found here - 
>>>>> https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgitlab-branch-source-plugin/detail/develop/5/pipeline
>>>>> .
>>>>>
>>>>> Thanks.
>>>>>
>>>> -- 
>>>> 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 jenkin...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/jenkinsci-dev/daca3bd2-c550-4cc0-a28d-9fd1742a4220%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/daca3bd2-c550-4cc0-a28d-9fd1742a4220%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>> -- 
>>> Thanks!
>>> Mark Waite
>>>
>>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/a5d32f15-a270-4219-84a9-f6d25733cf3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-14 Thread Parichay Barpanda
We can also avoid the error by adding `-Dignore.dirt` flag to Maven config
as was suggested by Marky Jackson.

On Sun 14 Jul, 2019, 21:06 Parichay Barpanda, 
wrote:

> I don't think in our code we are optimisation the docs images or making
> changes to the docs images. I was thinking the images were indented in the
> markdown, so the markdown parser could be doing some changes with images.
> But that is also not the case.
>
> Does anyone know a plugin with incrementals support and images in the repo?
>
> On Sunday, July 14, 2019 at 8:31:07 PM UTC+5:30, Mark Waite wrote:
>>
>> That seems like it would indicate that something is modifying those files
>> in the build process on the CI server.
>>
>> Any chance there is an image optimization process running in the build,
>> or something else that would change those files?
>>
>> On Sun, Jul 14, 2019 at 8:51 AM Parichay Barpanda 
>> wrote:
>>
>>> Thanks Mark and Batmat. I am not sure if it was due to #1218 not being
>>> merged. Because soon as it was merged the pipeline still failed with the
>>> same results.
>>>
>>> Based on the logs:
>>>
>>> [2019-07-14T04:05:22.417Z] [ERROR] Make sure git status -s is empty
>>> before using -Dset.changelist: [docs/img/gitlab-credentials.png, docs/
>>> img/gitlab-section.png, docs/img/gitlab-server.png, docs/img/gitlab-
>>> token-creator.png] (use -Dignore.dirt to make this nonfatal) -> [Help 1]
>>> [2019-07-14T04:05:22.417Z]
>>>
>>>
>>> we tried to remove the docs dir, it happened to work(build passes now).
>>> Earlier it also gave similar errors with webapp dir, so I had to remove it
>>> and add to .gitignore. Maybe Mark is right but again I am not sure.
>>>
>>> On Sunday, July 14, 2019 at 3:55:32 PM UTC+5:30, Parichay Barpanda wrote:
>>>>
>>>> Hi all,
>>>>
>>>> GitLab Branch Source Plugin was recently hosted on `jenkinsci` org. But
>>>> the build is failing on Jenkins CI. I am unable to figure out the error.
>>>> Can someone help me figure this out? The build information can be found
>>>> here -
>>>> https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgitlab-branch-source-plugin/detail/develop/5/pipeline
>>>> .
>>>>
>>>> Thanks.
>>>>
>>> --
>>> 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 jenkin...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-dev/daca3bd2-c550-4cc0-a28d-9fd1742a4220%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-dev/daca3bd2-c550-4cc0-a28d-9fd1742a4220%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Thanks!
>> Mark Waite
>>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/95655c15-e3db-4dfd-b079-e35827cc1aa4%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/95655c15-e3db-4dfd-b079-e35827cc1aa4%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAOEfT-BHz6g74kGjimBtqZ2H7nqy6UkydKDcAcsoUNcJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-14 Thread Parichay Barpanda
I don't think in our code we are optimisation the docs images or making 
changes to the docs images. I was thinking the images were indented in the 
markdown, so the markdown parser could be doing some changes with images. 
But that is also not the case. 

Does anyone know a plugin with incrementals support and images in the repo?

On Sunday, July 14, 2019 at 8:31:07 PM UTC+5:30, Mark Waite wrote:
>
> That seems like it would indicate that something is modifying those files 
> in the build process on the CI server.
>
> Any chance there is an image optimization process running in the build, or 
> something else that would change those files?
>
> On Sun, Jul 14, 2019 at 8:51 AM Parichay Barpanda  > wrote:
>
>> Thanks Mark and Batmat. I am not sure if it was due to #1218 not being 
>> merged. Because soon as it was merged the pipeline still failed with the 
>> same results. 
>>
>> Based on the logs:
>>
>> [2019-07-14T04:05:22.417Z] [ERROR] Make sure git status -s is empty 
>> before using -Dset.changelist: [docs/img/gitlab-credentials.png, docs/img
>> /gitlab-section.png, docs/img/gitlab-server.png, docs/img/gitlab-token-
>> creator.png] (use -Dignore.dirt to make this nonfatal) -> [Help 1]
>> [2019-07-14T04:05:22.417Z]
>>
>>
>> we tried to remove the docs dir, it happened to work(build passes now). 
>> Earlier it also gave similar errors with webapp dir, so I had to remove it 
>> and add to .gitignore. Maybe Mark is right but again I am not sure.
>>
>> On Sunday, July 14, 2019 at 3:55:32 PM UTC+5:30, Parichay Barpanda wrote:
>>>
>>> Hi all,
>>>
>>> GitLab Branch Source Plugin was recently hosted on `jenkinsci` org. But 
>>> the build is failing on Jenkins CI. I am unable to figure out the error. 
>>> Can someone help me figure this out? The build information can be found 
>>> here - 
>>> https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgitlab-branch-source-plugin/detail/develop/5/pipeline
>>> .
>>>
>>> Thanks.
>>>
>> -- 
>> 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 jenkin...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/daca3bd2-c550-4cc0-a28d-9fd1742a4220%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/daca3bd2-c550-4cc0-a28d-9fd1742a4220%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Thanks!
> Mark Waite
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/95655c15-e3db-4dfd-b079-e35827cc1aa4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-14 Thread Parichay Barpanda
Thanks Mark and Batmat. I am not sure if it was due to #1218 not being 
merged. Because soon as it was merged the pipeline still failed with the 
same results. 

Based on the logs:

[2019-07-14T04:05:22.417Z] [ERROR] Make sure git status -s is empty before 
using -Dset.changelist: [docs/img/gitlab-credentials.png, docs/img/gitlab-
section.png, docs/img/gitlab-server.png, docs/img/gitlab-token-creator.png] 
(use -Dignore.dirt to make this nonfatal) -> [Help 1]
[2019-07-14T04:05:22.417Z]


we tried to remove the docs dir, it happened to work(build passes now). 
Earlier it also gave similar errors with webapp dir, so I had to remove it 
and add to .gitignore. Maybe Mark is right but again I am not sure.

On Sunday, July 14, 2019 at 3:55:32 PM UTC+5:30, Parichay Barpanda wrote:
>
> Hi all,
>
> GitLab Branch Source Plugin was recently hosted on `jenkinsci` org. But 
> the build is failing on Jenkins CI. I am unable to figure out the error. 
> Can someone help me figure this out? The build information can be found 
> here - 
> https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgitlab-branch-source-plugin/detail/develop/5/pipeline
> .
>
> Thanks.
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/daca3bd2-c550-4cc0-a28d-9fd1742a4220%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Incrementals error in Jenkins CI for GitLab Branch Source Plugin

2019-07-14 Thread Parichay Barpanda
Hi all,

GitLab Branch Source Plugin was recently hosted on `jenkinsci` org. But the 
build is failing on Jenkins CI. I am unable to figure out the error. Can 
someone help me figure this out? The build information can be found here - 
https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgitlab-branch-source-plugin/detail/develop/5/pipeline
.

Thanks.

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/6e9ef5cb-8cf5-4819-bf9d-4931cb0cc480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pass the data to QueueListener to RunListener

2019-07-13 Thread Parichay Barpanda
I implemented a class which will notifies GitLab Server about the job 
status. 
https://github.com/baymac/gitlab-branch-source-plugin/blob/develop/src/main/java/io/jenkins/plugins/gitlabbranchsource/helpers/GitLabSCMPipelineStatusNotifier.java

I have a suggestion (In reference to that), you can create a private 
variable say `timeTaken` in `JobScheduledListener.class` and a getter, then 
in `JobCompletedListener.onStarted` you can fetch the `timeTaken` variable 
from the Extension list like 
`ExtensionList.get(JobScheduledListener).getTimeTaken()`. Although I am not 
really sure about the extension lookup syntax though.

On Saturday, July 13, 2019 at 5:54:39 PM UTC+5:30, selva vignesh wrote:
>
> Hi,
> I am developing plugin which will get the data of job, how long it's been 
> in Queue and how long it take to finish the job.
> Here I can't pass the action class from QueueListener to RunListener. Can 
> any one help me know how to pass the data from QueueListener to RunListener.
> It would be great if i get any reference for the same.
>
> Thanks
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/783c0d8f-0086-405a-b59c-58eeff979c7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dependencies required for pipeline jobs in hpi:run

2019-07-06 Thread Parichay Barpanda
Thanks Gavin and Devin. Pipeline: Declarative dependency was required.

On Fri, Jul 5, 2019 at 6:50 PM Devin Nusbaum  wrote:

> “pipeline” in a Jenkinsfile comes from Pipeline: Declarative Plugin,
> groupId is org.jenkinsci.plugins, artifactId is pipeline-model-definition.
> That has a lot of dependencies, so depending on your use case, it might be
> preferable to convert your test case to scripted and depend only on
> workflow-cps, workflow-job, and workflow-basic-steps in test scope (perhaps
> also a few others such workflow-durable-task-step for the `node` step).
>
> On Jul 5, 2019, at 03:29, Gavin  wrote:
>
> You need to depend (I recommend scope of test) on the pipeline plugin that
> implements that feature. I think it would be the following but I can't
> remember
>
>   
> org.jenkins-ci.plugins.workflow
> workflow-step-api
> 2.19
> test
> 
>
> (Or maybe definition- https://plugins.jenkins.io/pipeline-model-definition
> )
>
> On Thu., Jul. 4, 2019, 9:04 p.m. Parichay Barpanda, <
> parichay.barpa...@gmail.com> wrote:
>
>> Hi all,
>>
>> I am working Branch Source part of GitLab Plugin. There are a different
>> bugs that needs attention but for now, the basic branch indexing and branch
>> building for Multibranch Pipeline Jobs works just fine.
>>
>> I want to test the pipeline jobs with `mvn hpi:run`. But when a branch is
>> getting built I get an error:
>>
>> Branch indexing
>> Querying the current revision of branch master...
>> Current revision of branch master is fb65543c24719f77167dcb3967423f349094b4d3
>> Obtained Jenkinsfile from fb65543c24719f77167dcb3967423f349094b4d3
>> Running in Durability level: MAX_SURVIVABILITY
>>
>> [Pipeline] End of Pipeline
>> java.lang.NoSuchMethodError: No such DSL method 'pipeline' found among
>> steps [archive, build, catchError, checkout, deleteDir, dir, echo, error,
>> fileExists, getContext, git, isUnix, load, mail, parallel, properties,
>> pwd, readFile, readTrusted, resolveScm, retry, sleep, stash, step,
>> timeout, tool, unarchive, unstash, waitUntil, withContext, withEnv, wrap,
>> writeFile] or symbols [all, always, apiToken, architecture,
>> archiveArtifacts, artifactManager, batchFile, booleanP
>> .
>>
>>
>> The logger also doesn't log `[Pipeline] Start of Pipeline`(Idk what that
>> means).
>>
>> When I install the same plugin in `Jenkins docker with the recommended
>> plugins installed`, the pipeline job is performed successfully. I am not
>> quite sure but I think `pipeline jobs` don't work with `hpi:run` as there
>> is/are some missing dependencies. Here is the pom of my plugin
>> https://github.com/baymac/gitlab-branch-source-plugin/blob/feature/branch-source/pom.xml
>> .
>>
>> Kindly let me know what I am missing something. If this is something
>> other than just missing dependency then can someone with branch source
>> plugins experience have a look at the pr and suggest changes:
>> https://github.com/baymac/gitlab-branch-source-plugin/pull/20.
>>
>> We can also have further discussions in JIRA
>> https://issues.jenkins-ci.org/browse/JENKINS-58268.
>>
>> Thank you.
>>
>> --
>> 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-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/7962e605-16d0-40b6-a7fb-a4bb67b2fbe0%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/7962e605-16d0-40b6-a7fb-a4bb67b2fbe0%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuuTn4_BhcTDqvi0ZGyQknVpjusDXpYx5MSPqaGk7bMNjg%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuuTn4_BhcTDqvi0ZGyQknVpjusDXpYx5MSPqaGk7bMNjg%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" gr

Dependencies required for pipeline jobs in hpi:run

2019-07-04 Thread Parichay Barpanda
Hi all,

I am working Branch Source part of GitLab Plugin. There are a different 
bugs that needs attention but for now, the basic branch indexing and branch 
building for Multibranch Pipeline Jobs works just fine.

I want to test the pipeline jobs with `mvn hpi:run`. But when a branch is 
getting built I get an error:

Branch indexing
Querying the current revision of branch master...
Current revision of branch master is fb65543c24719f77167dcb3967423f349094b4d3
Obtained Jenkinsfile from fb65543c24719f77167dcb3967423f349094b4d3
Running in Durability level: MAX_SURVIVABILITY

[Pipeline] End of Pipeline
java.lang.NoSuchMethodError: No such DSL method 'pipeline' found among 
steps [archive, build, catchError, checkout, deleteDir, dir, echo, error, 
fileExists, getContext, git, isUnix, load, mail, parallel, properties, pwd, 
readFile, readTrusted, resolveScm, retry, sleep, stash, step, timeout, tool, 
unarchive, unstash, waitUntil, withContext, withEnv, wrap, writeFile] or 
symbols [all, always, apiToken, architecture, archiveArtifacts, 
artifactManager, batchFile, booleanP
.


The logger also doesn't log `[Pipeline] Start of Pipeline`(Idk what that 
means). 

When I install the same plugin in `Jenkins docker with the recommended 
plugins installed`, the pipeline job is performed successfully. I am not 
quite sure but I think `pipeline jobs` don't work with `hpi:run` as there 
is/are some missing dependencies. Here is the pom of my plugin 
https://github.com/baymac/gitlab-branch-source-plugin/blob/feature/branch-source/pom.xml
.

Kindly let me know what I am missing something. If this is something other 
than just missing dependency then can someone with branch source plugins 
experience have a look at the pr and suggest changes: 
https://github.com/baymac/gitlab-branch-source-plugin/pull/20.

We can also have further discussions in JIRA 
https://issues.jenkins-ci.org/browse/JENKINS-58268.

Thank you.

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/7962e605-16d0-40b6-a7fb-a4bb67b2fbe0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Requirement for GitLab Ultimate for GitLab Branch Source Development

2019-06-21 Thread Parichay Barpanda
Hi all,

GitLab grants access to it's enterprise editions for open source projects. 
The list can be found here - 
https://about.gitlab.com/solutions/open-source/projects/.

The list says `GitLab Plugin ` 
project under Jenkins org has been granted GitLab Ultimate access. I 
request developers of `GitLab Plugin` to share with me the access to GitLab 
Ulimate account so that I can leverage it to support enterprise features 
for GitLab in Jenkins. A direct requirement is for setting up webhooks from 
GitLab Groups. 

I have requested for access to GitLab Gold for my project - 
https://gitlab.com/gitlab-com/marketing/community-relations/gitlab-oss/merge_requests/384

I am not sure how long this process would take, so I am asking here to 
speed up the development.

Thanks.

CC: *Owen Mehegan*, *Robin Müller*

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/dfc7cccf-d6b4-45c5-951a-50bc587540bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Request to review: How to fix RequireUpperBoundDeps

2019-06-17 Thread Parichay Barpanda
Hi Gavin,

That doesn't work either. In case you want to take a look at the pom it's 
here - https://gist.github.com/baymac/ec349eda7166e93edc2269bb61ea9e94

For me, exclusions (not recommended) way worked as seen in the pom.

On Tuesday, June 18, 2019 at 5:01:49 AM UTC+5:30, Gavin Mogan wrote:
>
> Your highest is the 3rd one, org.jenkins-ci.plugins:structs:1.18, so it 
> needs to be at least 1.18
>
> On Mon, Jun 17, 2019 at 4:30 PM Parichay Barpanda  > wrote:
>
>> Hi ikedam,
>>
>> Thanks for the wiki it was helpful. I am working on GitLab Branch Source 
>> Plugin and I faced similar errors. I used the `dependency management` 
>> method to fix it. While it worked for some of the dependencies it didn't 
>> work for some and I am still getting the following error:
>>
>> [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (display-info) @ 
>> gitlab-branch-source ---
>> [INFO] Adding ignore: module-info
>> [WARNING] Rule 5: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps 
>> failed with message:
>> Failed while enforcing RequireUpperBoundDeps. The error(s) are [
>> Require upper bound dependencies error for 
>> org.jenkins-ci.plugins:structs:1.7 paths to dependency are:
>> +-io.jenkins.plugins:gitlab-branch-source:0.0.3.-SNAPSHOT
>>   +-org.jenkins-ci.plugins:scm-api:2.5.0
>> +-org.jenkins-ci.plugins:structs:1.7 (managed) <-- 
>> org.jenkins-ci.plugins:structs:1.9
>> and
>> +-io.jenkins.plugins:gitlab-branch-source:0.0.3.-SNAPSHOT
>>   +-org.jenkins-ci.plugins:credentials:2.2.0
>> +-org.jenkins-ci.plugins:structs:1.7 (managed) <-- 
>> org.jenkins-ci.plugins:structs:1.9
>> and
>> +-io.jenkins.plugins:gitlab-branch-source:0.0.3.-SNAPSHOT
>>   +-org.jenkins-ci.plugins:git:3.10.0
>> +-org.jenkins-ci.plugins:structs:1.7 (managed) <-- 
>> org.jenkins-ci.plugins:structs:1.18
>> and
>> +-io.jenkins.plugins:gitlab-branch-source:0.0.3.-SNAPSHOT
>>   +-org.jenkins-ci.plugins:git:3.10.0
>> +-org.jenkins-ci.plugins:git-client:2.7.7
>>   +-org.jenkins-ci.plugins:structs:1.7 (managed) <-- 
>> org.jenkins-ci.plugins:structs:1.9
>> and
>> +-io.jenkins.plugins:gitlab-branch-source:0.0.3.-SNAPSHOT
>>   +-org.jenkins-ci.plugins:git:3.10.0
>> +-org.jenkins-ci.plugins.workflow:workflow-step-api:2.13
>>   +-org.jenkins-ci.plugins:structs:1.7 (managed) <-- 
>> org.jenkins-ci.plugins:structs:1.5
>> ]
>>
>> This is what I received even after adding `structs` version 1.7 to 
>> `dependency management`. Is there something I am missing here?
>>
>> On Sunday, June 16, 2019 at 9:27:00 AM UTC+5:30, ikedam wrote:
>>>
>>> Hello, 
>>>
>>> I'm often annoyed with RequireUpperBoundDeps errors while developing 
>>> plugins.
>>> I believe it's really complicating, but I didn't know much about maven,
>>> there looks no documentation for that, and I didn't know the best way to 
>>> handle that for long time.
>>>
>>> I believe I get understand the behavior of maven and 
>>> RequireUpperBoundDeps these days.
>>> I wrote a documentation to help developers like me to know how to handle 
>>> RequireUpperBoundDep.
>>>
>>> https://wiki.jenkins.io/display/JENKINS/How+to+fix+RequireUpperBoundDeps
>>>
>>> Would you review this page and see whether it's suitable?
>>>
>>>
>>> Regards,
>>> ikedam
>>>
>>> -- 
>> 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 jenkin...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/ea162426-f124-4074-afc5-86b5600ea31d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/ea162426-f124-4074-afc5-86b5600ea31d%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/ffea3dfd-6f92-475b-91df-29fcecb66d00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Request to review: How to fix RequireUpperBoundDeps

2019-06-17 Thread Parichay Barpanda
Hi ikedam,

Thanks for the wiki it was helpful. I am working on GitLab Branch Source 
Plugin and I faced similar errors. I used the `dependency management` 
method to fix it. While it worked for some of the dependencies it didn't 
work for some and I am still getting the following error:

[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (display-info) @ 
gitlab-branch-source ---
[INFO] Adding ignore: module-info
[WARNING] Rule 5: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps 
failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for 
org.jenkins-ci.plugins:structs:1.7 paths to dependency are:
+-io.jenkins.plugins:gitlab-branch-source:0.0.3.-SNAPSHOT
  +-org.jenkins-ci.plugins:scm-api:2.5.0
+-org.jenkins-ci.plugins:structs:1.7 (managed) <-- 
org.jenkins-ci.plugins:structs:1.9
and
+-io.jenkins.plugins:gitlab-branch-source:0.0.3.-SNAPSHOT
  +-org.jenkins-ci.plugins:credentials:2.2.0
+-org.jenkins-ci.plugins:structs:1.7 (managed) <-- 
org.jenkins-ci.plugins:structs:1.9
and
+-io.jenkins.plugins:gitlab-branch-source:0.0.3.-SNAPSHOT
  +-org.jenkins-ci.plugins:git:3.10.0
+-org.jenkins-ci.plugins:structs:1.7 (managed) <-- 
org.jenkins-ci.plugins:structs:1.18
and
+-io.jenkins.plugins:gitlab-branch-source:0.0.3.-SNAPSHOT
  +-org.jenkins-ci.plugins:git:3.10.0
+-org.jenkins-ci.plugins:git-client:2.7.7
  +-org.jenkins-ci.plugins:structs:1.7 (managed) <-- 
org.jenkins-ci.plugins:structs:1.9
and
+-io.jenkins.plugins:gitlab-branch-source:0.0.3.-SNAPSHOT
  +-org.jenkins-ci.plugins:git:3.10.0
+-org.jenkins-ci.plugins.workflow:workflow-step-api:2.13
  +-org.jenkins-ci.plugins:structs:1.7 (managed) <-- 
org.jenkins-ci.plugins:structs:1.5
]

This is what I received even after adding `structs` version 1.7 to 
`dependency management`. Is there something I am missing here?

On Sunday, June 16, 2019 at 9:27:00 AM UTC+5:30, ikedam wrote:
>
> Hello, 
>
> I'm often annoyed with RequireUpperBoundDeps errors while developing 
> plugins.
> I believe it's really complicating, but I didn't know much about maven,
> there looks no documentation for that, and I didn't know the best way to 
> handle that for long time.
>
> I believe I get understand the behavior of maven and RequireUpperBoundDeps 
> these days.
> I wrote a documentation to help developers like me to know how to handle 
> RequireUpperBoundDep.
>
> https://wiki.jenkins.io/display/JENKINS/How+to+fix+RequireUpperBoundDeps
>
> Would you review this page and see whether it's suitable?
>
>
> Regards,
> ikedam
>
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/ea162426-f124-4074-afc5-86b5600ea31d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating an env variable via API

2019-06-12 Thread Parichay Barpanda
Just recorrecting myself here. I misconfused global properties with 
environment variables. Joseph Peterson clarified to me later. So I guess 
the previous method is not how it works with JCasC.

Thanks.

On Wednesday, June 12, 2019 at 6:50:46 AM UTC+5:30, Parichay Barpanda wrote:
>
> I found this groovy script to create a global environment variable in 
> Jenkins.
>
> Env.groovy:
>
> import hudson.EnvVars;
> import hudson.slaves.EnvironmentVariablesNodeProperty;
> import hudson.slaves.NodeProperty;
> import hudson.slaves.NodePropertyDescriptor;
> import hudson.util.DescribableList;
> import jenkins.model.Jenkins;
> public createGlobalEnvironmentVariables(String key, String value){
>
> Jenkins instance = Jenkins.getInstance();
>
> DescribableList, NodePropertyDescriptor> 
> globalNodeProperties = instance.getGlobalNodeProperties();
> List envVarsNodePropertyList = 
> globalNodeProperties.getAll(EnvironmentVariablesNodeProperty.class);
>
> EnvironmentVariablesNodeProperty newEnvVarsNodeProperty = null;
> EnvVars envVars = null;
>
> if ( envVarsNodePropertyList == null || 
> envVarsNodePropertyList.size() == 0 ) {
> newEnvVarsNodeProperty = new 
> hudson.slaves.EnvironmentVariablesNodeProperty();
> globalNodeProperties.add(newEnvVarsNodeProperty);
> envVars = newEnvVarsNodeProperty.getEnvVars();
> } else {
> envVars = envVarsNodePropertyList.get(0).getEnvVars();
> }
> envVars.put(key, value)
> instance.save()
> }
> createGlobalEnvironmentVariables('xyzabc','baymac')
>
>
> Using Jenkins CLI with the command to execute the above script
>
> java -jar "jenkins-cli.jar" -s 'https://my.jenkins.instance' -noKeyAuth -auth 
> ".jenkins-cli-auth" groovy = < 
>
>
> where .jenkins-cli-auth is `:`
>
> The env variables are populated
>
> [image: Screenshot from 2019-06-12 06-19-33.png]
>
> Now the question is, is it a good idea to recommend users to populate env 
> with GitLab Personal Access Token using this method before performing a 
> jcasc reload?
>
> Also I think it would be better to store env variables values in a 
> password form rather than plain text.
>
> On Tuesday, June 11, 2019 at 8:24:32 AM UTC+5:30, Parichay Barpanda wrote:
>>
>> Hi all,
>>
>> I am trying to figure out a way to add an environment variable to Jenkins 
>> without using the UI. Is there a way to do it via API? The intention is to 
>> let user add credentials to Jenkins without using UI. Please let me know if 
>> you have a solution to this.
>>
>> 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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/f03d5853-b80f-4f9c-b71d-42878374be5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating an env variable via API

2019-06-11 Thread Parichay Barpanda
I found this groovy script to create a global environment variable in 
Jenkins.

Env.groovy:

import hudson.EnvVars;
import hudson.slaves.EnvironmentVariablesNodeProperty;
import hudson.slaves.NodeProperty;
import hudson.slaves.NodePropertyDescriptor;
import hudson.util.DescribableList;
import jenkins.model.Jenkins;
public createGlobalEnvironmentVariables(String key, String value){

Jenkins instance = Jenkins.getInstance();

DescribableList, NodePropertyDescriptor> 
globalNodeProperties = instance.getGlobalNodeProperties();
List envVarsNodePropertyList = 
globalNodeProperties.getAll(EnvironmentVariablesNodeProperty.class);

EnvironmentVariablesNodeProperty newEnvVarsNodeProperty = null;
EnvVars envVars = null;

if ( envVarsNodePropertyList == null || 
envVarsNodePropertyList.size() == 0 ) {
newEnvVarsNodeProperty = new 
hudson.slaves.EnvironmentVariablesNodeProperty();
globalNodeProperties.add(newEnvVarsNodeProperty);
envVars = newEnvVarsNodeProperty.getEnvVars();
} else {
envVars = envVarsNodePropertyList.get(0).getEnvVars();
}
envVars.put(key, value)
instance.save()
}
createGlobalEnvironmentVariables('xyzabc','baymac')


Using Jenkins CLI with the command to execute the above script

java -jar "jenkins-cli.jar" -s 'https://my.jenkins.instance' -noKeyAuth -auth 
".jenkins-cli-auth" groovy = < 


where .jenkins-cli-auth is `:`

The env variables are populated

[image: Screenshot from 2019-06-12 06-19-33.png]

Now the question is, is it a good idea to recommend users to populate env 
with GitLab Personal Access Token using this method before performing a 
jcasc reload?

Also I think it would be better to store env variables values in a password 
form rather than plain text.

On Tuesday, June 11, 2019 at 8:24:32 AM UTC+5:30, Parichay Barpanda wrote:
>
> Hi all,
>
> I am trying to figure out a way to add an environment variable to Jenkins 
> without using the UI. Is there a way to do it via API? The intention is to 
> let user add credentials to Jenkins without using UI. Please let me know if 
> you have a solution to this.
>
> 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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/b1b6ad46-b08f-4eca-9ee1-5ff6550e5990%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating an env variable via API

2019-06-11 Thread Parichay Barpanda
Yes that shoud work. Although I think for a user it would be easier to have
a cli command or api method to populate the env variable in Jenkins. Since
in systems which are not isolated, storing a credentials in plain text can
involve risk.

Here is a small example from Travis,

Travis has CLI tool, that logs into your travis instance.

Let's say there is a file with my personal access token with the name
`.gitlab_token`

If I run travis `travis encrypt-file .gitlab_token`, this generates an
encoded file `.gitlab_token.enc` and pushes the necessary env variables to
travis repository required to decrypt my file.

This file can be decrypted in the build step by adding:

openssl aes-256-cbc -K $encrypted_0a6446eb3ae3_key -iv
$encrypted_0a6446eb3ae3_iv -in .gitlab_token.enc -out .gitlab_token -d


For encrypting env variables, it uses RSA key pair. The docs
<https://docs.travis-ci.com/user/encryption-keys/> can explain this better.
This more close to Jenkins pipeline but I think we can do a similar thing
in JCasC so that we do not have to depend on docker secrets or azure
secrets or any external party support.

On Tue, Jun 11, 2019 at 3:37 PM Tim Jacomb  wrote:

> What I do for this is set the SECRETS environment variably and point it to
> a directory on the file system which had the secrets in it.
> Basically pretending I’m using docker secrets
>
> Thanks
> Tim
>
> On Tue, 11 Jun 2019 at 10:27, Parichay Barpanda <
> parichay.barpa...@gmail.com> wrote:
>
>> Thanks Gaven. Groovy is cool but we are using JCasC yaml to create
>> credentials. I want to populate an environment variable and use it in my
>> config.yaml. I want to know if there is a way to do it without using docker
>> secrets. For example, when running Jenkins instance inside a VM or using
>> jenkins.war file on local machine. Is there a way to do it in these cases
>> (without going through UI)?
>>
>> The config file looks like this:
>>
>>> credentials:
>>>   system:
>>> domainCredentials:
>>>   - credentials:
>>>   - gitlabPersonalAccessToken:
>>>   scope: SYSTEM
>>>   id: "i<3GitLab"
>>>   token: ${GITLAB_PERSONAL_ACCESS_TOKEN}
>>>
>>>
>>
>> On Tue, Jun 11, 2019 at 10:04 AM Gavin Mogan 
>> wrote:
>>
>>> You can unsafely access the script console -
>>> https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console
>>>
>>> then you can create credentials using groovy, example -
>>> https://github.com/halkeye-docker/docker-jenkins/blob/22ba8c4408b3a16188dc9fe967293849e8f12468/groovy/0012-add-tokens.groovy#L50-L57
>>>
>>> On Mon, Jun 10, 2019 at 8:12 PM Parichay Barpanda <
>>> parichay.barpa...@gmail.com> wrote:
>>>
>>>> For example,
>>>>
>>>> To delete a job, you can make a POST request to Jenkins server as:
>>>>
>>>> curl -X POST http://localhost:8080/job/my-job-name/doDelete --user
>>>> jenkins:f1499cc9852c899d327a1f644e61a64d
>>>>
>>>> where,
>>>> *username*: jenkins
>>>> *api token*: f1499cc9852c899d327a1f644e61a64d
>>>>
>>>> On Tuesday, June 11, 2019 at 8:24:32 AM UTC+5:30, Parichay Barpanda
>>>> wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> I am trying to figure out a way to add an environment variable to
>>>>> Jenkins without using the UI. Is there a way to do it via API? The
>>>>> intention is to let user add credentials to Jenkins without using UI.
>>>>> Please let me know if you have a solution to this.
>>>>>
>>>>> 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-dev+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jenkinsci-dev/abc16929-b9e6-4e38-86c9-af7233f2451e%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/abc16929-b9e6-4e38-86c9-af7233f2451e%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> You received this message because you are subscribe

Re: Creating an env variable via API

2019-06-11 Thread Parichay Barpanda
Thanks Gaven. Groovy is cool but we are using JCasC yaml to create
credentials. I want to populate an environment variable and use it in my
config.yaml. I want to know if there is a way to do it without using docker
secrets. For example, when running Jenkins instance inside a VM or using
jenkins.war file on local machine. Is there a way to do it in these cases
(without going through UI)?

The config file looks like this:

> credentials:
>   system:
> domainCredentials:
>   - credentials:
>   - gitlabPersonalAccessToken:
>   scope: SYSTEM
>   id: "i<3GitLab"
>   token: ${GITLAB_PERSONAL_ACCESS_TOKEN}
>
>

On Tue, Jun 11, 2019 at 10:04 AM Gavin Mogan  wrote:

> You can unsafely access the script console -
> https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console
>
> then you can create credentials using groovy, example -
> https://github.com/halkeye-docker/docker-jenkins/blob/22ba8c4408b3a16188dc9fe967293849e8f12468/groovy/0012-add-tokens.groovy#L50-L57
>
> On Mon, Jun 10, 2019 at 8:12 PM Parichay Barpanda <
> parichay.barpa...@gmail.com> wrote:
>
>> For example,
>>
>> To delete a job, you can make a POST request to Jenkins server as:
>>
>> curl -X POST http://localhost:8080/job/my-job-name/doDelete --user
>> jenkins:f1499cc9852c899d327a1f644e61a64d
>>
>> where,
>> *username*: jenkins
>> *api token*: f1499cc9852c899d327a1f644e61a64d
>>
>> On Tuesday, June 11, 2019 at 8:24:32 AM UTC+5:30, Parichay Barpanda wrote:
>>>
>>> Hi all,
>>>
>>> I am trying to figure out a way to add an environment variable to
>>> Jenkins without using the UI. Is there a way to do it via API? The
>>> intention is to let user add credentials to Jenkins without using UI.
>>> Please let me know if you have a solution to this.
>>>
>>> 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-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/abc16929-b9e6-4e38-86c9-af7233f2451e%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/abc16929-b9e6-4e38-86c9-af7233f2451e%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAAgr96%2B2deU7v64sgJruQ02X0S34D31FYtEFN9ak57zN4Uo2PA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAAgr96%2B2deU7v64sgJruQ02X0S34D31FYtEFN9ak57zN4Uo2PA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWANNZbsP%3D-jJ58Va-4t3a%3Dko5A2nWseXA46SXk23WT9%2BHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating an env variable via API

2019-06-10 Thread Parichay Barpanda
For example,

To delete a job, you can make a POST request to Jenkins server as:

curl -X POST http://localhost:8080/job/my-job-name/doDelete --user 
jenkins:f1499cc9852c899d327a1f644e61a64d

where,
*username*: jenkins
*api token*: f1499cc9852c899d327a1f644e61a64d

On Tuesday, June 11, 2019 at 8:24:32 AM UTC+5:30, Parichay Barpanda wrote:
>
> Hi all,
>
> I am trying to figure out a way to add an environment variable to Jenkins 
> without using the UI. Is there a way to do it via API? The intention is to 
> let user add credentials to Jenkins without using UI. Please let me know if 
> you have a solution to this.
>
> 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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/abc16929-b9e6-4e38-86c9-af7233f2451e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Creating an env variable via API

2019-06-10 Thread Parichay Barpanda
Hi all,

I am trying to figure out a way to add an environment variable to Jenkins 
without using the UI. Is there a way to do it via API? The intention is to 
let user add credentials to Jenkins without using UI. Please let me know if 
you have a solution to this.

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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/b068dcd3-0ab1-41f4-9d5b-813ec84fc16d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Seeking information about GitHub Branch Source Plugin

2019-05-20 Thread Parichay Barpanda
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:

https://docs.google.com/document/d/1r_zQy5KpNNAO4KerFJrowWvGfFIU7xdEdqKgFenS3lI/edit?usp=drivesdk

Thanks.

Regards,
Parichay (baymac)

On Mon 20 May, 2019, 17:03 Robert Sandell,  wrote:

> I'd suggest you first take inspiration from the Gitea plugin
> <https://github.com/jenkinsci/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
>
> Den sön 19 maj 2019 kl 18:19 skrev Parichay Barpanda <
> parichay.barpa...@gmail.com>:
>
>> Thanks batmat for the answers.
>>
>> On Sun 19 May, 2019, 21:27 Baptiste Mathus,  wrote:
>>
>>>
>>>
>>> Le mer. 15 mai 2019 à 22:17, Parichay Barpanda <
>>> parichay.barpa...@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.

Re: Seeking information about GitHub Branch Source Plugin

2019-05-19 Thread Parichay Barpanda
Thanks batmat for the answers.

On Sun 19 May, 2019, 21:27 Baptiste Mathus,  wrote:

>
>
> Le mer. 15 mai 2019 à 22:17, Parichay Barpanda <
> parichay.barpa...@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-dev+unsubscr...@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
>> <https://groups.google.com/d/msgid/jenkinsci-dev/d4215d95-55d5-4322-b945-1b272fc512df%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CANWgJS6Nvj_%2B_pw-rqS36tgb7JwPcAnKpAQuT9WLDyYwxFyU2Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CANWgJS6Nvj_%2B_pw-rqS36tgb7JwPcAnKpAQuT9WLDyYwxFyU2Q%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAN7HaW1VejOExDGNhO4YHG28HmzdvHWBR8OwqN8C60UfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dependency plugin specifier in Pom.xml

2019-05-18 Thread Parichay Barpanda
I am not quite sure about this problem, maybe upgrade your Jenkins version
to Jenkins LTS beyond 2.6 like 2.60.3.

And debugging on mailing list can be tedious and complicated. If you upload
your plugin to GitHub or any other SCM and share the link I can take a look
at it.

On Sat 18 May, 2019, 21:49 selva vignesh,  wrote:

> Hi Parichay,
> Yes I have tried. I have given build var plugin as a dependency and scope
> as compile time.
> While packaging using mvn package, it’s asking me do check commons-Lang
> 2.1 and Jenkins expecting 2.6. Can you please explain how Can I resolve
> this kind of issue.
>
> On Sat, 18 May 2019 at 9:35 PM, Parichay Barpanda <
> parichay.barpa...@gmail.com> wrote:
>
>> Hi Vignesh,
>>
>> I am not quite sure I understand your problem but installing your
>> dependency plugins before installing your plugin should be pretty
>> straightforward:
>>
>> 1) Inside POM mention your dependency plugins within 'dependencies' tag
>>
>> 2) Run 'mvn clean install' then 'mvn hpi:run', your plugin should run a
>> pseudo Jenkins instance with your plugin and it's dependencies installed.
>>
>> Thanks,
>> Parichay (baymac)
>>
>> On Sat 18 May, 2019, 21:16 Jeff Pearce,  wrote:
>>
>>> I don’t quite get it. Can you describe the real world scenario you’re
>>> trying to implement?
>>>
>>> Best,
>>> Jeff
>>>
>>> Sent from my iPhone
>>>
>>> On May 18, 2019, at 8:07 AM, selva vignesh 
>>> wrote:
>>>
>>> Hi Adrien,
>>> Thanks for replying.. my question is if I want to install my plugin it
>>> should ask me to mentioned plugin should be installed example pipeline
>>> plugin should be installed first and after that only allow to install my
>>> plugin.  Or else installation must be failed and showing warning message as
>>> pipeline plugin install before install my plugin.
>>> Hope you understand now.. If not please let me know. I will explain
>>> again.
>>> On Sat, 18 May 2019 at 3:17 PM, Adrien Lecharpentier <
>>> adrien.lecharpent...@gmail.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> all you need is to declare the plugins as dependencies of your plugin.
>>>> You need to specify them in `compile` scope and not optional.
>>>>
>>>> However, you should only declare those plugins if you need their code
>>>> for your own plugin.
>>>> From your question, I'm not sure it's the case.
>>>>
>>>> BR,
>>>> -- Adrien
>>>>
>>>> Le sam. 18 mai 2019 à 08:40, selva vignesh 
>>>> a écrit :
>>>>
>>>>> HI,
>>>>>   How to make some dependency plugin to be installed while our plugin
>>>>> before installing.
>>>>> What are the changes need to be done at pom.xml.
>>>>> Thanks in advance
>>>>>
>>>>> --
>>>>> 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-dev+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/jenkinsci-dev/f678a5d0-0ee5-4a76-b5f5-ed2b395bc674%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/f678a5d0-0ee5-4a76-b5f5-ed2b395bc674%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>> --
>>>> Adrien Lecharpentier
>>>>
>>>> --
>>>> 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-dev+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jenkinsci-dev/CAKwJSvyFrXQFEfo_mCpvzZWiKc_rUZaz28r9Hx2mRg3S%2B0ACoQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/CAKwJSvyFrXQFEfo_mCpvzZWiKc_rUZaz28r9Hx2mRg3S%2B0ACoQ%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> You received th

Seeking information about GitHub Branch Source Plugin

2019-05-15 Thread Parichay Barpanda
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)


-- 
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-dev+unsubscr...@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.


Re: Wrapping Gitlab API into a separate plugin

2019-04-29 Thread Parichay Barpanda
Thanks Matt that was helpful. :)

On Mon, Apr 29, 2019 at 10:08 PM Matt Sicker  wrote:

> The main advantage to using an API plugin is to allow the library to
> be reused by other plugins without each plugin needing to maintain
> updates to the dependencies manually. Instead, the API plugin is used
> for those libraries which reduces maintenance burden, especially
> whenever CVEs are discovered.
>
> On Sun, Apr 28, 2019 at 12:34 AM  wrote:
> >
> > Hi all,
> >
> > I am working on improving the Gitlab Plugins. The first plan is to move
> to a gitlab-api-plugin which provides Gitlab Java Apis rather than using
> the ones implemented inside the plugins codebase. This will be similar to
> github-api-plugin.
> >
> > What is the advantage of wrapping an API inside a plugin over using Apis
> directly as a dependency?
> >
> > If someone experienced with development of Github Api Plugin or similar,
> please take a look at our gitlab-api-plugin:
> > https://github.com/jenkins-gitlab/gitlab-api-plugin
> >
> > Your review will be higly appreciated.
> >
> > 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-dev+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/c162286c-924e-4ea8-9f10-358d0c9000c6%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Matt Sicker
> Senior Software Engineer, CloudBees
>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAEot4ow4Sr1hXZ%3D9mT82%3DVYe6sS3N70d1HJ2G10RwP3NXLp1kA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAPACQccYq-DE-d4GKx0m6PGD1o%3DOc%2BFfEEH64Nb8QwC5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Wrapping Gitlab API into a separate plugin

2019-04-27 Thread parichay . barpanda
Hi all,

I am working on improving the Gitlab Plugins. The first plan is to move to 
a *gitlab-api-plugin* 
which 
provides Gitlab Java Apis rather than using the ones implemented inside the 
plugins codebase. This will be similar to *github-api-plugin 
. *

What is the advantage of wrapping an API inside a plugin over using Apis 
directly as a dependency?

If someone experienced with development of Github Api Plugin or similar, 
please take a look at our gitlab-api-plugin:
https://github.com/jenkins-gitlab/gitlab-api-plugin

Your review will be higly appreciated.

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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/c162286c-924e-4ea8-9f10-358d0c9000c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Feedback for local maven workflow in Jenkins Plugin Dev

2019-04-15 Thread Parichay Barpanda
Just to clarify what you are suggesting:

1) Run `mvn install` on the first plugin to install it in my local maven 
repository.
2) Then depend on the first plugin directly in the pom.xml of my second 
plugin as maven resolves it from local maven repository.

Yeah this works but..

Unfortunately, in my case I had modified maven's settings.xml - 
https://gist.github.com/baymac/de891c463ccc5316fce475ef87025d19 

Maven checks the upstream jenkins repository (repo.jenkins-ci.org) for 
dependencies even for my local dependency and of course it isn't found 
there which gives an error. Although I am not really sure if that is the 
case because I face this error sometimes and unable to reproduce it again. 
As of now it works without removing the maven settings.

Regards,
Parichay (baymac)

On Tuesday, April 16, 2019 at 7:58:32 AM UTC+5:30, Jesse Glick wrote:
>
> On Mon, Apr 15, 2019 at 10:13 PM Parichay Barpanda 
> > wrote: 
> > I ran the following command (the additional params for groupid, 
> artifactid, version are optional).: 
> > 
> > mvn install:install-file 
> -Dfile=/home/parichay/gsoc/gitlab-plugin/lib/gitlab-api.jar 
> -DgroupId=io.jenkins.plugins -DartifactId=gitlab-api -Dversion=1.0-SNAPSHOT 
>
> No, just run 
>
> mvn install 
>
> as I said before. No parameters. 
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/b85e3d06-1d55-41c0-ae8d-1c66714f468f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Feedback for local maven workflow in Jenkins Plugin Dev

2019-04-15 Thread Parichay Barpanda
Hi jesse,

Thanks for replying.

Both are private plugins.

Installing the plugin using the command as you have suggested is simple
enough but I couldn't make it work that way. It compiled successfully but I
was unable to import dependencies classes.

I tried another method using the *maven install plugin*. What I did there
can be found here -
https://gist.github.com/baymac/6e822204da2c175d10933aedb893dd2a
There was the same problem as installing the plugin from commandlline.

I am confused if "installing the plugin" mean "installing the jar package
generated inside the */target* directory of the first plugin"?

I will read your JEP when I have some time.

Regards,
Parichay (baymac)


On Mon 15 Apr, 2019, 18:39 Jesse Glick  On Sun, Apr 14, 2019 at 9:16 PM Parichay Barpanda
>  wrote:
> > I was working on 2 different plugins.
>
> Private plugins, or hosted in @jenkinsci?
>
> > The second plugin needed a way to depend on the first plugin. There were
> multiple ways it could be done like:
>
> This is quite routine for plugins hosted in the normal way. You do not
> need to do anything special beyond declare the ``. You can
> even have dependencies on unreleased changes via JEP-305.
>
> > ii) Installing the jar in the local maven but for me it was a complex
> setup
>
> $ mvn -f first-plugin install
>
> is a complex setup?
>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2gM1b2HAo8aBpvaYd2OQA6ertuz5sLzesqwQx7dNmQ8w%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAPyb3XO9KLV3jf5gvHe-XSDVV9edAmhUJ446Kv91B3a9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Feedback for local maven workflow in Jenkins Plugin Dev

2019-04-14 Thread Parichay Barpanda
Hi all,

I would like to share my views on local Jenkins Plugin development as an 
inexperienced programmer.

I was working on 2 different plugins. The second plugin needed a way to 
depend on the first plugin. There were multiple ways it could be done like:

i) Pushing the artifact to a central(remote) repository but for some reason 
I did not want it there.

ii) Installing the jar in the local maven but for me it was a complex setup 
and needs you to make changes during production anyway as jars aren't the 
best way to control the dependency versions.

iii) Using a Repository Manager like Nexus RM but it is a bit of an 
overkill if it's just one small project and running a nxrm server is an 
expensive computational affair. Yet it maybe worth it if you want to 
cleanly deploy and depend on local plugins without the knowledge of the 
plugin dependencies management. For me this is the best method if it is 
just a local or organisational development and not meant for public. I 
wrote a blog post about setting up a NXRM server here - 
https://medium.com/@baymac/nexus-repository-manager-setup-for-jenkins-plugin-development-f6246dc669b8
.

Each way has it's own trade-offs and it depends on your preference mostly. 
Stephen has written a nice article about it - 
https://www.cloudbees.com/blog/playing-trade-offs-maven 

Any suggestions or corrections are welcome.

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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/bf7dc0bc-4a24-4d02-9db3-180e9f9fdcaa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating a new Gitlab SCM Plugin with Multibranch Pipeline support

2019-04-04 Thread Parichay Barpanda
Hi Owen,

I am really glad this thread got your attention. Firstly, I would like to
apologise for being critical about the multi-branch pipeline support in
Gitlab Plugin. I acknowledge a lot of hard work and time must have been
dedicated to develop the Gitlab plugin. I have been spending time with the
codebase learning how it could be improved, I find it very well written and
readable. Lots of stuffs in there to learn from.

Secondly, I would like to explain my idea for adding the multi-branch
support. I understand the convention for SCM plugins is to implement 2
different plugins ( and ), but the community also
understands this is an accident of history. From my discussion with one of
the project mentors, Joseph Peterson (@casz) we came to a conclusion that
the branch source functionality (folder org type multi-branch pipeline
support) can be implemented inside the Gitlab Plugin. So, in order to
remove confusion from user point of view we want to implement everything in
one plugin. My conviction is this wouldn't cause much disruption of
existing conventions because we are only making things simpler. And if we
can have a proper documentation of the history of the plugin development
then there shouldn't be any issue. Just one plugin to solve all your GitLab
related continuous integrations.

Our aim is also to separate the API from GitLab Plugin and create a new API
plugin like GitHub API plugin. Now the question is, if we do it, will it
break GitLab plugin's existing support? This area needs a little time for
research and discussion. I'll come up with a more concrete proposal
containing the possible tradeoffs. I'm working on it currently.

Other areas of improvement for GitLab plugin is implementation of new SCM
API filters (or traits) rather than having filters inside GitLab plugin.
This way other plugins can take the advantage of extending the Gitlab
plugin and create their custom filters using the same SCM API.

Btw this idea is one of the GSoC ideas.

You can find the Mentor's proposal here-
https://jenkins.io/projects/gsoc/2019/project-ideas/gitlab-support-for-multibranch-pipeline

The progress of my detailed proposal can be found here-
https://docs.google.com/document/d/1YpuCC129U8KPXAwiXRXQ_4XWuLursPGl3rzQjz43-CY/edit?usp=sharing

Please feel free to drop your comments and suggestions in the Google doc.

Thanks.

Regards,
Parichay (baymac)

On Thu 4 Apr, 2019, 12:03 Owen B. Mehegan  I maintain the GitLab plugin, but unfortunately in the last few months I
> have had no time to dedicate to it. I have been hoping that a capable and
> motivated person would offer to take over maintaining it, but so far that
> has not happened. I have also lobbied CloudBees a little bit to invest some
> resources in this specific feature area, but although they have been
> positive about the idea, nothing has been committed. So I'm glad to hear
> that you're interested in at least working on this feature area, it is one
> I have wanted to see added for a long time.
>
> You say that "basically multibranch pipeline support is non-existent," but
> IMO this is a bit of an exaggeration. The existing multibranch support is
> admittedly imperfect because all it does is trigger branch indexing and let
> Jenkins figure out which branches have changes and should be built. This is
> not ideal because branch indexing is a somewhat expensive operation, and
> also as you point out none of the environment variables sent by the webhook
> are accessible in the job. Having said that, this support has been in the
> plugin for a few years now and people are definitely using it.
>
> In my opinion, the path to improving this support is to implement Branch
> Source support for GitLab. In addition to making Multibranch jobs work
> better, this would also let Jenkins support the same "org folder"
> functionality that can already be done with GitHub and Bitbucket. There was
> someone working on this, but the work has stalled and the person has gone
> silent. The original plan was that we were going to build this
> functionality into the existing GitLab plugin, but in recent conversations
> I have had with other folks, I have come to the conclusion that that would
> be a bad design, one that goes against the established paradigm of the
> GitHub and Bitbucket integrations. Both of those have separate trigger,
> API, and branch source plugins (github, github-api, github-branch-source).
> https://github.com/jenkinsci/gitlab-plugin/issues/499 discusses this
> whole proposal, and has links to the incomplete gitlab-branch-source plugin
> code. I've just seen your comments there (sorry again that I have been
> unavailable recently), so I'm happy to continue the conversation in that
> forum. I just wanted to share more widely what the state of the plugin and
> past proposals for this feature work are.
>
> Thanks again for you

Re: Creating a new Gitlab SCM Plugin with Multibranch Pipeline support

2019-04-01 Thread Parichay Barpanda
Hi Rick,

I was waiting for your comment on this. My main motive was to make this
decision on what I have described is whether to develop a new plugin or
improvise the existing one. I'm a bit confused if we intend to take out the
API from the GitLab plugin will it be able to support the existing
applications. I think I need to explore a little more and come up with a
clearer idea to discuss with community.

My proposal is developing in a Google doc like the rest of the community.
Working on for some changes then I will be drop it in the GSoC mailing
list. Hopefully today.

Regards,
Parichay (baymac)


On Tue 2 Apr, 2019, 07:03 Rick  Hi,
>
> As said at the title. I think that the freestyle job is not in this scope.
>
> Second, we need a multi-branch API plugin, according to the project
> proposal
> https://docs.google.com/document/d/1Gqz4LyU5sw6I50OdAVsQSW_WPNDlvXg4Ic9NdcYj4Ts/edit#heading=h.pr5cab6hhyg
> .
>
> Good to see your proposal here. But we have another mail list to a
> discussion about GSoC.
> https://groups.google.com/forum/#!forum/jenkinsci-gsoc-all-public
> And I saw many proposals there from other students.
>
> If you can write your proposal in a Goole Doucment that would be easy to
> comment and discuss.
>
> Best regards,
> Rick
>
>
> On Mon, Apr 1, 2019 at 11:58 PM Parichay Barpanda <
> parichay.barpa...@gmail.com> wrote:
>
>> Hi Matt,
>>
>> Yeah I lately realised freestyle jobs are important as of now. Moreover
>> in the Gitlab plugin freestyle jobs will be of a concern as much as support
>> of pipeline job. I think I'll explore the 2nd option more and figure out if
>> the API can be driven out of the existing GitLab plugin without breaking
>> anything.
>>
>> Thanks.
>>
>>
>> On Mon 1 Apr, 2019, 21:20 Matt Sicker >
>>> I've been under the impression that freestyle jobs don't really intend
>>> to go anywhere anytime soon. A lot of pipeline functionality is driven
>>> by the same plugin code that freestyle jobs utilize.
>>>
>>> On Mon, Apr 1, 2019 at 1:45 AM Parichay Barpanda
>>>  wrote:
>>> >
>>> > Hi all,
>>> >
>>> > I am preparing a proposal to add Multibranch Pipeline support to the
>>> Gitlab plugin. Existing Gitlab plugin does not support Multibranch pipeline
>>> builds in a way that it enables build triggers but cannot configure the
>>> variables (basically multibranch pipeline support is non-existent) - the
>>> API doesn't support it. But there are a lot of existing users that use the
>>> GitLab plugin at the moment and I fear API changes might break binary
>>> compatibility.
>>> >
>>> > My suggestions is to develop 2 new plugins: a Gitlab API plugin and a
>>> Gitlab SCM Plugin.
>>> >
>>> > 1) Gitlab API plugin which, very similar to Github API plugin, wraps
>>> the Gitlab Java API.
>>> >
>>> > 2) Gitlab SCM plugin which will be a major design overhaul version of
>>> existing Gitlab Plugin to accomodate both pipeline and mulitbranch pipeline
>>> jobs along with other type of job configurations.
>>> >
>>> > I have 2 ways to implement this:
>>> >
>>> > Method 1:
>>> > 1) I am thinking freestyle jobs will be deprecated in the future in
>>> favor of pipeline jobs. Gitlab plugin supports freestyle builds, so as long
>>> as freestyle builds are favoured the existing Gitlab plugin will support it.
>>> > 2) Focusing on just pipeline will ease the task of designing API and
>>> handling the complexity due to which all the SCM plugins are divided into
>>> two i.e.  plugin and -branch-source plugin.
>>> >
>>> > Method 2:
>>> > 1) If freestyle jobs are important and cannot be compromised then
>>> modify the Gitlab plugin to add multibranch pipeline support and find a way
>>> to take out Gitlab API and wrap it in a separate plugin. I haven't been
>>> able to figure out how much security risks and backwards compatibility will
>>> be involved in this method. Need someone with experience tell me about this.
>>> >
>>> > Main Objective of this proposal: Just have one SCM plugin which does
>>> all type of jobs and remove users' confusion of having 2 separate SCM
>>> plugins and code duplication.
>>> >
>>> > Need your feedbacks so that I can finalise which method to carry
>>> forward and start working on this proposal.
>>> >
>>> > Thanks.
>>> >
>>> > Regards,
>>> > Parichay (baymac)

Re: Creating a new Gitlab SCM Plugin with Multibranch Pipeline support

2019-04-01 Thread Parichay Barpanda
Hi Matt,

Yeah I lately realised freestyle jobs are important as of now. Moreover in
the Gitlab plugin freestyle jobs will be of a concern as much as support of
pipeline job. I think I'll explore the 2nd option more and figure out if
the API can be driven out of the existing GitLab plugin without breaking
anything.

Thanks.


On Mon 1 Apr, 2019, 21:20 Matt Sicker  I've been under the impression that freestyle jobs don't really intend
> to go anywhere anytime soon. A lot of pipeline functionality is driven
> by the same plugin code that freestyle jobs utilize.
>
> On Mon, Apr 1, 2019 at 1:45 AM Parichay Barpanda
>  wrote:
> >
> > Hi all,
> >
> > I am preparing a proposal to add Multibranch Pipeline support to the
> Gitlab plugin. Existing Gitlab plugin does not support Multibranch pipeline
> builds in a way that it enables build triggers but cannot configure the
> variables (basically multibranch pipeline support is non-existent) - the
> API doesn't support it. But there are a lot of existing users that use the
> GitLab plugin at the moment and I fear API changes might break binary
> compatibility.
> >
> > My suggestions is to develop 2 new plugins: a Gitlab API plugin and a
> Gitlab SCM Plugin.
> >
> > 1) Gitlab API plugin which, very similar to Github API plugin, wraps the
> Gitlab Java API.
> >
> > 2) Gitlab SCM plugin which will be a major design overhaul version of
> existing Gitlab Plugin to accomodate both pipeline and mulitbranch pipeline
> jobs along with other type of job configurations.
> >
> > I have 2 ways to implement this:
> >
> > Method 1:
> > 1) I am thinking freestyle jobs will be deprecated in the future in
> favor of pipeline jobs. Gitlab plugin supports freestyle builds, so as long
> as freestyle builds are favoured the existing Gitlab plugin will support it.
> > 2) Focusing on just pipeline will ease the task of designing API and
> handling the complexity due to which all the SCM plugins are divided into
> two i.e.  plugin and -branch-source plugin.
> >
> > Method 2:
> > 1) If freestyle jobs are important and cannot be compromised then modify
> the Gitlab plugin to add multibranch pipeline support and find a way to
> take out Gitlab API and wrap it in a separate plugin. I haven't been able
> to figure out how much security risks and backwards compatibility will be
> involved in this method. Need someone with experience tell me about this.
> >
> > Main Objective of this proposal: Just have one SCM plugin which does all
> type of jobs and remove users' confusion of having 2 separate SCM plugins
> and code duplication.
> >
> > Need your feedbacks so that I can finalise which method to carry forward
> and start working on this proposal.
> >
> > 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-dev+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/a872ab3c-d180-4275-81ed-35418805bae2%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Matt Sicker
> Senior Software Engineer, Jenkins Security, CloudBees
>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAEot4ozOu5T7RpgO60fKhTkdur1HTRWQ7GEsqEqS9t-Y1EVe9Q%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAPqBEkn-EVwfuS7C-1U8dT7sZCLnx6pD5C6e-V%3DCYB7Tg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Creating a new Gitlab SCM Plugin with Multibranch Pipeline support

2019-04-01 Thread Parichay Barpanda
Hi all,

I am preparing a proposal to add Multibranch Pipeline support to the Gitlab 
plugin. Existing Gitlab plugin does not support Multibranch pipeline builds 
in a way that it enables build triggers but cannot configure the variables 
(basically multibranch pipeline support is non-existent) - the API doesn't 
support it. But there are a lot of existing users that use the GitLab 
plugin at the moment and I fear API changes might break binary 
compatibility. 

My suggestions is to develop 2 new plugins: a *Gitlab API plugin* and a *Gitlab 
SCM Plugin*. 

1) *Gitlab API plugin *which, very similar to Github API plugin, wraps the 
Gitlab Java API.

2) *Gitlab SCM plugin* which will be a major design overhaul version of 
existing Gitlab Plugin to accomodate both pipeline and mulitbranch pipeline 
jobs along with other type of job configurations.

I have 2 ways to implement this:

Method 1:
1) I am thinking freestyle jobs will be deprecated in the future in favor 
of pipeline jobs. Gitlab plugin supports freestyle builds, so as long as 
freestyle builds are favoured the existing Gitlab plugin will support it. 
2) Focusing on just pipeline will ease the task of designing API and 
handling the complexity due to which all the SCM plugins are divided into 
two i.e.  plugin and -branch-source plugin.

Method 2:
1) If freestyle jobs are important and cannot be compromised then modify 
the Gitlab plugin to add multibranch pipeline support and find a way to 
take out Gitlab API and wrap it in a separate plugin. I haven't been able 
to figure out how much security risks and backwards compatibility will be 
involved in this method. Need someone with experience tell me about this.

*Main Objective of this proposal*: Just have one SCM plugin which does all 
type of jobs and remove users' confusion of having 2 separate SCM plugins 
and code duplication.

Need your feedbacks so that I can finalise which method to carry forward 
and start working on this proposal.

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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/a872ab3c-d180-4275-81ed-35418805bae2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running shell commands with sudo in pipeline

2019-03-28 Thread Parichay Barpanda
Yes, I added the changes to the groups after logging in. Btw I am running a
Bitnami Jenkins cloud stack on Azure. I guess I had to restart the service
as suggested in this article
<https://docs.bitnami.com/general/apps/jenkins/administration/configure-slaves/>.
Now works for me. Yeah `id` is simpler. :)

On Fri 29 Mar, 2019, 05:51 Gavin Mogan  this really belongs on the user list.
>
> I would run `id` to see what your current shell's permissions are, I would
> guess your changes to your groups were added after you logged in.
>
> On Thu, Mar 28, 2019 at 3:56 PM Parichay Barpanda <
> parichay.barpa...@gmail.com> wrote:
>
>> Hi Jon,
>>
>> Add my user to the docker group worked for my local machine docker
>> instance. Now I am trying to run a Ubuntu VM in Azure but when I am still
>> facing the same error.
>>
>> Run the following command on my Ubuntu VM:
>>
>> $ cat /etc/group | grep docker
>> docker:x:999:baymac
>>
>> This shows the user has been added to the docker group still I receive
>> the same error:
>>
>> + docker pull blang/latex:ubuntu
>> Got permission denied while trying to connect to the Docker daemon socket
>> at unix:///var/run/docker.sock: Post 
>> http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/create?fromImage=blang%2Flatex=ubuntu:
>> dial unix /var/run/docker.sock: connect: permission denied
>> script returned exit code 1
>>
>> Some github users also facing similar issues when using Azure pipeline:
>> https://github.com/Microsoft/azure-pipelines-agent/issues/2056
>>
>> In case you have any idea, let me know. :)
>>
>> Regards,
>> Parichay (baymac)
>>
>> On Friday, March 22, 2019 at 11:29:41 AM UTC+5:30, Parichay Barpanda
>> wrote:
>>>
>>> Hi Jon,
>>>
>>> It worked for me! Thanks for the help. :)
>>>
>>> Regards,
>>> Parichay (baymac)
>>>
>>> On Friday, March 22, 2019 at 6:58:06 AM UTC+5:30, Jon Hermansen wrote:
>>>>
>>>> Parichay,
>>>>
>>>> It sounds like your user (or more specifically, the user the
>>>> Jenkinsfile runs as) does not belong to the docker group.
>>>>
>>>>
>>>> https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user
>>>>
>>>> The docker command acts as a client to the docker daemon, and by
>>>> default, they communicate using a special socket file,
>>>> /var/run/docker.sock -- which is owned by the docker group. To be able
>>>> to write to it, you can add your user(s) to the same group.
>>>>
>>>> On Thu, Mar 21, 2019 at 7:03 PM Parichay Barpanda
>>>>  wrote:
>>>> >
>>>> > Umm.. I'm trying to develop on a plugin(specifically Blue ocean
>>>> plugin). To do a dry run, I'm using the command mvn hpi:run. Now when
>>>> creating a pipleine with my repository containing the Jenkinsfile as
>>>> mentioned above, I'm unable to access the docker command inside the
>>>> pipeline script because docker is installed under the root user on my local
>>>> machine.
>>>> >
>>>> > To be more clear, on my local machine when I have to run a docker
>>>> command, I use a sudo prefix to run it. Like sudo docker run .. I want a
>>>> workaround for this problem.
>>>> >
>>>> > On Fri 22 Mar, 2019, 04:24 Baptiste Mathus >>> >>
>>>> >> I'm a bit lost: are you trying to use Jenkins, or develop a plugin?
>>>> >>
>>>> >> Can you please clarify your use case?
>>>> >>
>>>> >> Thanks
>>>> >>
>>>> >> Le jeu. 21 mars 2019 à 21:06, Parichay Barpanda <
>>>> parichay...@gmail.com> a écrit :
>>>> >>>
>>>> >>> In my case if I am not running the Jenkins in a docker but on my
>>>> local machine where I have docker installed under root user.
>>>> >>>
>>>> >>> So for creating the agent, docker command needs to run with sudo
>>>> priviledge but as you suggest I shouldn't give that priviledge to Jenkins
>>>> agent.
>>>> >>>
>>>> >>> Now I have 2 options:
>>>> >>>
>>>> >>> 1) Either run a Jenkins instance as a docker container
>>>> >>>
>>>> >>> 2) Or Install docker for my user in my local machine
>>>> >>

Re: Running shell commands with sudo in pipeline

2019-03-28 Thread Parichay Barpanda
Hi Jon,

Add my user to the docker group worked for my local machine docker 
instance. Now I am trying to run a Ubuntu VM in Azure but when I am still 
facing the same error. 

Run the following command on my Ubuntu VM:

$ cat /etc/group | grep docker
docker:x:999:baymac

This shows the user has been added to the docker group still I receive the 
same error:

+ docker pull blang/latex:ubuntu
Got permission denied while trying to connect to the Docker daemon socket 
at unix:///var/run/docker.sock: Post 
http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/create?fromImage=blang%2Flatex=ubuntu:
 
dial unix /var/run/docker.sock: connect: permission denied
script returned exit code 1

Some github users also facing similar issues when using Azure pipeline: 
https://github.com/Microsoft/azure-pipelines-agent/issues/2056

In case you have any idea, let me know. :)

Regards,
Parichay (baymac)

On Friday, March 22, 2019 at 11:29:41 AM UTC+5:30, Parichay Barpanda wrote:
>
> Hi Jon,
>
> It worked for me! Thanks for the help. :)
>
> Regards,
> Parichay (baymac)
>
> On Friday, March 22, 2019 at 6:58:06 AM UTC+5:30, Jon Hermansen wrote:
>>
>> Parichay, 
>>
>> It sounds like your user (or more specifically, the user the 
>> Jenkinsfile runs as) does not belong to the docker group. 
>>
>>
>> https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user
>>  
>>
>> The docker command acts as a client to the docker daemon, and by 
>> default, they communicate using a special socket file, 
>> /var/run/docker.sock -- which is owned by the docker group. To be able 
>> to write to it, you can add your user(s) to the same group. 
>>
>> On Thu, Mar 21, 2019 at 7:03 PM Parichay Barpanda 
>>  wrote: 
>> > 
>> > Umm.. I'm trying to develop on a plugin(specifically Blue ocean 
>> plugin). To do a dry run, I'm using the command mvn hpi:run. Now when 
>> creating a pipleine with my repository containing the Jenkinsfile as 
>> mentioned above, I'm unable to access the docker command inside the 
>> pipeline script because docker is installed under the root user on my local 
>> machine. 
>> > 
>> > To be more clear, on my local machine when I have to run a docker 
>> command, I use a sudo prefix to run it. Like sudo docker run .. I want a 
>> workaround for this problem. 
>> > 
>> > On Fri 22 Mar, 2019, 04:24 Baptiste Mathus > >> 
>> >> I'm a bit lost: are you trying to use Jenkins, or develop a plugin? 
>> >> 
>> >> Can you please clarify your use case? 
>> >> 
>> >> Thanks 
>> >> 
>> >> Le jeu. 21 mars 2019 à 21:06, Parichay Barpanda  
>> a écrit : 
>> >>> 
>> >>> In my case if I am not running the Jenkins in a docker but on my 
>> local machine where I have docker installed under root user. 
>> >>> 
>> >>> So for creating the agent, docker command needs to run with sudo 
>> priviledge but as you suggest I shouldn't give that priviledge to Jenkins 
>> agent. 
>> >>> 
>> >>> Now I have 2 options: 
>> >>> 
>> >>> 1) Either run a Jenkins instance as a docker container 
>> >>> 
>> >>> 2) Or Install docker for my user in my local machine 
>> >>> 
>> >>> If you think there is a better way then I would like to know. Thanks 
>> for the help, I would see next time that appropriate topics are posted in 
>> the appropriate group. 
>> >>> 
>> >>> On Friday, March 22, 2019 at 1:20:24 AM UTC+5:30, Mark Waite wrote: 
>> >>>> 
>> >>>> This is a good question for the users list rather than the 
>> developers list.  The developers list is generally used for topics related 
>> to the development of Jenkins and the plugins which run on Jenkins.  Your 
>> question is more about using Jenkins than developing something that will 
>> extend or enhance Jenkins. 
>> >>>> 
>> >>>> In general, you don't want to run a Jenkinsfile as root.  That's 
>> granting far more permission to the Jenkinsfile than should be granted and 
>> places the machine at risk of damage from innocent user mistakes.  It is 
>> less dangerous to allow the agent user to run docker than to allow the 
>> agent user to use sudo to become root. 
>> >>>> 
>> >>>> On Thu, Mar 21, 2019 at 1:45 PM Parichay Barpanda <
>> parichay...@gmail.com> wrote: 
>> >>>>> 
>> >>>>> I am running a plugin on my local machine with

Re: Unable to ssh into my Jenkins docker instance

2019-03-25 Thread Parichay Barpanda
I got a bit confused which mailing list to choose while posting this
thread. Now I understand the difference. Thank you for the clarification.

Regards,
Parichay (baymac)




On Mon, Mar 25, 2019 at 4:51 AM Mark Waite 
wrote:

> This is really a question for the Jenkins users list, not for the
> developers list.  The developers list is used for discussions related to
> developing capabilities for Jenkins, not for those using Jenkins to do
> their own development.
>
> In your specific case, the docker run command needs to have a command line
> argument that will allow ssh traffic through to the Jenkins port that is
> listening for ssh.  Just as it has a port 8080 command line argument, it
> needs another argument that will allow ssh traffic to reach Jenkins.
>
> Mark Waite
>
> On Sat, Mar 23, 2019 at 7:37 PM Parichay Barpanda <
> parichay.barpa...@gmail.com> wrote:
>
>> Hi all,
>>
>> I am trying to use Jenkins Remote CLI to configure my Jenkins server
>> remotely. I am running a jenkinsci/blueocean docker container.
>>
>> To enabled SSHD on my jenkins server:
>> 1) At http://localhost:8080/configureSecurity/ : Enabled SSHD Port ->
>> Random
>> 2) AT http://localhost:8080/user/baymac/configure: Added my Public key
>> of local machine
>>
>> Trying ssh from bash:
>> ssh -l baymac -p 46653 localhost who-am-i
>>
>> Error message:
>> ssh: connect to host localhost port 46653: Connection refused
>>
>> Trying to use Jenkins CLI client to ssh into Jenkins server with the
>> following command:
>>
>> java -jar jenkins-cli.jar -s http://localhost:8080 -i ~/.ssh/id_rsa -ssh
>> -user baymac who-am-i
>>
>> I receive an error message:
>> Enter passphrase for /home/parichay/.ssh/id_rsa:
>> Mar 24, 2019 6:38:56 AM
>> org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver
>> reloadHostConfigEntries
>> INFO: resolveEffectiveResolver(baymac@localhost:46653) loaded 1 entries
>> from /home/parichay/.ssh/config
>> org.apache.sshd.common.RuntimeSshException: Failed to get the session.
>> at
>> org.apache.sshd.client.future.DefaultConnectFuture.getSession(DefaultConnectFuture.java:59)
>> at hudson.cli.SSHCLI.sshConnection(SSHCLI.java:104)
>> at hudson.cli.CLI._main(CLI.java:608)
>> at hudson.cli.CLI.main(CLI.java:427)
>> Caused by: java.net.ConnectException: Connection refused
>> at sun.nio.ch.UnixAsynchronousSocketChannelImpl.checkConnect(Native
>> Method)
>> at
>> sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:252)
>> at
>> sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:198)
>> at
>> sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213)
>> at sun.nio.ch.EPollPort$EventHandlerTask.run(EPollPort.java:293)
>> at java.lang.Thread.run(Thread.java:748)
>>
>> I enter the right passphrase, since I tried to ssh into another device it
>> is working.
>>
>> Extra information:
>>
>> I run the docker with the following command:
>>
>> sudo docker run \
>>
>>   --rm \
>>
>>   -u root \
>>
>>   -p 8080:8080 \
>>
>>   -v jenkins-data:/var/jenkins_home \
>>
>>   -v /var/run/docker.sock:/var/run/docker.sock \
>>
>>   -v "$HOME":/home \
>>
>>   --name jenkins \
>>
>>   Jenkinsci/blueocean
>>
>> HTTP auth works:
>>
>> java -jar jenkins-cli.jar -s http://localhost:8080/ -auth baymac: 
>> who-am-i
>>
>>
>> Message:
>>
>> Authenticated as: baymac
>> Authorities:
>>   authenticated
>>
>>
>> I am unable to debug this, a pointer to this error would be really
>> helpful.
>>
>> 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-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/53f15502-cf94-4a51-9202-7f0080e45c05%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/53f15502-cf94-4a51-9202-7f0080e45c05%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Thanks!
> Mark Waite
>
> --
> You received this message because you are subscribed to 

Unable to ssh into my Jenkins docker instance

2019-03-23 Thread Parichay Barpanda
Hi all,

I am trying to use Jenkins Remote CLI to configure my Jenkins server 
remotely. I am running a jenkinsci/blueocean docker container. 

To enabled SSHD on my jenkins server:
1) At http://localhost:8080/configureSecurity/ : Enabled SSHD Port -> Random
2) AT http://localhost:8080/user/baymac/configure: Added my Public key of 
local machine

Trying ssh from bash:
ssh -l baymac -p 46653 localhost who-am-i

Error message:
ssh: connect to host localhost port 46653: Connection refused

Trying to use Jenkins CLI client to ssh into Jenkins server with the 
following command:

java -jar jenkins-cli.jar -s http://localhost:8080 -i ~/.ssh/id_rsa -ssh 
-user baymac who-am-i

I receive an error message:
Enter passphrase for /home/parichay/.ssh/id_rsa:
Mar 24, 2019 6:38:56 AM 
org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver 
reloadHostConfigEntries
INFO: resolveEffectiveResolver(baymac@localhost:46653) loaded 1 entries 
from /home/parichay/.ssh/config
org.apache.sshd.common.RuntimeSshException: Failed to get the session.
at 
org.apache.sshd.client.future.DefaultConnectFuture.getSession(DefaultConnectFuture.java:59)
at hudson.cli.SSHCLI.sshConnection(SSHCLI.java:104)
at hudson.cli.CLI._main(CLI.java:608)
at hudson.cli.CLI.main(CLI.java:427)
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.UnixAsynchronousSocketChannelImpl.checkConnect(Native Method)
at 
sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:252)
at 
sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:198)
at 
sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213)
at sun.nio.ch.EPollPort$EventHandlerTask.run(EPollPort.java:293)
at java.lang.Thread.run(Thread.java:748)

I enter the right passphrase, since I tried to ssh into another device it 
is working.

Extra information:

I run the docker with the following command:

sudo docker run \ 

  --rm \ 

  -u root \ 

  -p 8080:8080 \ 

  -v jenkins-data:/var/jenkins_home \ 

  -v /var/run/docker.sock:/var/run/docker.sock \ 

  -v "$HOME":/home \ 

  --name jenkins \ 

  Jenkinsci/blueocean 

HTTP auth works:

java -jar jenkins-cli.jar -s http://localhost:8080/ -auth baymac: 
who-am-i


Message: 

Authenticated as: baymac
Authorities:
  authenticated


I am unable to debug this, a pointer to this error would be really helpful.

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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/53f15502-cf94-4a51-9202-7f0080e45c05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running shell commands with sudo in pipeline

2019-03-22 Thread Parichay Barpanda
Hi Jon,

It worked for me! Thanks for the help. :)

Regards,
Parichay (baymac)

On Friday, March 22, 2019 at 6:58:06 AM UTC+5:30, Jon Hermansen wrote:
>
> Parichay, 
>
> It sounds like your user (or more specifically, the user the 
> Jenkinsfile runs as) does not belong to the docker group. 
>
>
> https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user
>  
>
> The docker command acts as a client to the docker daemon, and by 
> default, they communicate using a special socket file, 
> /var/run/docker.sock -- which is owned by the docker group. To be able 
> to write to it, you can add your user(s) to the same group. 
>
> On Thu, Mar 21, 2019 at 7:03 PM Parichay Barpanda 
> > wrote: 
> > 
> > Umm.. I'm trying to develop on a plugin(specifically Blue ocean plugin). 
> To do a dry run, I'm using the command mvn hpi:run. Now when creating a 
> pipleine with my repository containing the Jenkinsfile as mentioned above, 
> I'm unable to access the docker command inside the pipeline script because 
> docker is installed under the root user on my local machine. 
> > 
> > To be more clear, on my local machine when I have to run a docker 
> command, I use a sudo prefix to run it. Like sudo docker run .. I want a 
> workaround for this problem. 
> > 
> > On Fri 22 Mar, 2019, 04:24 Baptiste Mathus   wrote: 
> >> 
> >> I'm a bit lost: are you trying to use Jenkins, or develop a plugin? 
> >> 
> >> Can you please clarify your use case? 
> >> 
> >> Thanks 
> >> 
> >> Le jeu. 21 mars 2019 à 21:06, Parichay Barpanda  > a écrit : 
> >>> 
> >>> In my case if I am not running the Jenkins in a docker but on my local 
> machine where I have docker installed under root user. 
> >>> 
> >>> So for creating the agent, docker command needs to run with sudo 
> priviledge but as you suggest I shouldn't give that priviledge to Jenkins 
> agent. 
> >>> 
> >>> Now I have 2 options: 
> >>> 
> >>> 1) Either run a Jenkins instance as a docker container 
> >>> 
> >>> 2) Or Install docker for my user in my local machine 
> >>> 
> >>> If you think there is a better way then I would like to know. Thanks 
> for the help, I would see next time that appropriate topics are posted in 
> the appropriate group. 
> >>> 
> >>> On Friday, March 22, 2019 at 1:20:24 AM UTC+5:30, Mark Waite wrote: 
> >>>> 
> >>>> This is a good question for the users list rather than the developers 
> list.  The developers list is generally used for topics related to the 
> development of Jenkins and the plugins which run on Jenkins.  Your question 
> is more about using Jenkins than developing something that will extend or 
> enhance Jenkins. 
> >>>> 
> >>>> In general, you don't want to run a Jenkinsfile as root.  That's 
> granting far more permission to the Jenkinsfile than should be granted and 
> places the machine at risk of damage from innocent user mistakes.  It is 
> less dangerous to allow the agent user to run docker than to allow the 
> agent user to use sudo to become root. 
> >>>> 
> >>>> On Thu, Mar 21, 2019 at 1:45 PM Parichay Barpanda <
> parichay...@gmail.com> wrote: 
> >>>>> 
> >>>>> I am running a plugin on my local machine with this command: 
> >>>>> 
> >>>>> mvn hpi:run 
> >>>>> 
> >>>>> My repository contains a Jenkinsfile which runs a docker image to 
> build a latex document. 
> >>>>> 
> >>>>> Jenkinsfile looks like: 
> >>>>> 
> >>>>> pipeline { 
> >>>>>agent none 
> >>>>>stages { 
> >>>>>   stage('Build') { 
> >>>>>  agent { 
> >>>>> docker { 
> >>>>>image 'blang/latex:ubuntu' 
> >>>>> } 
> >>>>>  } 
> >>>>>  steps { 
> >>>>>  sh 'xelatex sample.tex' 
> >>>>>  } 
> >>>>>   } 
> >>>>>} 
> >>>>> } 
> >>>>> 
> >>>>> Since the Jenkins instance is running on my local machine and in my 
> local machine docker is installed for the root user only so I need a way to 
> execute the Jenkinsfile with sudo permission. 
> >>>>> 
> >>>>> I re

Re: Running shell commands with sudo in pipeline

2019-03-21 Thread Parichay Barpanda
Umm.. I'm trying to develop on a plugin(specifically Blue ocean plugin). To
do a dry run, I'm using the command mvn hpi:run. Now when creating a
pipleine with my repository containing the Jenkinsfile as mentioned above,
I'm unable to access the docker command inside the pipeline script because
docker is installed under the root user on my local machine.

To be more clear, on my local machine when I have to run a docker command,
I use a sudo prefix to run it. Like sudo docker run .. I want a workaround
for this problem.

On Fri 22 Mar, 2019, 04:24 Baptiste Mathus  I'm a bit lost: are you trying to use Jenkins, or develop a plugin?
>
> Can you please clarify your use case?
>
> Thanks
>
> Le jeu. 21 mars 2019 à 21:06, Parichay Barpanda <
> parichay.barpa...@gmail.com> a écrit :
>
>> In my case if I am not running the Jenkins in a docker but on my local
>> machine where I have docker installed under root user.
>>
>> So for creating the agent, docker command needs to run with sudo
>> priviledge but as you suggest I shouldn't give that priviledge to Jenkins
>> agent.
>>
>> Now I have 2 options:
>>
>> 1) Either run a Jenkins instance as a docker container
>>
>> 2) Or Install docker for my user in my local machine
>>
>> If you think there is a better way then I would like to know. Thanks for
>> the help, I would see next time that appropriate topics are posted in the
>> appropriate group.
>>
>> On Friday, March 22, 2019 at 1:20:24 AM UTC+5:30, Mark Waite wrote:
>>>
>>> This is a good question for the users list rather than the developers
>>> list.  The developers list is generally used for topics related to the
>>> development of Jenkins and the plugins which run on Jenkins.  Your question
>>> is more about using Jenkins than developing something that will extend or
>>> enhance Jenkins.
>>>
>>> In general, you don't want to run a Jenkinsfile as root.  That's
>>> granting far more permission to the Jenkinsfile than should be granted and
>>> places the machine at risk of damage from innocent user mistakes.  It is
>>> less dangerous to allow the agent user to run docker than to allow the
>>> agent user to use sudo to become root.
>>>
>>> On Thu, Mar 21, 2019 at 1:45 PM Parichay Barpanda 
>>> wrote:
>>>
>>>> I am running a plugin on my local machine with this command:
>>>>
>>>> mvn hpi:run
>>>>
>>>> My repository contains a Jenkinsfile which runs a docker image to build
>>>> a latex document.
>>>>
>>>> Jenkinsfile looks like:
>>>>
>>>> pipeline {
>>>>agent none
>>>>stages {
>>>>   stage('Build') {
>>>>  agent {
>>>> docker {
>>>>image 'blang/latex:ubuntu'
>>>> }
>>>>  }
>>>>  steps {
>>>>  sh 'xelatex sample.tex'
>>>>  }
>>>>   }
>>>>}
>>>> }
>>>>
>>>> Since the Jenkins instance is running on my local machine and in my
>>>> local machine docker is installed for the root user only so I need a way to
>>>> execute the Jenkinsfile with sudo permission.
>>>>
>>>> I recieve an error like this:
>>>>
>>>> + docker pull blang/latex:ubuntu
>>>> Got permission denied while trying to connect to the Docker daemon
>>>> socket at unix:///var/run/docker.sock: Post 
>>>> http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/create?fromImage=blang%2Flatex=ubuntu:
>>>> dial unix /var/run/docker.sock: connect: permission denied
>>>> script returned exit code 1
>>>>
>>>> Can anyone suggest a way how I can run docker with root permission
>>>> inside the Jenkins pipeline?
>>>>
>>>> --
>>>> 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/b0106f8f-fa09-4dc7-98a3-f7bdff9f0d6f%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/jenkinsci-dev/b0106f8f-fa09-4dc7-98a3-f7bdff9f0d6f%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https:

Re: Running shell commands with sudo in pipeline

2019-03-21 Thread Parichay Barpanda
In my case if I am not running the Jenkins in a docker but on my local 
machine where I have docker installed under root user.

So for creating the agent, docker command needs to run with sudo priviledge 
but as you suggest I shouldn't give that priviledge to Jenkins agent.

Now I have 2 options:

1) Either run a Jenkins instance as a docker container

2) Or Install docker for my user in my local machine

If you think there is a better way then I would like to know. Thanks for 
the help, I would see next time that appropriate topics are posted in the 
appropriate group.

On Friday, March 22, 2019 at 1:20:24 AM UTC+5:30, Mark Waite wrote:
>
> This is a good question for the users list rather than the developers 
> list.  The developers list is generally used for topics related to the 
> development of Jenkins and the plugins which run on Jenkins.  Your question 
> is more about using Jenkins than developing something that will extend or 
> enhance Jenkins.
>
> In general, you don't want to run a Jenkinsfile as root.  That's granting 
> far more permission to the Jenkinsfile than should be granted and places 
> the machine at risk of damage from innocent user mistakes.  It is less 
> dangerous to allow the agent user to run docker than to allow the agent 
> user to use sudo to become root.
>
> On Thu, Mar 21, 2019 at 1:45 PM Parichay Barpanda  > wrote:
>
>> I am running a plugin on my local machine with this command:
>>
>> mvn hpi:run
>>
>> My repository contains a Jenkinsfile which runs a docker image to build a 
>> latex document.
>>
>> Jenkinsfile looks like:
>>
>> pipeline {
>>agent none
>>stages {
>>   stage('Build') {
>>  agent {
>> docker {
>>image 'blang/latex:ubuntu'
>> }
>>  }
>>  steps {
>>  sh 'xelatex sample.tex'
>>  }
>>   }
>>}
>> }
>>
>> Since the Jenkins instance is running on my local machine and in my local 
>> machine docker is installed for the root user only so I need a way to 
>> execute the Jenkinsfile with sudo permission.
>>
>> I recieve an error like this:
>>
>> + docker pull blang/latex:ubuntu
>> Got permission denied while trying to connect to the Docker daemon socket 
>> at unix:///var/run/docker.sock: Post 
>> http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/create?fromImage=blang%2Flatex=ubuntu:
>>  
>> dial unix /var/run/docker.sock: connect: permission denied
>> script returned exit code 1
>>
>> Can anyone suggest a way how I can run docker with root permission inside 
>> the Jenkins pipeline?
>>
>> -- 
>> 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/b0106f8f-fa09-4dc7-98a3-f7bdff9f0d6f%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/b0106f8f-fa09-4dc7-98a3-f7bdff9f0d6f%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Thanks!
> Mark Waite
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/ec67a488-f926-4e59-954c-6339d7cc59e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Running shell commands with sudo in pipeline

2019-03-21 Thread Parichay Barpanda
I am running a plugin on my local machine with this command:

mvn hpi:run

My repository contains a Jenkinsfile which runs a docker image to build a 
latex document.

Jenkinsfile looks like:

pipeline {
   agent none
   stages {
  stage('Build') {
 agent {
docker {
   image 'blang/latex:ubuntu'
}
 }
 steps {
 sh 'xelatex sample.tex'
 }
  }
   }
}

Since the Jenkins instance is running on my local machine and in my local 
machine docker is installed for the root user only so I need a way to 
execute the Jenkinsfile with sudo permission.

I recieve an error like this:

+ docker pull blang/latex:ubuntu
Got permission denied while trying to connect to the Docker daemon socket 
at unix:///var/run/docker.sock: Post 
http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/create?fromImage=blang%2Flatex=ubuntu:
 
dial unix /var/run/docker.sock: connect: permission denied
script returned exit code 1

Can anyone suggest a way how I can run docker with root permission inside 
the Jenkins pipeline?

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/b0106f8f-fa09-4dc7-98a3-f7bdff9f0d6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Difference between hpi and jpi plugins

2019-03-20 Thread Parichay Barpanda
When I place the generated hpi plugin into the plugins folder
(/var/jenkins_home/plugins) it isn't renamed after restart but it works
with my Jenkins instance. Thanks for the info. :)

On Thu 21 Mar, 2019, 05:17 Slide  The Gradle vs maven thing is wrong. Hpi is just a legacy extension, the
> files will be renamed to .jpi as you mentioned. There really is not a
> difference.
>
> On Wed, Mar 20, 2019, 15:09 Parichay Barpanda 
> wrote:
>
>> How are *.hpi and *.jpi plugins different?
>>
>> For example, when I install github-branch-source-plugin from my Jenkins
>> instance, it installs *.jpi plugin (that is what i find under
>> /var/jenkins_home/plugins). And when I clone the source code of the same
>> plugin and I run 'mvn install', I get a *.hpi plugin generated.
>>
>> A quick search a found 3 relevant points:
>>
>> One mailing list discussion says - "When you start up any Jenkins after
>> something like 1.5xx then it will automatically rename all .hpi files to
>> .jpi "
>>
>> Another says - "Jenkins core 1.449 won't allow installing hpi plugins
>> anymore"
>>
>> One stackoverflow answer says - "In terms of technology, the jpi plugins
>> are generated using the gradle plugin architecture and hpi plugins are
>> generated with the Maven architecture"
>>
>> Can someone shed some light on this? Which of the above theories is
>> acceptable?
>>
>> --
>> 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-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/f49e8614-70d8-4fa2-973a-20181d43c14d%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/f49e8614-70d8-4fa2-973a-20181d43c14d%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVcjo0UusXQ4v_143w1sp55ENhYwVszu-NznUuQu5S1nkQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVcjo0UusXQ4v_143w1sp55ENhYwVszu-NznUuQu5S1nkQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAD0DWAPv8DU5Y9HHAfhdmA9i44wT1jP_8SuTrQTRDa0Z4j%3Dxdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Difference between hpi and jpi plugins

2019-03-20 Thread Parichay Barpanda
How are *.hpi and *.jpi plugins different? 

For example, when I install github-branch-source-plugin from my Jenkins 
instance, it installs *.jpi plugin (that is what i find under 
/var/jenkins_home/plugins). And when I clone the source code of the same 
plugin and I run 'mvn install', I get a *.hpi plugin generated. 

A quick search a found 3 relevant points:

One mailing list discussion says - "When you start up any Jenkins after 
something like 1.5xx then it will automatically rename all .hpi files to 
.jpi " 

Another says - "Jenkins core 1.449 won't allow installing hpi plugins 
anymore"

One stackoverflow answer says - "In terms of technology, the jpi plugins 
are generated using the gradle plugin architecture and hpi plugins are 
generated with the Maven architecture"

Can someone shed some light on this? Which of the above theories is 
acceptable?

-- 
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/f49e8614-70d8-4fa2-973a-20181d43c14d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Blueocean generator for Blueocean plugin development

2019-03-19 Thread Parichay Barpanda
Hi Keith,

Thanks for the help. I needed this for one of my stretch goals for GSoC '19 
which is to implement an artifact that extends *GitLab* branch source 
plugin into Blue ocean. 
>
>
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-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/ae003cf8-3e23-4120-8e57-ab89a55cfe7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.