Merge "Rename uuid to build" into feature/zuulv3
diff --git a/doc/source/user/jobs.rst b/doc/source/user/jobs.rst
index beb489e..0b22252 100644
--- a/doc/source/user/jobs.rst
+++ b/doc/source/user/jobs.rst
@@ -121,7 +121,7 @@
 
 All items provide the following information as Ansible variables:
 
-**zuul.uuid**
+**zuul.build**
   The UUID of the build.  A build is a single execution of a job.
   When an item is enqueued into a pipeline, this usually results in
   one build of each job configured for that item's project.  However,
@@ -131,8 +131,6 @@
   job is run, for whatever reason, it is acompanied with a new
   unique id.
 
-.. TODO: rename build
-
 **zuul.buildset**
   The build set UUID.  When Zuul runs jobs for an item, the collection
   of those jobs is known as a buildset.  If the configuration of items
diff --git a/tests/fixtures/config/ansible/git/bare-role/tasks/main.yaml b/tests/fixtures/config/ansible/git/bare-role/tasks/main.yaml
index 75943b1..cd8917d 100644
--- a/tests/fixtures/config/ansible/git/bare-role/tasks/main.yaml
+++ b/tests/fixtures/config/ansible/git/bare-role/tasks/main.yaml
@@ -1,3 +1,3 @@
 - file:
-    path: "{{zuul._test.test_root}}/{{zuul.uuid}}.bare-role.flag"
+    path: "{{zuul._test.test_root}}/{{zuul.build}}.bare-role.flag"
     state: touch
diff --git a/tests/fixtures/config/ansible/git/common-config/playbooks/post.yaml b/tests/fixtures/config/ansible/git/common-config/playbooks/post.yaml
index 2e512b1..7fd8a2b 100644
--- a/tests/fixtures/config/ansible/git/common-config/playbooks/post.yaml
+++ b/tests/fixtures/config/ansible/git/common-config/playbooks/post.yaml
@@ -1,5 +1,5 @@
 - hosts: all
   tasks:
     - file:
-        path: "{{zuul._test.test_root}}/{{zuul.uuid}}.post.flag"
+        path: "{{zuul._test.test_root}}/{{zuul.build}}.post.flag"
         state: touch
diff --git a/tests/fixtures/config/ansible/git/common-config/playbooks/pre.yaml b/tests/fixtures/config/ansible/git/common-config/playbooks/pre.yaml
index f4222ff..268cd65 100644
--- a/tests/fixtures/config/ansible/git/common-config/playbooks/pre.yaml
+++ b/tests/fixtures/config/ansible/git/common-config/playbooks/pre.yaml
@@ -1,5 +1,5 @@
 - hosts: all
   tasks:
     - file:
-        path: "{{zuul._test.test_root}}/{{zuul.uuid}}.pre.flag"
+        path: "{{zuul._test.test_root}}/{{zuul.build}}.pre.flag"
         state: touch
diff --git a/tests/fixtures/config/ansible/git/common-config/playbooks/python27.yaml b/tests/fixtures/config/ansible/git/common-config/playbooks/python27.yaml
index 3371a20..6669f23 100644
--- a/tests/fixtures/config/ansible/git/common-config/playbooks/python27.yaml
+++ b/tests/fixtures/config/ansible/git/common-config/playbooks/python27.yaml
@@ -4,10 +4,10 @@
         path: "{{flagpath}}"
         state: touch
     - copy:
-        src: "{{zuul._test.test_root}}/{{zuul.uuid}}.flag"
-        dest: "{{zuul._test.test_root}}/{{zuul.uuid}}.copied"
+        src: "{{zuul._test.test_root}}/{{zuul.build}}.flag"
+        dest: "{{zuul._test.test_root}}/{{zuul.build}}.copied"
     - copy:
         content: "{{test_secret.username}} {{test_secret.password}}"
-        dest: "{{zuul._test.test_root}}/{{zuul.uuid}}.secrets"
+        dest: "{{zuul._test.test_root}}/{{zuul.build}}.secrets"
   roles:
     - bare-role
diff --git a/tests/fixtures/config/ansible/git/common-config/zuul.yaml b/tests/fixtures/config/ansible/git/common-config/zuul.yaml
index aa57d08..1a1b22f 100644
--- a/tests/fixtures/config/ansible/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/ansible/git/common-config/zuul.yaml
@@ -59,7 +59,7 @@
     pre-run: playbooks/pre
     post-run: playbooks/post
     vars:
-      flagpath: '{{zuul._test.test_root}}/{{zuul.uuid}}.flag'
+      flagpath: '{{zuul._test.test_root}}/{{zuul.build}}.flag'
     roles:
       - zuul: bare-role
     auth:
