Each pipeline was maintaining the trigger cache only based on
its own current usage, which means that pipelines were clearing
the cache of changes currently being used by other pipelines.
This considers all changes in use in all pipelines when maintaining
the cache.
Change-Id: I3ab14c69acd80ecc613b63628c837511594744d0
Reviewed-on: https://review.openstack.org/36699
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
Allow, eg, jobs in a gate pipeline to take precedence over
a check pipeline.
Change-Id: Idf91527704cc75b00a336291f91b908286f8e630
Reviewed-on: https://review.openstack.org/36552
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
With the change to use QueueItem, the custom parameter function
has lost some context. Pass a QueueItem instead of a Change in
order to get it back.
Add the parameters to the build object so that they can be used
by URL pattern functions.
Add a NEWS.rst file that lists backwards incompatible changes (of
which this is one).
Change-Id: I526850fb55e25b4b84202820dc3c313d37cbe535
Reviewed-on: https://review.openstack.org/36304
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Change-Id: I9ac6e301d361b7bac8561a1f468c40be23e1ddcc
Reviewed-on: https://review.openstack.org/36281
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
The unittest/testtools library defines assert methods which behave
similarly to using assert calls. However, they print more descriptive
error messages when they are triggered, helpfully printing both what
they received and what they expected.
Also, hurrah for emacs keyboard macros.
Change-Id: Ifbc54d3ead41eafed66be2a5b021fd4407a80a37
Reviewed-on: https://review.openstack.org/35967
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Change-Id: Ic396c845e5f61a98d3b0e8c3fc08c6f9dbfffc6a
Reviewed-on: https://review.openstack.org/34437
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Change-Id: I02e20156af20cfc019262f39e343e3ec1ce06a85
Reviewed-on: https://review.openstack.org/35541
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Change-Id: Ifa3ff45189b794dfb2c29e127599dbe547b57f71
Reviewed-on: https://review.openstack.org/35354
Reviewed-by: Anita Kuno <anteaya@anteaya.info>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Change-Id: I69563ee47dd6f3777a52b67999ff1a03247f1e1e
Reviewed-on: https://review.openstack.org/35324
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Store the results of the configuration (pipelines, jobs, and all)
in a new Layout object. Return such an object from the parseConfig
method in the scheduler. This is a first step to reloading the
configuration on the fly -- it supports holding multiple
configurations in memory at once.
Change-Id: Ide56cddecbdbecdc4ed77b917d0b9bb24b1753d5
Reviewed-on: https://review.openstack.org/35323
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Make the scheduler idempotent. The idea is that after any event,
the scheduler should be able to run and examine the state of every
item in the queue and act accordingly. This is a change from the
current state where most events are dealt with in context. This
should ease maintenance as it should facilitate reasoning about
the different actions Zuul might take -- centralizing major
decisions into one function.
Also add a new class QueueItem, which represents a Change(ish)
in a queue. Currently, Change objects themselves are placed
in the queue, which is confusing information about a change (for
instance: it's number and patchset) as well as information about
the processing of that change in the queue (e.g., the build
history, current build set, merge status, etc.).
Change objects are now cached, which should reduce the number of
queries to Gerrit (except the current algorithm to update them is
very naive and queries Gerrit again on any event relating to a
change). Changes are expired from the cache when they are not
present or related to any change currently in a pipeline.
There are now two things that need to be asserted at the end of
each test, so use addCleanup in setUp to call a method that
performs those assertions after the test method completes. Also,
move the existing shutdown method to use addCleanup as well,
because testr experts say that's a best practice.
Change-Id: Id2bf4c484c9e681456c69d99787e7a5b3a247690
Reviewed-on: https://review.openstack.org/34653
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
And have the webapp listen on a configurable port to facilitate
parallel testing.
Start the webapp for every test to be consistent with production use.
Change-Id: I2f5c0d1669fac6db1604154ae9cd9d91fa073ba1
Reviewed-on: https://review.openstack.org/35553
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Otherwise they can prevent exiting on timeout which confuses testr.
Change-Id: I239ab46f44fd09fe6b69fb70fdf4043e3c1daa67
Reviewed-on: https://review.openstack.org/35321
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
* Correct passing env vars in testr.conf.
* Use ZUUL_TEST_ROOT correctly when building the tempdir for
the local git dir for tests.
* Remove some tabs from docs.
* Update test gearman server method override to match current gear.
* Make test_failed_changes more deterministic: this test
occasionally failed due to races in the test.
* Update the fake logger configuration to match previous usage.
Change-Id: I1850b930e37d9a0fd2e9c8098052cf7df60576af
Reviewed-on: https://review.openstack.org/35404
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Change-Id: I8f3ac5c469e9d530d1ac7776c7488d0c42cdf1ad
Reviewed-on: https://review.openstack.org/35329
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Needed to move some directory creation around to be contained within the
testcase, but with parallel testing, we shave 48 seconds off the run
time and go from around 60s to around 11. We're also now compatible with
future subunit-based fast-fail semantics when we grow them.
Change-Id: I6c7148c29d1edb5d9469a8c2afe4b31b2b340009
Reviewed-on: https://review.openstack.org/33352
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Change-Id: I0385ac9f8336a8c2e45b0fa6ed062b6b23a182aa
Reviewed-on: https://review.openstack.org/33351
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
Change-Id: I734f0f8237fb603ee41a39f06e63c007e79825a9
Reviewed-on: https://review.openstack.org/33350
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
And less than 0.4.0 for safety.
Change-Id: I539a2cc7816c15491db55975ac07ee7a148535dc
Reviewed-on: https://review.openstack.org/32973
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
If we get a WORK_FAIL or WORK_EXCEPTION with no preceding WORK_DATA
packet with a result, record the result as LOST.
This can happen if Jenkins encounters an exception while running
the job.
Change-Id: I159248e228af4e67ba6c88282346f366592e0d37
Reviewed-on: https://review.openstack.org/32814
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Change-Id: I14e489a98bbbf245ced2726d0bedc32accc7ca42
Reviewed-on: https://review.openstack.org/32665
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
This adds a javascript timestamp for each change in the JSON output.
Change-Id: I7965c6a7ff6e4e5522da3c51936cfdfb6cf36e91
Reviewed-on: https://review.openstack.org/32064
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
The internal data structure of the server queue changed.
Change-Id: I280a671577d2247b315174f543dfb2ff8b7d51f4
Reviewed-on: https://review.openstack.org/31997
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
If we're using the internal gearman server, wait for workers
to register their functions before proceeding with startup.
This is mostly to handle restarts where we may be immediately
ready to run jobs, but workers may not have registered functions
yet. In that case, we would immediately start declaring jobs
LOST. So give them a chance to show up first.
The gearman-plugin for jenkins currently tries to reconnect
every 3 seconds. We could probably even lower that to 1 or 2.
Change-Id: I173b16ba78cecac91acec26b4f2d55f38610e5a2
Reviewed-on: https://review.openstack.org/31735
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
* Use non-Jenkins terminology "manager" rather than "master".
* Use name+number as the identifier for both stopping builds and
descriptions.
* Expect 'url' parameter instead of 'full_url'.
Change-Id: I1fe9851556618fc6d6deb8906e3f2ee41725c3ad
Reviewed-on: https://review.openstack.org/31726
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Change-Id: Id4e6b77f5abba23f46236def28f54509c61fd247
Reviewed-on: https://review.openstack.org/30170
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Change-Id: I14dbe148f0ff57e5d0c50cc712120a2708f158b1
Reviewed-on: https://review.openstack.org/31727
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Khai Do <zaro0508@gmail.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
It dropped some "waitFor..." calls.
Also, update the unit tests to deal with some indeterminism in the
order jobs are run (showed up while testing this patch).
Change-Id: Id77838cc1bf0823ee0ee3795cb9190f405a1ff21
Reviewed-on: https://review.openstack.org/31109
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Change-Id: I147491d2c08fa1040f41f0c299113e3eb8968252
Reviewed-on: https://review.openstack.org/29158
Reviewed-by: Antoine Musso <hashar@free.fr>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
So that app.js can be less specific about where it's running.
Change-Id: I2a84a659b43027b7eb59ba707396517d8ba635d3
Reviewed-on: https://review.openstack.org/29286
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
On Debian, all binaries should have an associated manpage. While
building Zuul package we got the following lintian error:
W: zuul: binary-without-manpage usr/bin/zuul-server
This is easily fixed by making sphinx to name the man page zuul-server.
Change-Id: Ie9fa681654a8e7e8785c1dcfa5ec21ba27ae3049
Reviewed-on: https://review.openstack.org/29287
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
It is possible the host system does not have git properly configured,
which results in merge failures because the git client is complain. For
example:
GitCommandError: 'git merge FETCH_HEAD' returned exit status 128:
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
Now we can pass user.name and user.email settings to git, if configured
to do so.
Change-Id: I896194d8d1f5334026954b02f3a1a8dd82bed2ac
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-on: https://review.openstack.org/29015
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This reverts commit 031e23f723
and commit 9ba2068664.
This breaks the ability to have silent pipelines.
Instead, how about the following:
pipelines:
- name: postmerge
manager: IndependentPipelineManager
...
success:
force-message: true
That should work without any additional code.
Change-Id: I0d15b8fcb678a36c46205693ba9a6756ec6a076f
Reviewed-on: https://review.openstack.org/29180
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Antoine Musso <hashar@free.fr>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Remove the Jenkins launcher and add a new Gearman launcher (designed
to be compatible with Jenkins) in its place.
See the documentation for how to set up the Gearman Plugin for
Jenkins.
Change-Id: Ie7224396271d7375f4ea42eebb57f883bc291738
Change-Id: I3a7c6bdfae9f2273cf8059c322d648cda07d830d
Reviewed-on: https://review.openstack.org/28619
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
031e23f allowed the Gerrit trigger to report a message even when no
action has been given (for the context of postmerge builds where the
change cant be altered). I have noticed the Gerrit lib would stack
trace because it is missing an action (actually None). This patch skip
the action expansion in Gerrit command line whenever there is no action.
Related stacktrace:
INFO zuul.IndependentPipelineManager: Reporting
change <Change 0x7fb72099d190 62446,3>, action: None
DEBUG zuul.Gerrit: Report change <Change 0x7fb72099d190 62446,3>,
action None, message: Build succeeded.
ERROR zuul.IndependentPipelineManager: Exception while reporting:
Traceback (most recent call last):
File "zuul-5b84b5c-py2.7.egg/zuul/scheduler.py",
line 883, in reportChange
ret = self.sched.trigger.report(change, report, action)
File "zuul-5b84b5c-py2.7.egg/zuul/trigger/gerrit.py",
line 142, in report message, action)
File "zuul-5b84b5c-py2.7.egg/zuul/lib/gerrit.py",
line 119, in review
for k, v in action.items():
AttributeError: 'NoneType' object has no attribute 'items'
Change-Id: I51b66025eb6e1d074d79cf77ac4085ba3ffde77e
Reviewed-on: https://review.openstack.org/28395
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
From the pep8 spec:
The closing brace/bracket/parenthesis on multi-line constructs
may either line up under the last item of the list, as in:
...
or it may be lined up under the first character of the line that
starts the multi-line construct, as in:
...
Bizzarly, the pep8 tool ignores the first option.
Change-Id: Ic0e8f8ad964881276d213ffd50deb75a537c250b
Reviewed-on: https://review.openstack.org/28609
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
report times as 1h 22m 08s
only report hours if the job runs longer than an hour
only report minutes if the job runs longer than a minute
don't zero pad whatever the leading time unit is, making it a
little easier to scan and see differences.
Change-Id: Ibb58be233fdef1bbdf4e90a83731d43eb0be47f1
Reviewed-on: https://review.openstack.org/28143
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: matthew-wagoner <matthew.wagoner@hp.com>
Reviewed-by: Antoine Musso <hashar@free.fr>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
The ability to configure success and failure URL patterns (cf.
'success-pattern' and 'failure-pattern') obsoletes the need to
guess-by-fetching an appropriate link for the build status, which can be
extremely expensive. (Wikimedia's Zuul instance makes three HTTP requests per
invocation -- 'testReport', which 302s to 'testReport/', which 404s, and then
'consoleFull', which often runs to hundreds of kilobytes.)
Also corrects a small typo in README.rst.
Change-Id: Ib222f544c98253152a5e787ec0cdf28fa2d80cf6
Reviewed-on: https://review.openstack.org/28128
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Whenever a pipeline does not provide any action, the job message would
not be reported which is a bit annoying. This patch makes it so we skip
reporting when there is no action and no message.
My use case is:
A `postmerge` pipeline that simply react to the `change-merged` events,
since the change is closed, there is no point in voting on it. Jobs
then uses the `success-message` and `failure-message` to finely tune
what is reported back to the user.
Configuration exemple
pipelines:
- name: postmerge
manager: IndependentPipelineManager
trigger:
- event: change-merged
projects:
- name: operations/config
postmerge:
- operations-config-deploy
jobs:
- name: operations-config-deploy
branch: ^production$
success-message: 'Your configuration has been deployed by Jenkins.'
failure-message: 'Configuration NOT APPLIED. You broke wikipedia.'
Before this patch, the debug would be:
------------8<---------------8<---------------8<-----------------------
INFO zuul.IndependentPipelineManager: Reporting
change <Change 0x7f67a0d61f50 61980,1>, action: None
DEBUG zuul.Gerrit: Report change <Change
0x7f67a0d61f50 61980,1>, action None, message: Build succeeded.
- https://jenkins-url-goes-there.example.com/
: Your configuration has been deployed by Jenkins.
DEBUG zuul.Gerrit: No action specified; not reporting
DEBUG zuul.IndependentPipelineManager: Removing reported
------------8<---------------8<---------------8<-----------------------
Change-Id: I9ab4d47a8cfc1ae66870e8ac55e8f78dfc29da3d
Reviewed-on: https://review.openstack.org/28045
Reviewed-by: Jesse Keating <jesse.keating@rackspace.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
The poll() system call is not available on all systems (like OS X, for
example), causing the test suite to fail. This change replaces poll()
with select(), which is more portable. With this change the test suite passes
under OS X.
Change-Id: I3ad716b127c8781d8dbf870b0f0c0e1162f264d1
Reviewed-on: https://review.openstack.org/28126
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
status.html:
- Added eventqueue-length status (was already present in production
but not committed here yet).
- HTML5 markup.
- Remove unused jquery-visibility.min.js and jquery-graphite.js.
status.js:
- Clean up (various js best practices and consistent coding style)
- Use empty() instead of html('').
- Use text() for text instead of html().
html() will trigger the parser where text will simply create
a text node with the string literal, much faster, safer and
semantically correct.
- Fix implied global variable leak 'result'.
- Fix reference error that crashes/freezes the page
Property data.trigger_event_queue and data.trigger_event_queue
can be undefined, in which case data.trigger_event_queue.length
causes an uncaught TypeError to be thrown.
- Use a closure instead of polluting global scope.
- Rewrite object oriented.
- Added 'demo' feature for easy local testing.
Downstream commits at
https://gerrit.wikimedia.org/r/#/q/project:integration/docroot+topic:zuul-js+branch:master+owner:Krinkle+is:merged,n,z
Change-Id: Iddd4e2787f2e2eb27bf428f733fbb8b4a9d162d5
Reviewed-on: https://review.openstack.org/26416
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
On setup where Zuul ends up triggering hundreds of projects, you end up
having projects using roughly the same pipeline/jobs. Whenever one want
to add a job in all the similiar project, he has to edit each project
one by one.
To save some precious time, this patch introduces the concept of project
templates. It lets you define a set of pipeline and attached jobs
though the job names can be passed parameters defined on a per project
basis. Thus, updating similiar projects is all about editing a single
template.
A basic example is provided in the documentation.
The voluptuous schema has been updated. It does check whether all
parameters are properly passed to a template but does NOT check whether
the resulting job name exist.
The parameter expansion in templates is borrowed from Jenkins Job
Builder (deep_format function). It has been tweaked to also expand
dictionary keys.
Layout test plan:
$ nosetests -m layout --nocapture
Test layout file validation ...
<...>
bad_template1.yaml
required key not provided @
data['projects'][0]['template']['project']
bad_template2.yaml
extra keys not allowed @
data['projects'][0]['template']['extraparam']
good_template1.yaml
ok
<...>
$
A basic test hasbeen added to verify whether a project-template properly
triggers its tests:
$ nosetests --nocapture \
tests/test_scheduler.py:testScheduler.test_job_from_templates_launched
Test whether a job generated via a template can be launched ... ok
----------------------------------------------------------------------
Ran 1 test in 0.863s
OK
$
Change-Id: Ib82e4719331c204de87fbb4b20c198842b7e32f4
Reviewed-on: https://review.openstack.org/21881
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
In a config test, the scheduler is created without a config object.
Handle that case gracefully in the pipeline constructor.
Add a test that runs the configtest.
Change-Id: Id59b3194aff7b5347fa04fe1cc29b1069d2a3f7f
Reviewed-on: https://review.openstack.org/27585
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
The new format will be:
"http://logs.example.com/6/1/gate/project2-merge/2 : SUCCESS in 00:00:00"
And the option is enabled by default.
Change-Id: Ib50c4948ea0a7b552d46a0e72ecb6c1a9609a771
Reviewed-on: https://review.openstack.org/27570
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins