Need help with RPC URL

Description

We have recently installed the Jenkins plugin for JIRA to pull CIBuild info on the JIRA issue.

Background on Jenkins:

Jenkins home page: https://jenkins-green.clouddqt.capitalone.com/ (image 1)

The test job has been created in the folder, its 5 sub-folders in (image 2): https://sharedtechjenkins-green.clouddqt.capitalone.com/job/Non-PAR/job/Non-Prod-Jobs/job/DT_Tools_Pipeline/job/Synapse-Testing-jobs/

Jenkins home page -> Shared Tech -> NonPar -> NonProdJobs -> DT Tools Pipeline -> Synapse Testing jobs - > (job name: DeliveryServicingTest)

Integration

Results:

JIRA issue ID was placed in the description of the test job. This is so that the JIRA issue shows the build status when a new build was committed on that job.  

Issue: Although we got it to work the issue is that the RPC url being used for the passed scenario displays over 1000 jobs that are in all the folders/sub-folders. The issue here is that we have a very large organization and pulling all the jobs is not ideal because not all jobs are to be synced with JIRA issues. The best option we see is to integrate the specific sub-folder and using that RPC URL to only bring in jobs in that one folder. This works in terms of the Jenkins integration pulling the jobs but it fails to sync with JIRA issue. Basically we would like to use the RPC URL described in scenario 2 above to successfully show the CIbuilds in JIRA. 

Let me know if you have any other questions or need clarification. 

Environment

None

Attachments

10

Activity

Show:

Mark Rekveld August 30, 2017 at 7:40 PM

Hi Vinay,

The required permissions are documented here: Required Permissions

There is no explicit permissions check other then requesting the job list in the root of Jenkins, if there is any auth related error, then this should popup on Jenkins configuration page in JIRA and in the JIRA logs.

As for your auth scenario; all synchronization actions start from the root in Jenkins and work there way down through the job tree, but there is no way to hook into that process. So given your Synapse-Testing-jobs scenario, there is no way for the plugin currently to know of that job without first synchronizing its parents, Non-PAR, Non-Prod-Jobs, and DT_Tools_Pipeline.

I could give it some thought to see if there could be a way to add a job to a site from within JIRA, so that you can then add the Synapse-Testing-jobs job directly and not have to deal with its parents.

Cheers,
Mark

Vinay Vira August 30, 2017 at 2:55 PM

Hey Mark,

Thanks for the feedback. That sounds like a better alternative. I did follow your instructions and it worked. Although its not the best option, because it takes time to enable each sub-folder then refresh the screen for each level but better than having all jobs enabled.

I have one more question, when we do the integration using the root URL is there any kind of permission that is being checked on? Does performing the integration validate any permission of the user that is authenticating the integration or just need to be a user and have access to Jenkins? 

Also an example based on the scenario, would it be possible that I as a user have been given access to one of the sub-folders (Synapse-Testing-jobs) and that's the only folder I have access to create new jobs/commit builds etc. Now when I do the integration in JIRA it would only integrate folders where I have access and not where I don't have access? This way we can use the permissions to integrate specific folders. Lastly, if you can just give me some overview of how permissions are managed or specified, because I had access to view all jobs but I couldn't actually create a new job or builds until I was granted access to the Synapse-Testing-jobs folder. 

Thanks
Vinay

 

Mark Rekveld August 30, 2017 at 9:17 AM

If I understand your question correctly you would like to limit the number of jobs in Jenkins that are synchronized to JIRA.

This is possible, but not using a RPC URL that doesn't point to the root of Jenkins. The plugin needs the absolute root URL of Jenkins so it can assert if Crumbs are used or if the Jenkins plugin provided by this project is installed.

If you want to limit the jobs to only include the jobs os a specific Folder Job then take the following steps:

  1. Add the Jenkins site using the root URL as RPC URL, but leave "Auto enable new Jobs" unchecked.

  2. Once the job list of the Jenkins instance is synchronized, enable the folder jobs you want to include, after enabling a Folder Job allow for the job to be synchronized, after which you can select a sub folder job.

  3. Enable the jobs of the Folder Job you are interested in.

This will enable only the jobs you enabled, a downside is that any new job will need to be manually enabled before it's builds will be synchronized. New jobs that are added to enabled Folder Jobs will be added to the list on the "Jenkins configuration" page, but will not be enabled.

There is a workaround for this, and that is to enable "Auto enable new Jobs" for the Jenkins site once you have completed the previous steps. This will automatically enable any new job that is added under the Jenkins root, or under any enabled Folder Job.

Taking you scenario 2 as example this would mean taking the following steps:

  1. Add a new Jenkins  site with RPC URL https://sharedtechjenkins-green.clouddqt.capitalone.com/ and allow for the Job list to be synchronized.

  2. Enable the Non-PAR job and allow for the sub jobs to be synchronized.

  3. Enable the Non-Prod-Jobs job and allow for the sub jobs to be synchronized.

  4. Enable the DT_Tools_Pipeline job and allow for the sub jobs to be synchronized.

  5. Enable the Synapse-Testing-jobs job and allow for the sub jobs to be synchronized.

  6. Enable any jobs you want to be included.

  7. Optionally, enable "Auto enable new Jobs" to automatically enable new jobs, if you do this before step 5, then all sub jobs of Synapse-Testing-jobs will be enabled once it gets enabled and is synchronized.

Step 8 does have the downside that any new job in the root of Jenkins will also be enabled, and this will also enable any jobs it contains. I have created to limit this behaviour.

Hope this helps.

Cheers,
Mark Rekveld

No Response
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Priority

Zoom

Open Zoom
Created August 29, 2017 at 8:59 PM
Updated April 14, 2023 at 7:18 PM
Resolved April 14, 2023 at 7:18 PM
Zoom