[JIRA] (JENKINS-58000) Ownership definition

11 views
Skip to first unread message

pjanouse@redhat.com (JIRA)

unread,
Jun 13, 2019, 4:31:02 AM6/13/19
to jenkinsc...@googlegroups.com
Pavel Janoušek created an issue
 
Jenkins / Bug JENKINS-58000
Ownership definition
Issue Type: Bug Bug
Assignee: Daniel Spilker
Components: job-dsl-plugin
Created: 2019-06-13 08:30
Environment: ownership 0.12.1
configuration-as-code 1.20
job-dsl 1.74
core 2.164.2
Priority: Major Major
Reporter: Pavel Janoušek

Even the provided example doesn't work when as populate it through a SEED job via JCasC. I have a job declaration like:

job('test') {
    properties {
        ownership {
            primaryOwnerId('__my_id__')
        }
    }
}

but I see common message "Ownership is not configured for this Job. It can be configured using the "Manage Ownership" link on the left menu if you have appropriate permissions.", looking into config.xml:

<properties>
  <com.synopsys.arc.jenkins.plugins.ownership.jobs.JobOwnerJobProperty plugin="owne...@0.12.1"/>
</properties>

I'm able to manage ownership manually by myself, when I do this from UI (my_id is recognized by Jenkins itself, it comes from LDAP configuration if it's important, I'm logged-in) I see in config.xml:

<properties>
  <com.synopsys.arc.jenkins.plugins.ownership.jobs.JobOwnerJobProperty plugin="owne...@0.12.1">
    <ownership>
      <ownershipEnabled>true</ownershipEnabled>
      <primaryOwnerId>__my_id__</primaryOwnerId>
      <coownersIds class="sorted-set"/>
    </ownership>
  </com.synopsys.arc.jenkins.plugins.ownership.jobs.JobOwnerJobProperty>
</properties>

I've tried to enable an ownership mechanism like:

job(ITEM_PATH) {
    properties {
        ownership {
            ownershipEnabled(true)
            primaryOwnerId('__my_id__')
        }
    }
}

but it doesn't work as well due to ERROR: (script, line 13) No signature of method: javaposse.jobdsl.dsl.helpers.properties.OwnershipContext.ownershipEnabled() is applicable for argument types: (java.lang.Boolean) values: [true].

Just a wild guess - adding a missed method in helper groovy class can fix all of this?

  
Note: _my_id_ should be replaced by real one.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

pjanouse@redhat.com (JIRA)

unread,
Jun 13, 2019, 4:31:03 AM6/13/19
to jenkinsc...@googlegroups.com
Pavel Janoušek updated an issue
Change By: Pavel Janoušek
Even the provided [example|https://github.com/jenkinsci/job-dsl-plugin/blob/master/job-dsl-core/src/main/docs/examples/javaposse/jobdsl/dsl/helpers/properties/PropertiesContext/ownership.groovy] doesn't work when as I populate it through a SEED job via JCasC. I have a job declaration like:
{code:java}

job('test') {
    properties {
        ownership {
            primaryOwnerId('__my_id__')
        }
    }
}
{code}

but I see common message "Ownership is not configured for this Job. It can be configured using the "Manage Ownership" link on the left menu if you have appropriate permissions.", looking into config.xml:
{code:java}

<properties>
  <com.synopsys.arc.jenkins.plugins.ownership.jobs.JobOwnerJobProperty plugin="owne...@0.12.1"/>
</properties>
{code}

I'm able to manage ownership manually by myself, when I do this from UI (my_id is recognized by Jenkins itself, it comes from LDAP configuration if it's important, I'm logged-in) I see in config.xml:
{code:java}

<properties>
  <com.synopsys.arc.jenkins.plugins.ownership.jobs.JobOwnerJobProperty plugin="owne...@0.12.1">
    <ownership>
      <ownershipEnabled>true</ownershipEnabled>
      <primaryOwnerId>__my_id__</primaryOwnerId>
      <coownersIds class="sorted-set"/>
    </ownership>
  </com.synopsys.arc.jenkins.plugins.ownership.jobs.JobOwnerJobProperty>
</properties>
{code}

I've tried to enable an ownership mechanism like:
{code:java}

job(ITEM_PATH) {
    properties {
        ownership {
            ownershipEnabled(true)
            primaryOwnerId('__my_id__')
        }
    }
}
{code}

but it doesn't work as well due to {{ERROR: (script, line 13) No signature of method: javaposse.jobdsl.dsl.helpers.properties.OwnershipContext.ownershipEnabled() is applicable for argument types: (java.lang.Boolean) values: [true]}}.

Just a wild guess - adding a missed method in helper groovy class can fix all of this?

  
Note: __my_id__ should be replaced by real one.

mail@daniel-spilker.com (JIRA)

unread,
Jun 14, 2019, 3:59:05 AM6/14/19
to jenkinsc...@googlegroups.com
Daniel Spilker updated Bug JENKINS-58000
 

The problem is, that the ownership plugin removes the ownership directly after the job has been created. That's because the default ownership management policy is "Do not assign ownership".

If you change the policy to "Preserve job's ownership" it will work. But I do not know if that has any security implications or if it is possible to change the configuration through JCasC.

See:

Pinging Oleg Nenashev

Change By: Daniel Spilker
Status: Open Fixed but Unreleased
Resolution: Not A Defect

o.v.nenashev@gmail.com (JIRA)

unread,
Jun 14, 2019, 4:41:02 AM6/14/19
to jenkinsc...@googlegroups.com
Change By: Oleg Nenashev
Resolution: Not A Defect
Status: Fixed but Unreleased Reopened

o.v.nenashev@gmail.com (JIRA)

unread,
Jun 14, 2019, 4:41:03 AM6/14/19
to jenkinsc...@googlegroups.com
Oleg Nenashev assigned an issue to Oleg Nenashev
Change By: Oleg Nenashev
Assignee: Daniel Spilker Oleg Nenashev

o.v.nenashev@gmail.com (JIRA)

unread,
Jun 14, 2019, 4:41:04 AM6/14/19
to jenkinsc...@googlegroups.com
Oleg Nenashev updated an issue
Change By: Oleg Nenashev
Component/s: ownership-plugin
Component/s: job-dsl-plugin

o.v.nenashev@gmail.com (JIRA)

unread,
Jun 14, 2019, 4:44:03 AM6/14/19
to jenkinsc...@googlegroups.com
Oleg Nenashev commented on Bug JENKINS-58000
 
Re: Ownership definition

It looks like a valid use-case for JobDSL users. "Do not assing ownership" is not supposed to be "remove ownership". Not sure what is the root cause, but I will assign it to the ownership plugin for investigation

Reply all
Reply to author
Forward
0 new messages