Remove includes and parameter functions

We no longer are support parameter functions and includes for zuulv3.
However, we may reclaim includes in the future so we can support raw
inclusions, so everything does not have to be in one file.

Story: #2000784

Change-Id: I58608ae564a890bca19eef63d9ae73fa388adf39
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-11-07 16:37:00 -05:00
parent baca313dd5
commit f36a413b1b
5 changed files with 1 additions and 66 deletions

View File

@ -273,9 +273,7 @@ instead invoke:
build:FUNCTION_NAME:NODE_NAME
where **NODE_NAME** is the name or class of node on which the job
should be run. This can be specified by setting the ZUUL_NODE
parameter in a parameter-function (see :ref:`includes` section in
:ref:`zuulconf`).
should be run.
Zuul sends the ZUUL_* parameters described in `Zuul Parameters`_
encoded in JSON format as the argument included with the

View File

@ -261,26 +261,6 @@ and projects are defined, what tests should be run, and what actions
Zuul should perform. There are three sections: pipelines, jobs, and
projects.
.. _includes:
Includes
""""""""
Custom functions to be used in Zuul's configuration may be provided
using the ``includes`` directive. It accepts a list of files to
include, and currently supports one type of inclusion, a python file::
includes:
- python-file: local_functions.py
**python-file**
The path to a python file (either an absolute path or relative to the
directory name of :ref:`layout_config <layout_config>`). The
file will be loaded and objects that it defines will be placed in a
special environment which can be referenced in the Zuul configuration.
Currently only the parameter-function attribute of a Job uses this
feature.
Pipelines
"""""""""
@ -800,33 +780,6 @@ each job as it builds a list from the project specification.
**tags (optional)**
A list of arbitrary strings which will be associated with the job.
Can be used by the parameter-function to alter behavior based on
their presence on a job. If the job name is a regular expression,
tags will accumulate on jobs that match.
**parameter-function (optional)**
Specifies a function that should be applied to the parameters before
the job is launched. The function should be defined in a python file
included with the :ref:`includes` directive. The function
should have the following signature:
.. function:: parameters(item, job, parameters)
Manipulate the parameters passed to a job before a build is
launched. The ``parameters`` dictionary will already contain the
standard Zuul job parameters, and is expected to be modified
in-place.
:param item: the current queue item
:type item: zuul.model.QueueItem
:param job: the job about to be run
:type job: zuul.model.Job
:param parameters: parameters to be passed to the job
:type parameters: dict
If the parameter **ZUUL_NODE** is set by this function, then it will
be used to specify on what node (or class of node) the job should be
run.
**swift**
If :ref:`swift` is configured then each job can define a destination

View File

@ -13,7 +13,6 @@
# under the License.
import gear
import inspect
import json
import logging
import os
@ -284,16 +283,6 @@ class LaunchClient(object):
for key, value in swift_instructions.items():
params['_'.join(['SWIFT', name, key])] = value
if callable(job.parameter_function):
pargs = inspect.getargspec(job.parameter_function)
if len(pargs.args) == 2:
job.parameter_function(item, params)
else:
job.parameter_function(item, job, params)
self.log.debug("Custom parameter function used for job %s, "
"change: %s, params: %s" % (job, item.change,
params))
def launch(self, job, item, pipeline, dependent_items=[]):
uuid = str(uuid4().hex)
self.log.info(

View File

@ -50,9 +50,6 @@ class ConfigSchema(object):
class LayoutSchema(object):
include = {'python-file': str}
includes = [include]
manager = v.Any('IndependentPipelineManager',
'DependentPipelineManager')
@ -129,7 +126,6 @@ class LayoutSchema(object):
'voting': bool,
'mutex': str,
'tags': toList(str),
'parameter-function': str,
'branch': toList(str),
'files': toList(str),
'swift': toList(swift),

View File

@ -424,7 +424,6 @@ class Job(object):
branch_matcher=None,
file_matcher=None,
irrelevant_file_matcher=None, # skip-if
parameter_function=None, # TODOv3(jeblair): remove
tags=set(),
mutex=None,
)