Commit Graph

138 Commits

Author SHA1 Message Date
David Shrewsbury e6d8b210cc Documentation reorg
Reorganizing docs as recommended in:

https://www.divio.com/blog/documentation/

This is simply a reorganization of the existing documents and changes
no content EXCEPT to correct the location of sphinx doc references.
Expect followup changes to change document names (to reflect the new
structure) and to move content from existing guides (e.g., to move the
pipeline/project/job structure definitions out of the "Project Configuration"
reference guide into their own reference documents for easier locatability).

All documents are now located in either the "overview", "tutorials",
"discussions", or "references" subdirectories to reflect the new structure
presented to the user. Code examples and images are moved to "examples" and
"images" root-level directories.

Developer specific documents are located in the "references/developer"
directory.

Change-Id: I538ffd7409941c53bf42fe64b7acbc146023c1e3
2020-01-14 12:47:23 -05:00
Tristan Cacqueray 3c9d898b85 doc: add note for speculative queue attribute
This change documents the fact that the queue name attribute is not
evaluated speculatively.

Change-Id: I3506481d31640679270d4c1fb103defb3d9a966b
2020-01-06 14:06:15 +00:00
Tobias Henkel 91a1995ec8
Add note to supercedent with regards to file filters
Combining the supercedent pipeline manager with file filters can lead
to unexpected results so add a note about this.

Change-Id: I6d00b63b4fa926dd2d71240d7837ca49aa739d27
2019-12-12 16:11:48 +01:00
Zuul cb51f8843e Merge "Add no-jobs reporter action" 2019-09-18 08:36:43 +00:00
Zuul 186ad46075 Merge "Add enqueue reporter action" 2019-09-17 22:23:25 +00:00
James E. Blair 00e64f0bdf Add no-jobs reporter action
This facilitates integration with the gerrit checks API (and may
prove useful for other similar APIs).  It will allow us to report
that a change has no jobs in a particular pipeline.  A Zuul
pipeline will correspond to a Gerrit check, which means we can
update the status for that check from "SCHEDULED" to "NOT_RELEVANT"
if we determine that no jobs should run for the change.  This
closes out the status of the check in Gerrit when a project is
configured to participate in a check/pipeline but no jobs are
actually configured.

Test coverage for this will be added in change
Ida0cdef682ca2ce117617eacfb67f371426a3131.

Change-Id: Ide2a332b294d7efe23601d80eeb92b5af1d4c21b
2019-09-17 09:51:16 -07:00
James E. Blair c8d7119de4 Add enqueue reporter action
This facilitates integration with the gerrit checks API (and may
prove useful for other similar APIs).  It will allow us to report
that a change has been enqueued in a particular pipeline.  A Zuul
pipeline will correspond to a Gerrit check, which means we can
update the status for that check from "NOT_STARTED" to "SCHEDULED"
when it enters the pipeline.  This is important for our check
polling loop, and it will cause that check to stop appearing in
the list of pending checks.

Test coverage for this is added in change
Ida0cdef682ca2ce117617eacfb67f371426a3131.

Change-Id: I9ec329b446fa51e0911d4d9ff67eea7ddd55ab5d
2019-09-17 09:51:16 -07:00
Ian Wienand 464415dba8 Discuss executor-only jobs, add unit-test
This expands the discussion of executor-only jobs with some additional
notes.

Additionally a unit test is added to explicitly test executor-only
(i.e. blank nodeset) jobs.

Change-Id: I8fd2f932290e49da5a3605737e8940425cd092f4
2019-09-12 15:38:04 +10:00
Zuul 6fc172c5d7 Merge "Support squash merge in Github" 2019-07-31 17:20:42 +00:00
Zuul aac38fdcad Merge "Allow to select the merge method in Github" 2019-07-31 17:15:04 +00:00
Fabien Boucher 062f60ab4f Add change replacement field in doc for start-message
Change-Id: I1555f4bf2bedeea5aa0ea838eb3fc82b8606207b
2019-07-25 12:44:39 +00:00
James E. Blair a8e83031db Add "supercedes" pipeline option
This lets us abort check jobs when a change goes straight to gate.

Change-Id: I0e07a4be74ea708d0a0e186f523dd41174215b92
2019-07-15 08:34:09 -07:00
Zuul 86f071464d Merge "Run jobs when their own config changes" 2019-07-09 21:11:56 +00:00
Zuul e43f3b5393 Merge "Additional note about branches for implied-branches" 2019-07-09 21:06:02 +00:00
James E. Blair 7fba932e5d Run jobs when their own config changes
This causes file matchers to automatically match when the
configuration of the job itself changes.  This can be used instead
of matching "^.zuul.yaml$" which may cause too many jobs to run
in larger repos.

