A system to validate plugin parameters in jenkins job builder

Bug #1125470 reported by Khai Do
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Core Infrastructure
Triaged
Wishlist
Unassigned

Bug Description

I noticed that parameters defined in yaml files are not validated before getting passed to jenkins job builder (builder.py). It would be nice to setup a system to validate that the parameters are somewhat correct before getting used by jenkins job builder.

For example if we look at this line in copyartifact in builder.py:

   XML.SubElement(t, 'projectName').text = data["project"]

There might be 4 validations that can be done..
1. check that data["project"] is not null
2. check that data["project"] is not an empty string
3. check that data["project"] is a string type
4. check that jenkins actually has a project that matches data["project"]

The first 3 is pretty generic for every piece of data so maybe setup something that would let users specify that the data["project"] must be a string type, is required, and must not be an empty string when that data is defined.

So something like...

     builders:
         - copyartifact:
              project<isString, isRequired, isNotEmpty>: foo
              filter: *.tar.gz
              target: /home/foo
              which-build: specific-build
              build-number: 123

Tags: jjb feature
Revision history for this message
James E. Blair (corvus) wrote :

This could use voluptuous as zuul does.

Changed in openstack-ci:
status: New → Triaged
importance: Undecided → Wishlist
Mathieu Gagné (mgagne)
tags: added: jjb
Khai Do (zaro0508)
Changed in openstack-ci:
assignee: nobody → Khai Do (zaro0508)
Khai Do (zaro0508)
Changed in openstack-ci:
assignee: Khai Do (zaro0508) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.