This internal-only attribute is basically the same as "ref" but
spelled differently only in the case of a change. Just use
the "ref" name in all cases for improved developer sanity.
Change-Id: I476f8d32dae37309ab0c9e11c8a5337b213f985e
So that we may re-use the same jobs for pre and post merge tests,
enqueue an item for every branch of every timer-triggered project
and checkout that branch before running the job. This means that
rather than having a job for gate plus a job for each stable branch,
we hav just have a single job which runs with different content.
The old method is still supported using override branches.
This updates the model to include Change, Branch, Tag, and Ref
objects which can be used as the value of Item.change. Branch,
Tag, and Ref are all very similar, but the distinction may help
us ensure that we're encoding the right information about the items
we are enqueing. This is important for branch matching in pipelines
and is also used to provide job variables.
Change-Id: I5c41d2dcbbbd1c17d68074cd7480e6ab83f884ea
This adds a static html page to zuul-web that a browser can be pointed
to for streaming log files. To leverage this in the status UI the
scheduler sets the build url to this html page adding build uuid,
logfile and optionally a different url for accessing the websocket.
Tobias has to run his websocket streamer on a different domain than
the other things, via proxy things - so the url zuul-web is serving
for the static file isn't the same as what it is for the websocket
from a consumer perspective. So introduce a config variable for
zuul-web that allows setting an explicit url for that. If it's not
set, use the relative path from static/stream.html to console-stream.
Further to not throwing away the finger url retail this as additional
field in status.json. With this a later change to the status ui could
let the user choose between html and finger log streaming.
Co-Authored-By: David Shrewsbury <shrewsbury.dave@gmail.com>
Co-Authored-By: Monty Taylor <mordred@inaugust.com>
Co-Authored-By: Tobias Henkel <tobias.henkel@bmw.de>
Change-Id: I2da7979f448934abe3d41f3a5e50d09004fcccc2
Add the project in which a job is defined as an implicit role project.
This is a convenience for job authors who may want to put roles in
the root of the project (ie, not adjacent to job playbooks, since,
after all, the roles may be useful outside of the job playbooks). In
that case, they will not need to specify the job's own project in the
roles: section of the job.
Change-Id: Ia382c2da9f7eb7139ceb0b61cb986aace8dc8d8f
There are some errors that the executor may encounter where it will
be unable to, or refuse to, run a job. We know that these errors
will not be corrected by retrying the build, so return them as
errors to the user. The build result will be "ERROR" and the message
which is brief, but hopefully sufficient to illuminate the problem,
will be added to the job report.
Change-Id: Iad486199de19583eb1e9f67c89a8ed8dac75dea1
Story: 2001105
Story: 2001106
Previously one could not speculatively add a project to a dependent
pipeline if the desired queue did not exist. This change handles this
special case by creating a dynamic queue for the use of the speculative
change. If the change merges, then the queue will exist for any future
change.
Introduces a new ChangeQueue attribute, 'dynamic', to help
DependentPipelineManager objects determine whether a ChangeQueue was
created dynamically or not, during a clean up phase. Only used in
DependentPipelineManager pipelines.
Note that this doesn't necessarily support a newly added named queue, or
adding a project to an existing named queue. That will be follow up
work.
Change-Id: I51ab7fb113f1bcbcef5f4f6c96ca046d0c76fdd9
Story: 2000898
Task: 3528
Due to a bug in the equality check of the ZuulRoles class, we
were unable to add more than one roles path. This corrects that and
adds a test of role inheritance which exercises this.
Change-Id: Icf6daa312405ed56d2fecb89fc6aee69b4b80e41
And failure-url. This is an attempt to make it easy to use the
log_url return value, but still indicate that, say, the openstack
docs job should return a deep link to the doc index page.
Change-Id: I606fb7475a026f9a6d99c91b2b8e2223d7983daf
This lets a child job add roles which take precedence over its
parent. This should be safe to do now that playbooks only run
with the roles they were defined with.
Change-Id: I5c6c506f5a59562edc360771393d31c11ea42835
So that a job lower in the inheritance hierarchy does not alter
the behavior of playbooks defined higher in the hierarchy, run
each playbook with only the roles that were present on the job
at the point in the inheritance hierarchy that playbook was
defined.
Change-Id: I06f4aff5340f48a09dae2cd95180531fa572b85e
The Ansible role path should be an ordered list as roles may have
the same name and precedence is important.
Change-Id: I1518789c8b3abea42873885a964ee05f3fe51c4f
This loads a json file (work/results.json) that the job can write
to. It will be loaded by the executor after the job completes and
returned to the scheduler.
We can use the data in this file as the reported log URL for the
build. Later we can use it to supply file/line comments in
reviews.
Change-Id: Ib4eb743405f337c5bd541dd147e687fd44699713
Adding the job dependencies will make it possible to render the job
graphs as real graphs. In example one could think of a details popup
when clicking on a details link.
Change-Id: Id9c376a47b28ff022eb69f957c18791d7130daf1
To support the idea that diverse zuul installations can share common
job definitions in a 'standard library' project, but still be able to
override some job definitions with their own local versions if needed,
add a tenant config option to permit a repo to shadow another one.
Place the local project first in configuration, then on the remote project,
indicate that it shadows the local one. Then, any definitions in the
remote repository which conflict with the local will be ignored.
Change-Id: Ia715c5fa45141eacbb11449404ee3a3ec948d27f
We were attaching tenant-specific metadata (include/exclude) to
Project objects which is incorrect since those objects may span
tenants.
Instead, create a new TenantProjectConfig class which holds such
metadata, and attach it to the Tenant class.
Change-Id: Id69f9ec3a5116460beef2f83e065f5a1021dc147
We support configuring an alternate port for finger. Make sure it makes
its way into the URL we provide if it's provided.
Change-Id: I5f511e15c031755d5c90627830ed29b80c6285fd
The failure-url is not used when formatting jobs with a result of e.g.
POST_FAILURE or TIME_OUT. Fix this by defaulting to the failure-url
for any non-success result.
This also enhances the test_playbook test with a broken post playbook
and tests for the correct urls.
Change-Id: I8485dee83e36275a1dd439f12cf8c0fdf90999ca
It exists only for py2/py3 compat. We do not need it any more.
This will explicitly break Zuul v3 for python2, which is different than
simply ceasing to test it and no longer declaring we support it. Since
we're not testing it any longer, it's bound to degrade overtime without
us noticing, so hopefully a clean and explicit break will prevent people
from running under python2 and it working for a minute, then breaking
later.
Change-Id: Ia16bb399a2869ab37a183f3f2197275bb3acafee
This change adds 'ssh_port' to the Node class so that zuul-executor can
use a custom ssh server when it is set by nodepool provider.
Change-Id: Icdac6cd41dded0e46fba5d14c31f40810f73b74a
We are keeping the 'label' terminology in nodepool, and since that
is actually what zuul asks for, use that terminology here to avoid
confusion.
Change-Id: I5f5f1cd041b6dbd80a75af66fe02520f3eb32151
So that multiple Zuul installations can share portions of their
configuration, allow the administrator to indicate which
configuration objects should be loaded from which repositories.
This also facilitates third-party CI, and is important for
any interaction with repos for which a given Zuul installation is
not fully responsible.
In particular, this allows an administrator to use the jobs, but
not the project-pipeline definitions from a given repo. Or even
to use the content of a repo without reading any of the zuul
configuration therein.
Change-Id: I8a07e298c8cf4dd7cbf6f5b7fc38990f7d740af4
For github (and probably other providers) we really only have the option
of returning 1 url for the entire buildset, as opposed to 1 per build.
To make log uploading within that easier we really need a way to
globally identify all the different builds that belong to 1 change.
The zuul ref is already available however this is a concept that is
planned to be deprecated, so instead add a UUID parameter to the
buildset that we can pass through. This UUID is used to build the ref to
make migration easier.
Change-Id: I1cab8af5c9d7f6875591fbe4ac4e184b90f6ca12
Signed-off-by: Jamie Lennox <jamielennox@gmail.com>
Expose the tenant name to the executor and url formatter so that we can
store logs per tenant.
Change-Id: Ifad1ba668ee5b86e6c6f5cb71eae53ad8d49f3ff
Signed-off-by: Jamie Lennox <jamielennox@gmail.com>
The code that would look for in-repo config changes was gerrit specific.
Turn the gerrit specific bit into a generic that drivers can implement.
Implement the generic in the github driver, which required accounting
for files that are part of a push event (where code is landing in the
repo we care about).
Also remove an unnecessary fake pull request method of getPushEvent, as
there was already one in the fake github class.
Move the real updatesConfig function from the Change object to the Ref
object (since we can get a change from a ref) and move the files
attribute as well.
Introduce a test for github to verify that the tenant is reconfigured.
This required introducing a new Scheduler object attribute to track when
each tenant is reconfigured. The existing reconfiguration time tracker
was generic, and not updated via dyanmic updates.
Change-Id: Ibf59f91fa3701c15d93d859920fe3070478fe457
Story: 2000774
Task: 4664
This was testing some things that seeminly weren't even plumbed through
in Zuul v2.5 except for in the fake build. Removing them from the model
and support commands as well. We can always add back in the things we
need.
Change-Id: I47ee260e2e0a1cb5350b2f22a9b4c61dd1521aae
Story: 2000773
Task: 4617
Noticed there were a few vestigal references to Changeish that didn't get
converted, including the ChangeishFilter. Convert them to Ref.
In model, there were two places where a method started with changeish =
self.change. Those were removed and self.change was used in the method
because ref = self.change led to the method having two important
variables "ref" and "ret" which seems like a recipe for confusion. Of
course, that led to one line being too long for pep8, so it was
rewritten to use getattr instead of hasattr + and.
Change-Id: I420b8ec7c7eb32574dfe2de467fc2bbd0f96e9f1