Change-Id: Ieddaead91b597282c5674ba99b0c0f387843c722
2019-07-08 15:47:25 -07:00
Zuul 34cdfe33b6 Merge "docs: add cleanup-run documentation" 2019-07-03 15:16:28 +00:00
Alex Schultz d6d8902479 Additional note about branches for implied-branches
If you define pragma.implied-branches on a branch, it needs to include
that branch name or changes will not be applied. Let's document this so
that other don't wonder why their zuul layout changes on a branch don't
actually trigger anything.

Change-Id: Ia9bbc54a199cd759580973f756956a9cf07d6b3e
2019-06-26 12:32:38 -06:00
Zuul c0e0dff004 Merge "Strengthen the caution about allowed-projects" 2019-06-26 17:58:24 +00:00
Zuul 9046116f66 Merge "Allow config projects to override allowed-projects" 2019-06-26 17:33:23 +00:00
James E. Blair f307b71edf Strengthen the caution about allowed-projects
Make it more clear that it can be dangerous to override this.

Change-Id: I34d3ec1a68bf9217552d6d7d1e1ce74830f6c7c6
2019-06-24 15:31:20 -07:00
James E. Blair 9021fdf8bb Allow config projects to override allowed-projects
To handle the case where an untrusted project defines a job with
a secret which another project would like to run, allow a config
project to attach that job to a project-pipeline and have it run
regardless of the allowed-projects setting.

Normally, untrusted jobs with secrets have an implicit and
non-overridable allowed-projects setting of only that project, to
avoid a situation where another project with a trusted post-review
pipeline gains access to the secret by using a Depends-On to a
change which lifts the allowed-projects restriction.  This change
allows a config project to bypass this, in effect saying that the
projects involved trust each other sufficiently (or else, do not
have access to a post-review pipeline which could be used to
obtain secrets).

Change-Id: I52ab193d0e39a37de64c8b3cb6953538e4073b43
2019-06-24 09:32:25 -07:00
Fabien Boucher 6f550eea59 Add missing doc for pipeline start-message
Change-Id: I5fb8696a36a3ebba28e2e62ad4304c6677365671
2019-06-20 16:27:26 +02:00
Tobias Henkel d221171e62
Support squash merge in Github
Many projects running on Github want to use the squash merge strategy
of github to keep their history clean. Now that the github reporter
forwards the merge-mode that can be configured on a project it is easy
to also support squash merge.

Change-Id: I1f4131002dd380f2860557a9aebcc0bcf4dc2af8
2019-06-11 12:08:07 +02:00
Markus Hosch 3f485be486
Allow to select the merge method in Github
Instead of creating a merge commit, Github also allows for two other
options, squash and rebase. This change makes the github reporter
aware of the merge-mode which already can be set. For now only merge
and merge-resolve are supported which both map to the Github merge
mode 'merge'. The other two merge modes that are supported by Github
are not yet supported by the merger and will be implemented in later
changes.

Change-Id: I3d51261f248072d2e3ee7e3212377f81b9a41010
Co-Authored-By: Tobias Henkel <tobias.henkel@bmw.de>
2019-06-11 12:08:07 +02:00
Tristan Cacqueray df2a79baa2 docs: add cleanup-run documentation
Change-Id: Iee05d1d108fb8c1280f0bb95a365428ff8c99650
2019-06-04 02:55:56 +00:00
Zuul bb6078da0b Merge "Support fail-fast in project pipelines" 2019-05-16 21:51:44 +00:00
Tobias Henkel b0d7c3c69a
Support fail-fast in project pipelines
In some cases like resource constrained environments it is beneficial
to report on changes in a fail fast manner to immediately report if
one job fails. This can be useful especially if a project has many
expensive long-running jobs. This introduces a fail-fast flag in the
project pipeline that let's the project choose the trade off between
full information and quick feedback.

Change-Id: Ie4a5ac8e025362dbaacd3ae82f2e8369f7447a62
2019-04-29 08:26:58 +02:00
James E. Blair e94100222b Clarify .zuul.d directory
This section mentions 3 out of the 4 places zuul configs can be;
add the fourth so that people aren't misled.

Change-Id: Ib5dc22dd2f1c5b3a4f17acb03e7a76a29d736f1b
2019-04-17 17:24:29 -07:00
Tobias Henkel 5c2b61e638
Make ansible version configurable
Currently the default ansible version is selected by the version of
zuul itself. However we want to make this configurable per deployment
(zuul.conf), tenant and job.

