Is it possible to show all the submits from a Perforce depot without having to select a job? - jenkins

We are currently attempting to setup an instance of Jenkins as our build system for our code base. We have multiple jobs setup (all using the same depot) to build different sections of the code.
We would now like to show the submits from all users pertaining to this depot on the main Jenkins screen rather than being able to view the change lists involved with a certain build (e.g. by selecting a certain job and then the link leading to the build information, etc...). I've looked into possible plugins and the closest one I was able to find was the "All Changes Plugin". This is exactly what we would like, but this is only visible when viewing the details of a build (e.g. which CLs were used to create the build), but would it be possible to show this type of information on the main Jenkins page instead?
Thank you in advance for your help.

You could write an extension for the Dashboard View plugin to provide a portlet containing an aggregated list of changes from perforce, though if you aren't experienced with writing plugins then you might be better off using a separate repository browser such as Fisheye or P4Web to display your changes.

Related

Add condition to transition using script runner

I am using the scriptrunner plugin for Jira.
Is it possible to add a condition to a transition using scriptrunner?
Currently, my condition is in a script which I have manually added to the workflow.
But I was wondering if there is a way to do it automatically?
I was looking through documentation on: https://docs.atlassian.com/
I came across this method:
replaceConditionInTransition which is a method of WorkFlowManager.
But I'm unsure on how to use this.
Any help would be appreciated.
Conditions as any another scripts can be added from file system. You can store scripts in any VCS (bitbucket, github, gitlab, etc) and automatically deploy them to Jira server file system through any CI/CD system (teamcity, jenkins, bamboo, gitlab, etc).
So, as result process will be looks like. 1. commit changes in you script to vcs 2. wait a bit for auto deploy (e.g. triggered by commit) 3. done. As additional you can write any script/service/etc for commit these changes automatically if needed.
Also look at script roots it's helpful way which allows reuse any of script fragments through helpers classes.
It's rather conceptual answer basically because implementation is depends on environment, but I hope that you get at least one more point of view to solve this task.
I think that using the Java API to modify Jira workflows is pretty tough. You could dig around in the workflow editor to see how conditions are added there. Remember that you have to do this in a draft workflow and then publish it, which takes some time in large projects
I like the idea of replacing a script file as easier, if it can be done when no issues are transitioning

Customization of columns in jenkins form for specific JOB

Is there any way in Jenkins where I can view customized data for a specific project. Like in the screenshot we can see columns (Salves, Online slaves, offline slaves etc.) Screen shot Example
View> Edit View> Portlets in the right column > Slaves statistics
I want to customize these columns for my project requirements like Build numbers, Revision numbers, svn changes (for every individual revision), the user (who submit this build) and Status. I knew we can see these changes individually from localhost:8080/jenkins/job/Job_name/224/ but I want to see whole information in one single form. I am good in Powershell but Java is not my cup of tea. Please help.
I don't think there is a plugin available to add custom columns, will require creating a custom plugin yourself. A plugin to add some pre-defined extra columns is available https://wiki.jenkins.io/display/JENKINS/Extra+Columns+Plugin
Alternatively, we added custom key value pairs in every build using currentBuild.description as shown here to be able to view in a single screen artifact name and environment for each build

How to post jenkins job result in jira?

I am running jobs in Jenkins. I want to share the Jenkins job result in Jira. I have tried various plugins but failed to achieve my objective.
https://wiki.jenkins-ci.org/display/JENKINS/JIRA+Plugin
If you also want to use this feature, you need to supply a valid user id/password. If you need the comment only to be visible to a certain JIRA group, e.g. Software Development, enter the groupname.
Now you also need to configure jobs. I figured you might not always have write access to the JIRA (say you have a Jenkins build for one of the Apache commons project that you depend on), so that's why this is optional.

How to find out who changed the permission settings in Jenkins?

I am using Folder plugin and AD groups to control access to folder. This morning a team can't access their project anymore and later I found the AD group assignment in Assign Roles has been changed to wrong groups. Is there a way to find out which id did it? We only have a few admin ids.
Jenkins does not appear to keep an audit trail by default, as stated in this post on cloudbees.com, the folks that develop Jenkins.
The relevant lines:
Many Jenkins users look for a recommend a strategy for keeping an audit trail. This article is supposed to be a gap filler until more comprehensive compliance capabilities in JE/JOC are developed.
There are two open source plugins that enable you to track “WHO did WHAT?” in Jenkins:
...
The first plugin listed is Audit Trail Plugin which looks to provide exactly what you are seeking.
The description from the plugins page:
Keep a log of who performed particular Jenkins operations, such as configuring jobs.
This plugin adds an Audit Trail section in the main Jenkins configuration page. Here you can configure log location and settings (file size and number of rotating log files), and a URI pattern for requests to be logged. The default options select most actions with significant effect such as creating/configuring/deleting jobs and views or delete/save-forever/start a build. The log is written to disk as configured and recent entries can also be viewed in the Manage / System Log section.
I spent a few minutes looking through Jenkins various xml and log files, but could not find a log that contained something useful (username and/or timestamp). In this case it seems user auditing isn't built into Jenkins as of yet. Unfortunately it appears that you might not be able to determine who made those changes after the fact.

Need help getting artifact names out of Jenkins for email

I have three Jenkins projects (Maven jobs, to be exact) that have many available parameters. I've set up a way to automate running these weekly with a set of parameters using the Build Flow plugin so that I end up running a total of 12 builds. I also have a follow-up project that exists only to send an email containing some information about the builds that ran, including a link to all 12 of the artifacts.
My problem is figuring out a way to get the artifact names from all 12 jobs. I think the best way to do that is using the REST API, but I could use some help with that.
I am using the Editable Email Notification plugin, and I have access to the job name and build number. I probably just need a script to grab the artifact name from each job.
Does anyone have experience with this?
I haven't tried the exact case you want, but you should be able to use the depth and tree parameters of the REST API to narrow down the data you need. Start with the API URL for one of the builds, which will be of the form
http://jenkins/job/jobname/buildnumber/api/json

Resources