zuul/tests/fixtures/layouts
James E. Blair da5bb7eea6 Prune stale branches from mergers
Ensure that when a remote branch disappears, mergers prune that
branch from their local copy.  Otherwise, they will continue
to instruct executors to create that branch for jobs.  This is
not only incorrect, but it could lead to errors if the executors
don't have those objects locally.

The zuul-cloner used to use the merger.prune method to avoid this
issue, however, a straightforward application of that on the mergers
could be problematic.  If the merger's git repo is not in a coherent
state, the prune method will raise an error.  Further, at the end
of the reset() method, the merger actually leaves the repos in a
state where 'git prune' can not operate -- it leaves HEAD pointing
to a symbolic reference which may not exist as a head ref.  This
generally isn't an issue as the next thing that happens after reset()
is usually checkout.  But it does prevent us from running prune() at
the end of reset().

To address both of these issues, incorporate pruning into the reset
method in a safe manner.  First, create or update any non-stale
branches.  Pick the first of those to be the new local HEAD.  Reset
the repository to that.  Finally, delete any stale branches.

This change also updates all of the tests so that git clones of the
"upstream" repos use file:// urls, so that they do not rely on
hard links and more closely mimic actual behavior.  That was necessary
in this test in order to reproduce the situation where a merger
whch clones from upstream after a branch deletion would not have
objects that another merger which had cloned before deletion did have.

It also removes some test-specific debugging around git repo creation
which is no longer needed.

Change-Id: Ic34453ddb0205ad31708d154d53915d66d26b548
2018-01-23 09:43:26 -08:00
..
autohold.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
basic-git.yaml Git driver 2017-12-15 14:32:40 +01:00
basic-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
branch-deletion.yaml Prune stale branches from mergers 2018-01-23 09:43:26 -08:00
crd-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
delayed-repo-init.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
dependent-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
dequeue-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
disable_at.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
dont-ignore-ref-deletes.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
files-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
footer-message.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
idle.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
ignore-dependencies.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
inheritance.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
irrelevant-files.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
job-variants.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
job-vars.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
labeling-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
live-reconfiguration-add-job.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
live-reconfiguration-del-project.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
live-reconfiguration-failed-job.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
live-reconfiguration-shared-queue.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
matcher-test.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
merge-failure.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
merging-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
multiple-templates.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
no-jobs-project.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
no-jobs.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
no-run.yaml Validate that a job has a run playbook on freeze 2017-10-26 16:05:22 -07:00
no-timer.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
nonvoting-job.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
nonvoting-pipeline.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
noop-job.yaml Case sensitive label matching 2017-07-27 07:46:35 +02:00
one-job-project.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
parent-matchers.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
push-tag-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
rate-limit.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
reconfigure-failed-head.yaml On reconfiguration, re-enqueue items at the same position 2017-10-31 17:01:09 -07:00
reconfigure-remove-add.yaml Remove nodesets from builds canceled during reconfiguration 2017-11-30 14:48:40 -08:00
reconfigure-remove-add2.yaml Remove nodesets from builds canceled during reconfiguration 2017-11-30 14:48:40 -08:00
reconfigure-window-fixed.yaml Don't shrink windows on reconfiguration 2017-12-01 09:42:14 -08:00
reconfigure-window-fixed2.yaml Don't shrink windows on reconfiguration 2017-12-01 09:42:14 -08:00
reconfigure-window.yaml Remove nodesets from builds canceled during reconfiguration 2017-11-30 14:48:40 -08:00
reconfigure-window2.yaml Remove nodesets from builds canceled during reconfiguration 2017-11-30 14:48:40 -08:00
repo-checkout-four-project.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
repo-checkout-no-timer-override.yaml Add support for override-checkout, deprecate override-branch 2017-10-30 15:00:11 -07:00
repo-checkout-no-timer.yaml Add support for override-checkout, deprecate override-branch 2017-10-30 15:00:11 -07:00
repo-checkout-post.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
repo-checkout-six-project.yaml Add support for override-checkout, deprecate override-branch 2017-10-30 15:00:11 -07:00
repo-checkout-tag.yaml Add support for override-checkout, deprecate override-branch 2017-10-30 15:00:11 -07:00
repo-checkout-timer-override.yaml Add support for override-checkout, deprecate override-branch 2017-10-30 15:00:11 -07:00
repo-checkout-timer.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
repo-checkout-two-project.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
repo-deleted.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
reporting-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
reporting-multiple-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
requirements-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
reviews-github.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
smtp.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
tags.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
three-projects.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
timer-smtp.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
timer.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00
unmanaged-project.yaml Case sensitive label matching 2017-07-27 07:46:35 +02:00
untrusted-secrets.yaml Update test fixtures to use explicit run 2017-10-26 15:59:41 -07:00