VVP Linter

Abstract

Creation of a VVP linter (as we have markdown/ansible/pylint:java ...linter) to ensure that the versioned heat templates are correctly formatted.

This linter could be used in any CI/CD system.

Rationale

VVP is useful to provide quick feedback to heat template providers. It is also interesting within CI/CD chains to guarantee that the heat templates respect VVP rules.

Introducing VVP linting would be helpful for the developer of heat template to get an immediate feedback on their changes through such linting operations.

Proposal

Based on the prototype realized by Orange, the goal will be to generate a alpine docker container that will automatically run the VVP scripts with the heat directory to be tested as input.

The linter will return 0 if VVP is OK and 1 if not.

The VVP traces will be displayed within the container console and html report could be retrieved if needed for further troubleshooting.

The linter will be synchronized with the ice validator code hosted in ONAP repository and tagged accordingly (a latest version for master and a tagged versions for Dublin and later releases)

The prototype can be found here: https://hub.docker.com/r/morganrol/onap-vvp-lint/

As mentioned in the documentation, you can test it using

docker run -v <the path of the directory with your heat template>:/heat_files morganrol/onap-vvp-lint

You can get the results in the console

docker logs <docker id>

and/or retrieve the outputs including a html report under /output

docker cp <docker id>:/output <target host directory>



if you want to test it on Beijing,

docker run -v <the path of the directory with your heat template>:/heat_files morganrol/onap-vvp-lint

This Linter is currently in use in https://gitlab.com/Orange-OpenSource/lfn/onap/onap-tests gitlab CI/CD but as it can easily be run on any CI/CD system



The proposal consists in hosting this linter directly in ONAP VVP/lint  repo and follow the docker creation procedure to provide an "official" linter.



Additionally, another prototype docker had been created specifically for ONAP (It was shared with integration project team): https://hub.docker.com/r/morganrol/xtesting-onap-vnfpkgcheck/.

It deals with VVP testing of all the heat templates found in ONAP https://git.onap.org/demo repository.

It is leveraging xtesting framework (also use to run tests on infrastructure) and consider the following templates (see https://github.com/Orange-OpenSource/xtesting-onap-vnfpkgcheck/blob/master/testcases.yaml):

  • fw

  • cpe

  • lb

  • lwcl

  • fbms

  • vg

  • onap

It is an extension of the linter docker applied to existing referenced heat templates hosted in ONAP demo repository.

References

Links to any addtional resources referenced in or related to this proposal.

Status

DRAFT

Submitter

Morgan Richomme

Contributors



Proposed Release

Dublin

JIRA Ticket(s)

VVP-119: Create VVP linter for CI/CDClosed