Change-Id: Iccbb124ac7f7a8260c730fbc109ccfc1dec09f8b
2019-03-15 09:09:16 +01:00
James E. Blair db3388688a Allow soft job dependencies
A "soft" dependency can be used to indicate that a job must run
after another completes, but only if it runs at all.  For example,
a deployment job which depends on a build job with different file
matcher criteria.

Change-Id: I4d7fc2b40942569323da273c4529fdb365a3b11a
2019-03-07 13:21:22 -08:00
Zuul 214146209d Merge "Allow run to be list of playbooks" 2019-02-06 04:38:02 +00:00
Paul Belanger 74a974bf4e Allow run to be list of playbooks
Like pre-run and post-run, allow a user to run a list of playbooks for
a job. One example would be your job workflow would be to run multiple
playbooks over using a site.yaml file with include_playbook commands.

A second use case, more related to job design. With multiple playbooks
support for job.run, the first playbook would be use deploy your server
and the second playbook to validate the server was provisioned properly.
Today, this can be done using a single run and post-run playbooks,
however if post-run fails, zuul will return POST_FAILURE, not FAILURE.
Not a large issue, but could be confusing to users when POST_FAILURE is
returned.

While it is possible a user could create a single site.yaml playbook,
and use multiple include_playbook statements to get this functionality,
there are downsides to this approach (mostly with the leaking of
variables).  Today, operators simply run ansible-playbook multiple times
with the specific playbooks they only want.

Story: 2002543
Task: 22101

Change-Id: I6268d9944e745cc07407ea7dd040fbfeb79dad4d
Related-To: https://review.openstack.org/519596
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-02-05 14:52:29 -05:00
James E. Blair 1317391323 Add provides/requires support
Adds support for expressing artifact dependencies between jobs
which may run in different projects.

Change-Id: If8cce8750d296d607841800e4bbf688a24c40e08
2019-01-30 14:07:42 -08:00
James E. Blair ed7f9da75e Set allowed-projects on untrusted jobs with secrets
It is possible to circumvent the use of `allowed-projects` in
untrusted projects by creating a change which `Depends-On` a
change which alters a project definition.  This behavior may be
unexpected, so documentation has been updated with warnings to
avoid relying on it in sensitive cases.

It may have been possible to expose a secret, or use resources
protected by a secret, if a job using a secret was defined in an
untrusted project on a system with an independent pre-merge
post-review pipeline -- that is, a pipeline with `post-review` set
to true, `manager` set to `independent`, and which operated on
changes before they merged.

To prevent disclosure or use in this situation, `allowed-projects`
is now automatically set to the current project when a secret is
used in a job defined in an untrusted project, and it can not be
overridden.

The test_trusted_secret_inheritance_gate test is removed because
it only tested that jobs with secrets in an untrusted repo were
able to run in a trusted repo.  That is no longer possible.

Change-Id: I77f6a011bca08a2433137dc29597b7cc2757adb1
Story: 2004837
Task: 29037
2019-01-22 14:01:10 -08:00
James E. Blair 91ed6652dc Add pass-to-parent option for secrets
This allows jobs to pass secrets to parent jobs.  That will allow
for jobs which are designed to be used with secrets with the actual
secrets supplied by child jobs.

Change-Id: I544aec77c86f4cb1c11bf6e14a7d93efea0421d6
2019-01-18 08:38:26 -08:00
gaobin 5b3ca17c05 Modify some file content errors
The following error 
exectuor to executor
formated to formatted
overidden to overridden

Change-Id: Ie80e1632624c65adaf6aad86a2c7aae93da688ff
2018-12-11 06:11:07 +00:00
James E. Blair 407643a4e6 Consider shared changes queues for relative_priority
When calculating relative_priority for independent pipelines,
use shared change queues just as is done for dependent pipelines.

To implement this, we now calculate shared change queues for all
pipelines, not just dependent ones, though we don't use those
queues for any purpose other than this.

Change-Id: I59b1090ca1f4fcc72276445e6ff4c5cf4f2f5030
2018-12-07 15:15:14 -08:00
Tobias Henkel ae887dab58
Improve resource usage with semaphores
Currently when jobs use semaphores they first get and lock the build
nodes and then aquire the semaphore. If there are many jobs waiting
for the semaphore this can block a substantial part of the available
resources. In order to make this safe default to acquire the semaphore
before requesting the nodes.

