Fix branch deletion after failed reconfig
Normally when a branch is deleted, we delete the cached data for
that branch and perform a partial ("tenant") reconfiguration. However,
there are two caches of configuration for each project -- the full
cache, and the per-branch cache. We were not deleting the per-branch
cache, so if the tenant reconfiguration failed, the per-branch cache
would still contain the deleted branch.
Also, on full reconfiguration, we update the per-branch cache, however,
we never deleted branches from the cache in that case, so even a full
reconfiguration would be unable to clear that cache. This is fixed
as well.
Change-Id: Ia9c17238ef0e42609e3de304af9c0c4588c72995
diff --git a/tests/fixtures/config/branch-deletion/git/common-config/playbooks/base.yaml b/tests/fixtures/config/branch-deletion/git/common-config/playbooks/base.yaml
new file mode 100644
index 0000000..f679dce
--- /dev/null
+++ b/tests/fixtures/config/branch-deletion/git/common-config/playbooks/base.yaml
@@ -0,0 +1,2 @@
+- hosts: all
+ tasks: []
diff --git a/tests/fixtures/config/branch-deletion/git/common-config/zuul.yaml b/tests/fixtures/config/branch-deletion/git/common-config/zuul.yaml
new file mode 100644
index 0000000..04091a7
--- /dev/null
+++ b/tests/fixtures/config/branch-deletion/git/common-config/zuul.yaml
@@ -0,0 +1,17 @@
+- pipeline:
+ name: check
+ manager: independent
+ trigger:
+ gerrit:
+ - event: patchset-created
+ success:
+ gerrit:
+ Verified: 1
+ failure:
+ gerrit:
+ Verified: -1
+
+- job:
+ name: base
+ parent: null
+ run: playbooks/base.yaml
diff --git a/tests/fixtures/config/branch-deletion/git/org_project/zuul.yaml b/tests/fixtures/config/branch-deletion/git/org_project/zuul.yaml
new file mode 100644
index 0000000..cf635e8
--- /dev/null
+++ b/tests/fixtures/config/branch-deletion/git/org_project/zuul.yaml
@@ -0,0 +1,4 @@
+- project:
+ name: org/project
+ check:
+ jobs: []
diff --git a/tests/fixtures/config/branch-deletion/git/org_project1/zuul.yaml b/tests/fixtures/config/branch-deletion/git/org_project1/zuul.yaml
new file mode 100644
index 0000000..1fc35b5
--- /dev/null
+++ b/tests/fixtures/config/branch-deletion/git/org_project1/zuul.yaml
@@ -0,0 +1,3 @@
+- project:
+ check:
+ jobs: []
diff --git a/tests/fixtures/config/branch-deletion/main.yaml b/tests/fixtures/config/branch-deletion/main.yaml
new file mode 100644
index 0000000..9ffae3d
--- /dev/null
+++ b/tests/fixtures/config/branch-deletion/main.yaml
@@ -0,0 +1,10 @@
+- tenant:
+ name: tenant-one
+ source:
+ gerrit:
+ config-projects:
+ - common-config
+ untrusted-projects:
+ - org/project
+ - org/project1
+