Permalink
Browse files

Support multiple triggers

Add the ability for Zuul to accept inputs from multiple trigger
sources simultaneously.

Pipelines are associated with exactly one trigger, which must now
be named in the configuration file.

Co-Authored-By: Monty Taylor <mordred@inaugust.com>

Change-Id: Ief2b31a7b8d85d30817f2747c1e2635f71ea24b9
  • Loading branch information...
James E. Blair
James E. Blair committed Jul 30, 2013
1 parent 3cd2503 commit 6c358e72ead5dc3b7f0fa271c60f219a701efb3c
View
@@ -11,13 +11,19 @@ Since 1.3.0:
QueueItem has the full context for why the change is being run
(including the pipeline, items ahead and behind, etc.). The Change
is still available via the "change" attribute on the QueueItem. The
second argument is now the Job that is about to be run, ande the
second argument is now the Job that is about to be run, and the
parameter dictionary is shifted to the third position.
* The ZUUL_SHORT_* parameters have been removed (the same
functionality may be achieved with a custom parameter function that
matches all jobs).
* Multiple triggers are now supported, in principle (though only
Gerrit is defined currently). Your layout.yaml file will need to
change to add the key "gerrit:" inside of the "triggers:" list to
specify a Gerrit trigger (and facilitate adding other kinds of
triggers later). See the sample layout.yaml.
* The default behavior is now to immediately dequeue changes that have
merge conflicts, even those not at the head of the queue. To enable
the old behavior (which would wait until the conflicting change was
View
@@ -67,6 +67,19 @@ List Failing Tests
.tox/py27/bin/activate
testr failing --list
Hanging Tests
-------------
The following will run each test in turn and print the name of the
test as it is run::
. .tox/py27/bin/activate
testr run --subunit | subunit2pyunit
You can compare the output of that to::
python -m testtools.run discover --list
Need More Info?
---------------
View
@@ -178,7 +178,8 @@ explanation of each of the parameters::
- name: check
manager: IndependentPipelineManager
trigger:
- event: patchset-created
gerrit:
- event: patchset-created
success:
verified: 1
failure:
@@ -253,51 +254,55 @@ explanation of each of the parameters::
DependentPipelineManager, see: :doc:`gating`.
**trigger**
This describes what Gerrit events should be placed in the pipeline.
Exactly one trigger source must be supplied for each pipeline.
Triggers are not exclusive -- matching events may be placed in
multiple pipelines, and they will behave independently in each of the
pipelines they match. Multiple triggers may be listed. Further
parameters describe the kind of events that match:
*event*
The event name from gerrit. Examples: ``patchset-created``,
``comment-added``, ``ref-updated``. This field is treated as a
regular expression.
*branch*
The branch associated with the event. Example: ``master``. This
field is treated as a regular expression, and multiple branches may
be listed.
*ref*
On ref-updated events, the branch parameter is not used, instead the
ref is provided. Currently Gerrit has the somewhat idiosyncratic
behavior of specifying bare refs for branch names (e.g., ``master``),
but full ref names for other kinds of refs (e.g., ``refs/tags/foo``).
Zuul matches what you put here exactly against what Gerrit
provides. This field is treated as a regular expression, and
multiple refs may be listed.
*approval*
This is only used for ``comment-added`` events. It only matches if
the event has a matching approval associated with it. Example:
``code-review: 2`` matches a ``+2`` vote on the code review category.
Multiple approvals may be listed.
*email_filter*
This is used for any event. It takes a regex applied on the performer
email, i.e Gerrit account email address. If you want to specify
several email filters, you must use a YAML list. Make sure to use non
greedy matchers and to escapes dots!
Example: ``email_filter: ^.*?@example\.org$``.
*comment_filter*
This is only used for ``comment-added`` events. It accepts a list of
regexes that are searched for in the comment string. If any of these
regexes matches a portion of the comment string the trigger is
matched. ``comment_filter: retrigger`` will match when comments
containing 'retrigger' somewhere in the comment text are added to a
change.
multiple pipelines, and they will behave independently in each of
the pipelines they match. You may select from the following:
**gerrit**
This describes what Gerrit events should be placed in the
pipeline. Multiple gerrit triggers may be listed. Further
parameters describe the kind of events that match:
*event*
The event name from gerrit. Examples: ``patchset-created``,
``comment-added``, ``ref-updated``. This field is treated as a
regular expression.
*branch*
The branch associated with the event. Example: ``master``. This
field is treated as a regular expression, and multiple branches may
be listed.
*ref*
On ref-updated events, the branch parameter is not used, instead the
ref is provided. Currently Gerrit has the somewhat idiosyncratic
behavior of specifying bare refs for branch names (e.g., ``master``),
but full ref names for other kinds of refs (e.g., ``refs/tags/foo``).
Zuul matches what you put here exactly against what Gerrit
provides. This field is treated as a regular expression, and
multiple refs may be listed.
*approval*
This is only used for ``comment-added`` events. It only matches if
the event has a matching approval associated with it. Example:
``code-review: 2`` matches a ``+2`` vote on the code review category.
Multiple approvals may be listed.
*email_filter*
This is used for any event. It takes a regex applied on the performer
email, i.e Gerrit account email address. If you want to specify
several email filters, you must use a YAML list. Make sure to use non
greedy matchers and to escapes dots!
Example: ``email_filter: ^.*?@example\.org$``.
*comment_filter*
This is only used for ``comment-added`` events. It accepts a list of
regexes that are searched for in the comment string. If any of these
regexes matches a portion of the comment string the trigger is
matched. ``comment_filter: retrigger`` will match when comments
containing 'retrigger' somewhere in the comment text are added to a
change.
**dequeue-on-new-patchset**
Normally, if a new patchset is uploaded to a change that is in a
View
@@ -2,7 +2,8 @@ pipelines:
- name: check
manager: IndependentPipelineManager
trigger:
- event: patchset-created
gerrit:
- event: patchset-created
success:
verified: 1
failure:
@@ -11,8 +12,9 @@ pipelines:
- name: tests
manager: IndependentPipelineManager
trigger:
- event: patchset-created
email_filter: ^.*@example.org$
gerrit:
- event: patchset-created
email_filter: ^.*@example.org$
success:
verified: 1
failure:
@@ -21,15 +23,17 @@ pipelines:
- name: post
manager: IndependentPipelineManager
trigger:
- event: ref-updated
ref: ^(?!refs/).*$
gerrit:
- event: ref-updated
ref: ^(?!refs/).*$
- name: gate
manager: DependentPipelineManager
trigger:
- event: comment-added
approval:
- approved: 1
gerrit:
- event: comment-added
approval:
- approved: 1
start:
verified: 0
success:
@@ -2,7 +2,8 @@ pipelines:
- name: check
manager: IndependentPipelineManager
trigger:
- event: patchset-created
gerrit:
- event: patchset-created
success:
verified: 1
failure:
@@ -11,16 +12,18 @@ pipelines:
- name: post
manager: IndependentPipelineManager
trigger:
- event: ref-updated
ref: ^(?!refs/).*$
gerrit:
- event: ref-updated
ref: ^(?!refs/).*$
- name: gate
manager: DependentPipelineManager
failure-message: Build failed. For information on how to proceed, see http://wiki.example.org/Test_Failures
trigger:
- event: comment-added
approval:
- approved: 1
gerrit:
- event: comment-added
approval:
- approved: 1
success:
verified: 2
submit: true
View
@@ -5,7 +5,8 @@ pipelines:
- name: check
manager: IndependentPipelineManager
trigger:
- event: patchset-created
gerrit:
- event: patchset-created
success:
verified: 1
failure:
@@ -14,16 +15,18 @@ pipelines:
- name: post
manager: IndependentPipelineManager
trigger:
- event: ref-updated
ref: ^(?!refs/).*$
gerrit:
- event: ref-updated
ref: ^(?!refs/).*$
- name: gate
manager: DependentPipelineManager
failure-message: Build failed. For information on how to proceed, see http://wiki.example.org/Test_Failures
trigger:
- event: comment-added
approval:
- approved: 1
gerrit:
- event: comment-added
approval:
- approved: 1
success:
verified: 2
submit: true
@@ -37,14 +40,16 @@ pipelines:
manager: IndependentPipelineManager
dequeue-on-new-patchset: false
trigger:
- event: comment-added
approval:
- approved: 1
gerrit:
- event: comment-added
approval:
- approved: 1
- name: dup1
manager: IndependentPipelineManager
trigger:
- event: change-restored
gerrit:
- event: change-restored
success:
verified: 1
failure:
@@ -53,7 +58,8 @@ pipelines:
- name: dup2
manager: IndependentPipelineManager
trigger:
- event: change-restored
gerrit:
- event: change-restored
success:
verified: 1
failure:
@@ -64,9 +70,10 @@ pipelines:
manager: DependentPipelineManager
failure-message: Build failed. For information on how to proceed, see http://wiki.example.org/Test_Failures
trigger:
- event: comment-added
approval:
- approved: 1
gerrit:
- event: comment-added
approval:
- approved: 1
success:
verified: 2
submit: true
@@ -2,7 +2,8 @@ pipelines:
- name: check
manager: IndependentPipelineManager
trigger:
- event: non-event
gerrit:
- event: non-event
projects:
- name: foo
@@ -2,8 +2,9 @@ pipelines:
- name: check
manager: IndependentPipelineManager
trigger:
- approval:
- approved: 1
gerrit:
- approval:
- approved: 1
projects:
- name: foo
@@ -2,8 +2,9 @@ pipelines:
- name: check
manager: IndependentPipelineManager
trigger:
- event: comment-added
approved: 1
gerrit:
- event: comment-added
approved: 1
projects:
- name: foo
@@ -4,7 +4,8 @@ pipelines:
- name: 'check'
manager: IndependentPipelineManager
trigger:
- event: patchset-created
gerrit:
- event: patchset-created
project-templates:
- name: template-generic
@@ -4,7 +4,8 @@ pipelines:
- name: 'check'
manager: IndependentPipelineManager
trigger:
- event: patchset-created
gerrit:
- event: patchset-created
project-templates:
- name: template-generic
@@ -5,7 +5,8 @@ pipelines:
- name: check
manager: IndependentPipelineManager
trigger:
- event: patchset-created
gerrit:
- event: patchset-created
success:
verified: 1
failure:
@@ -14,17 +15,19 @@ pipelines:
- name: post
manager: IndependentPipelineManager
trigger:
- event: ref-updated
ref: ^(?!refs/).*$
gerrit:
- event: ref-updated
ref: ^(?!refs/).*$
- name: gate
manager: DependentPipelineManager
success-message: Your change is awesome.
failure-message: Build failed. For information on how to proceed, see http://wiki.example.org/Test_Failures
trigger:
- event: comment-added
approval:
- approved: 1
gerrit:
- event: comment-added
approval:
- approved: 1
success:
verified: 2
code-review: 1
Oops, something went wrong.

0 comments on commit 6c358e7

Please sign in to comment.