However in some cases when jobs with a semaphore shall run as fast as
possible in a consecutive manner then it might be preferrable to
accept some waste of resources. In order to support this use case the
job using a semaphore can override this behavior and still acquire the
semaphore after getting the nodes.

Change-Id: Id6f582ec29219d280d05319d1b822c7934437b7a
2018-11-20 15:20:59 +01:00
Tristan Cacqueray 4037dc803d doc: fix typo in secret example
Change-Id: I21eae8d6076c514da864c7758fd31cbfec05dfbe
2018-11-07 08:02:03 +00:00
Zuul 801ed767ff Merge "Add variables to project" 2018-07-26 22:54:27 +00:00
Zuul 46c86884c5 Merge "Docs: add a cross-ref in secrets" 2018-07-26 22:32:36 +00:00
Ian Wienand 8d80ec2ba8
Add variables to project
This adds a "vars:" entry to projects and project-templates to make
available global values for each job.  This can be useful to avoid
repeating the same variable definitions for the same job in different
pipelines, or to pass a project-specific value to jobs in a templating
situation.

Change-Id: I9fb468743a21067773979d113e714b5c3e908d02
2018-07-26 17:46:26 -04:00
Zuul 7a003bdb8c Merge "Add support for Ansible extra-vars flag" 2018-07-26 21:34:32 +00:00
Paul Belanger a8b31da6eb
Add support for Ansible extra-vars flag
Currently, variables using the extra-vars flags always win precedence
over any other variable in ansible. There is also a 2nd use case where
playbooks variables for serial, hosts, etc can only be set using
extra-vars CLI flag.

While this could be achieved by using secrets today, it doesn't feel
like the correct way to use them. Additionally, secrets are
dictionary values in ansible, making them hard to use the filters like
default().

Change-Id: I6d8018661f8d13b7324a012cdbf9614e983e5114
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2018-07-26 10:56:04 -04:00
James E. Blair fd43c06022 Support complex data structures as secrets
This allows us to encode complex data structures, such as entire
openstack clouds.yaml cloud configs, as secrets.

Change-Id: I5fbafa41b9ab180842a4dd7bd82e2603f38e6644
2018-07-26 11:24:35 +00:00
James E. Blair 058875a3d1 Docs: add a cross-ref in secrets
We missed an opportunity to cross-reference a job attribute.

Change-Id: Ife51ecc7f5db6d45c4deebd965c9401e0697356c
2018-07-17 09:21:10 -07:00
Logan V fb256abe69 Fix secret example yaml
The example here does not match other examples[1][2], and also
does not match the output of the tools/encrypt_secret.py tool.

[1] https://docs.openstack.org/infra/zuul/user/jobs.html
[2] https://docs.openstack.org/infra/zuul/user/encryption.html

Change-Id: Iedea1a3a6ac5403e8f72177a04291d0d8b1269be
2018-07-04 00:31:09 -05:00
James E. Blair 7e74a03a5a Fix typos in docs
Change-Id: Ia2df0a749dd5843f540ea084385231ec8001f23b
2018-06-28 08:43:59 -07:00
James E. Blair 4f93d6d527 Don't add implied branch matchers to project-pipeline variants
The project pipelines themselves have branch matchers now, so we should
not add implied branch matchers to project-pipeline job variants.  This
error would cause centrally defined tag/release jobs not to run when added
to in-repo project-pipeline definitions in multi-branch repos because
these project-pipeline variants would end up with branch matchers.

There remains a similar case where if a job is defined in a multi-branch
repo with no explicit branch matchers and added to a tag/release pipeline,
it will not run because the job definition itself will not match the tag.
Currently the only solution to this is to add an explicit branch matcher
to one or more of the top-level job definitions.  A more intuitive solution
is difficult because in the case of multiple variants, it's not clear which
should apply.

Removing the implied branch matchers from project-pipeline jobs also removes
them from project-template jobs.  We previously added branch matchers to
project configs, but did not do the same for project-templates.  This change
requires that we do so.  Now all projects and project-templates are given
implied branch matchers if appropriate, and these are used to determine if
their jobs are added.  This is a further behavior change in that a project
which invokes a template defined in another project which is branched will
(absent the disabling of implicit branch matchers) no longer use that template
on branches other than the one where it is defined.

Change-Id: I55cec1897b0d64fa61d43ef5dbeb8a3c37bf7862
2018-06-27 10:43:56 -07:00
Zuul 06df3bb0d1 Merge "Add supercedent pipeline manager" 2018-06-15 05:15:35 +00:00