diff --git a/tests/fixtures/config/ansible/git/org_project/playbooks/faillocal.yaml b/tests/fixtures/config/ansible/git/org_project/playbooks/faillocal.yaml
index 6689e18..5b0c18d 100644
--- a/tests/fixtures/config/ansible/git/org_project/playbooks/faillocal.yaml
+++ b/tests/fixtures/config/ansible/git/org_project/playbooks/faillocal.yaml
@@ -1,5 +1,5 @@
 - hosts: all
   tasks:
     - copy:
-        src: "{{zuul._test.test_root}}/{{zuul.uuid}}.flag"
-        dest: "{{zuul._test.test_root}}/{{zuul.uuid}}.failed"
+        src: "{{zuul._test.test_root}}/{{zuul.build}}.flag"
+        dest: "{{zuul._test.test_root}}/{{zuul.build}}.failed"
diff --git a/tests/fixtures/config/pre-playbook/git/common-config/playbooks/post.yaml b/tests/fixtures/config/pre-playbook/git/common-config/playbooks/post.yaml
index 2e512b1..7fd8a2b 100644
--- a/tests/fixtures/config/pre-playbook/git/common-config/playbooks/post.yaml
+++ b/tests/fixtures/config/pre-playbook/git/common-config/playbooks/post.yaml
@@ -1,5 +1,5 @@
 - hosts: all
   tasks:
     - file:
-        path: "{{zuul._test.test_root}}/{{zuul.uuid}}.post.flag"
+        path: "{{zuul._test.test_root}}/{{zuul.build}}.post.flag"
         state: touch
diff --git a/tests/fixtures/config/pre-playbook/git/common-config/playbooks/pre.yaml b/tests/fixtures/config/pre-playbook/git/common-config/playbooks/pre.yaml
index 13c2208..4875ad4 100644
--- a/tests/fixtures/config/pre-playbook/git/common-config/playbooks/pre.yaml
+++ b/tests/fixtures/config/pre-playbook/git/common-config/playbooks/pre.yaml
@@ -1,8 +1,8 @@
 - hosts: all
   tasks:
     - copy:
-        src: "{{zuul._test.test_root}}/{{zuul.uuid}}.flag"
-        dest: "{{zuul._test.test_root}}/{{zuul.uuid}}.failed"
+        src: "{{zuul._test.test_root}}/{{zuul.build}}.flag"
+        dest: "{{zuul._test.test_root}}/{{zuul.build}}.failed"
     - file:
-        path: "{{zuul._test.test_root}}/{{zuul.uuid}}.pre.flag"
+        path: "{{zuul._test.test_root}}/{{zuul.build}}.pre.flag"
         state: touch
diff --git a/tests/fixtures/config/pre-playbook/git/common-config/playbooks/python27.yaml b/tests/fixtures/config/pre-playbook/git/common-config/playbooks/python27.yaml
index dbb64a5..08c7bd3 100644
--- a/tests/fixtures/config/pre-playbook/git/common-config/playbooks/python27.yaml
+++ b/tests/fixtures/config/pre-playbook/git/common-config/playbooks/python27.yaml
@@ -1,5 +1,5 @@
 - hosts: all
   tasks:
     - file:
-        path: "{{zuul._test.test_root}}/{{zuul.uuid}}.main.flag"
+        path: "{{zuul._test.test_root}}/{{zuul.build}}.main.flag"
         state: touch
diff --git a/tests/fixtures/config/roles/git/bare-role/tasks/main.yaml b/tests/fixtures/config/roles/git/bare-role/tasks/main.yaml
index 75943b1..cd8917d 100644
--- a/tests/fixtures/config/roles/git/bare-role/tasks/main.yaml
+++ b/tests/fixtures/config/roles/git/bare-role/tasks/main.yaml
@@ -1,3 +1,3 @@
 - file:
-    path: "{{zuul._test.test_root}}/{{zuul.uuid}}.bare-role.flag"
+    path: "{{zuul._test.test_root}}/{{zuul.build}}.bare-role.flag"
     state: touch
diff --git a/tests/fixtures/config/streamer/git/common-config/zuul.yaml b/tests/fixtures/config/streamer/git/common-config/zuul.yaml
index d8df96a..6f4fa7e 100644
--- a/tests/fixtures/config/streamer/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/streamer/git/common-config/zuul.yaml
@@ -14,4 +14,4 @@
 - job:
     name: python27
     vars:
-      waitpath: '{{zuul._test.test_root}}/{{zuul.uuid}}/test_wait'
+      waitpath: '{{zuul._test.test_root}}/{{zuul.build}}/test_wait'
diff --git a/zuul/executor/client.py b/zuul/executor/client.py
index 25bc0cf..c668ca0 100644
--- a/zuul/executor/client.py
+++ b/zuul/executor/client.py
@@ -155,7 +155,7 @@
             canonical_hostname=item.change.project.canonical_hostname,
             canonical_name=item.change.project.canonical_name)
 
-        zuul_params = dict(uuid=uuid,
+        zuul_params = dict(build=uuid,
                            buildset=item.current_build_set.uuid,
                            ref=item.change.ref,
                            pipeline=pipeline.name,