New in 14.2: PULSE: Create an file scanner example expert tutorial

0 Likes

Pulse has gone through some major functional enhancements in 14.2. In 14.1 it was only possible to trigger a Jenkins Build from a delivery. In 14.2 there is a whole range of experts that call various development tools that report on and help control the quality of deliveries made into the CM repository.

 

In 14.2, Pulse comes with a comprehensive array of plugins that can be used, these include:

Checkstyle: enforces coding standards.
Jenkins: a continuous integration server that you can use with Pulse to execute, and report on, builds of changesets as they are delivered.
Kiuwan: measures, analyzes, and verifies the quality of your code.
PMD: analyzes source code and finds common programming bugs.
SDA Deployment: imports and deploys a component using Serena Deployment Automation.
SDA Generic Process: runs a generic process in Serena Deployment Automation.
SonarQube: inspects the quality of your code.
Dependency Vulnerabilities: finds third party dependencies in your code that may have known security vulnerabilities.
There may be a specialised third party tool or in house tool that would also be beneficial to determining the health of a build.

 

File Scanner Expert

This article is a more comprehensive Groovy Script example that interrogates the changeset that makes up the delivery that the expert is being invoked on.

 

It can be used as a template for developing your own Expert.

 

What does the File Scanner plugin do

 


The plugin achieves the basic functions of a standard plugin using Groovy. In this case the plugin will:
- Determine a list of specific files in the changeset delivered
- For each file in the list, scan the file content for a given token
- If the token is detected an error is flagged by the expert.

 

The following ZIP File  is a quite complex, simpler examples can be found in the following blog posts:

Create a simple custom expert blog post

Create an extended custom expert blog post

Please note: The following resolution is specific to the 14.2 version of CM and this may well change for custom expert implementations in future versions of CM.

Implementation

The following five steps will achieve this goal:

Step 1: Create the plugin structure
Step 2: Create the expert directory
Step 3: Create the main.groovy file
Step 4: Create the plugin.json file
Step 5: Add the Custom1 Expert chain
Step 6: Deliver the file to the stream with the text ERROR in the comment
Step 7: Deliver the file to the stream without the successful comment  

Please refer to the attached ZIP file for more information

Labels:

New Release-Feature
Comment List
Related
Recommended