Continuous Modernization - Static (CI/CD Pipeline)

When a code change is made to an application, that change could potentially have a negative impact on the performance of the Application. vFunction integrates with an App’s CI/CD pipeline, e.g., Bitbucket or Jenkins, in order to analyze the Application each time a code change is introduced to the pipeline. The analysis of the Application results in a new vFunction Base Assessment Report. This Base Assessment Report includes detailed information about the Application’s Frameworks, Technical Debt Metrics, Cost of Innovation, Refactoring Effort as well as overviews of Identified Services, Entry Points, Classes and Resource Exclusivity. This Report allows an organization to understand immediately how codes changes will impact the performance of the Application.

Configuring the Pipelines

Any CI/CD pipeline can be configured.

Below we details the steps for Bitbucket, GitLab and Jenkins

Prerequisites

  1. A Service Account for a vFunction Server.
  2. A code repository that can, over HTTP or HTTPS, access the vFunction Server.
  3. The ability to make configuration changes in Code Repository.

Steps to create a Service Account in vFunction Dashboard

  1. Log into the vFunction browser-based Dashboard, e.g. https://vfunction.acme.com
  2. Click on the vFunction icon in the upper-left corner of the browser
  3. Select My Account from the dropdown menu.
  4. Click the button to Generate Service Account.
  5. Copy the Service Account ID and Password into a location that can be referenced later.

Steps to create a vFunction Yaml with Application details

  1. Create a viper-conf.yaml file to be placed in the root of the repository (or in a designated location from which the vFunction Viper process will run).
  2. The yaml file will need to include archives and app.included_packages
archives:
  - resource-repo-app/build/libs/resource-repo-app-2.6-SNAPSHOT.jar
app:
  included_packages:
    - com.vfunction.
  1. Place the viper-conf.yaml within the Git repository and note the location for use in the next step.

Steps to add vFunction variables and scripts into Code Repositories

Bitbucket
  1. Log into Bitbucket.
  2. Navigate to the root of the repository to open the bitbucket-pipelines.yml.
  3. Create a custom Pipeline after the Application has been built (post-build).
  4. Add the vFunction variables VF_HOST, VF_APPNAME, VF_CONF, VF_USER, VF_PASSWORD to this pipeline. Add the vFunction script steps to this pipeline to download and run the vFunction Viper Agent
pipelines:
  custom:
    custom-name-and-region: vFunctionContinuousViper
      - variables:
          - VF_HOST: https://qa.vfunction.com
          - VF_APPNAME: "OMS Demo"
          - VF_CONF: /path/to/vfunction/yaml/file/viper-conf.yaml
          - VF_USER: "Service-Account-Id-created-in-vFunction-Dashboard"
          - VF_PASSWORD: "Service-Account-Password-created-in-vFunction-Dashboard"
    - steps:
        script:
          - curl -LO https://vfunction-tools.s3.amazonaws.com/vfunction-viper-cli.zip #download
          - jar -xvf vfunction-viper-cli.zip #unzip
          - bash viper-run-ci.sh #run
GitLab
  1. Log into GitLab.
  2. Navigate to the root of the repository to open the gitlab-ci.yml.
  3. Create a custom Job after the Application has been built (post-build).
  4. Add the vFunction variables VF_HOST, VF_APPNAME, VF_CONF, VF_USER, VF_PASSWORD to this pipeline. Add the vFunction script steps to this pipeline to download and run the vFunction Viper Agent
vf-continuous-viper:
  stage: test
  script:
    - export VF_HOST="https://vfunction.acme.com" && export VF_APPNAME="OMS Demo" && export VF_CONF="/path/to/vfunction/yaml/file/viper-conf.yaml" && export VF_USER="Service-Account-Id-created-in-vFunction-Dashboard" && export VF_PASSWORD="Service-Account-Password-created-in-vFunction-Dashboard"
    - curl -LO https://vfunction-tools.s3.amazonaws.com/vfunction-viper-cli.zip #download
    - jar -xvf vfunction-viper-cli.zip #unzip
    - bash viper-run-ci.sh #run
Jenkins
  1. Log into Jenkins
  2. Access the Jenkinsfile that declares the variables for the environment.
  3. Create a custom Pipeline after the Application has been built (post-build).
  4. Add the vFunction variables VF_HOST, VF_APPNAME, VF_CONF, VF_USER, VF_PASSWORD to this pipeline. Add the vFunction script to this pipeline to download and run the vFunction Viper Agent
pipeline {
    agent { label 'vfunctionContinuousViper'}
    parameters {
       string(name: 'VF_HOST', defaultValue: 'https://vfunction.acme.com')
       string(name: 'VF_APPNAME', defaultValue: 'OMS Demo')
       string(name: 'VF_CONF', defaultValue: '/path/to/vfunction/yaml/file/viper-conf.yaml')
       string(name: 'VF_USER', defaultValue: 'Service-Account-Id-created-in-vFunction-Dashboard')
       string(name: 'VF_PASSWORD', defaultValue: 'Service-Account-Password-created-in-vFunction-Dashboard')
    }
    stages {
        stage('vfContinuousViper') {
            steps {
                curl -LO https://vfunction-tools.s3.amazonaws.com/vfunction-viper-cli.zip #download
                jar -xvf vfunction-viper-cli.zip #unzip
                bash viper-run-ci.sh #run
            }
        }
    }
}

Configuring the Notificiations in the Assessment Report

To get notification you can configure the thresholds in the Aging Framework and History tabs of the Assessment Report (View Assessment Report action)

The history tab in the Assessment report provides a history of the technical tebt and app size values as changes are introduced to the application.