Rename 'repos' job attribute to 'required-projects'

The name 'repos' is not clear, especially since we have removed
most other occurences of that word.  It's not obvious that the
values should be names of Zuul projects.  We might simply use
'projects' instead, but there is a concern that users may see
that as saying this job should *run on* these projects (ie, as
a replacement for the project-pipeline configuration).  Hopefully
'required-projects' indicates that the job utilizes the projects
in the list.

Change-Id: I43af7a7f688f1368514427a2892a03d1cf46fe72
diff --git a/tests/fixtures/config/openstack/git/project-config/zuul.yaml b/tests/fixtures/config/openstack/git/project-config/zuul.yaml
index 5d0c774..aff2046 100644
--- a/tests/fixtures/config/openstack/git/project-config/zuul.yaml
+++ b/tests/fixtures/config/openstack/git/project-config/zuul.yaml
@@ -66,7 +66,7 @@
 - job:
     name: dsvm
     parent: base
-    repos:
+    required-projects:
       - openstack/keystone
       - openstack/nova
 
diff --git a/zuul/configloader.py b/zuul/configloader.py
index 6c1e388..ed85119 100644
--- a/zuul/configloader.py
+++ b/zuul/configloader.py
@@ -229,8 +229,8 @@
 
         role = vs.Any(zuul_role, galaxy_role)
 
-        repo = {vs.Required('name'): str,
-                'override-branch': str}
+        job_project = {vs.Required('name'): str,
+                       'override-branch': str}
 
         job = {vs.Required('name'): str,
                'parent': str,
@@ -255,7 +255,7 @@
                '_source_context': model.SourceContext,
                '_start_mark': yaml.Mark,
                'roles': to_list(role),
-               'repos': to_list(vs.Any(repo, str)),
+               'required-projects': to_list(vs.Any(job_project, str)),
                'vars': dict,
                'dependencies': to_list(str),
                'allowed-projects': to_list(str),
@@ -367,23 +367,23 @@
                     ns.addNode(node)
             job.nodeset = ns
 
-        if 'repos' in conf:
-            new_repos = {}
-            repos = as_list(conf.get('repos', []))
-            for repo in repos:
-                if isinstance(repo, dict):
-                    repo_name = repo['name']
-                    repo_override_branch = repo.get('override-branch')
+        if 'required-projects' in conf:
+            new_projects = {}
+            projects = as_list(conf.get('required-projects', []))
+            for project in projects:
+                if isinstance(project, dict):
+                    project_name = project['name']
+                    project_override_branch = project.get('override-branch')
                 else:
-                    repo_name = repo
-                    repo_override_branch = None
-                (trusted, project) = tenant.getProject(repo_name)
+                    project_name = project
+                    project_override_branch = None
+                (trusted, project) = tenant.getProject(project_name)
                 if project is None:
-                    raise Exception("Unknown project %s" % (repo_name,))
-                job_repo = model.JobRepo(repo_name,
-                                         repo_override_branch)
-                new_repos[repo_name] = job_repo
-            job.updateRepos(new_repos)
+                    raise Exception("Unknown project %s" % (project_name,))
+                job_project = model.JobProject(project_name,
+                                               project_override_branch)
+                new_projects[project_name] = job_project
+            job.updateProjects(new_projects)
 
         tags = conf.get('tags')
         if tags:
diff --git a/zuul/executor/client.py b/zuul/executor/client.py
index eb1357a..293a38d 100644
--- a/zuul/executor/client.py
+++ b/zuul/executor/client.py
@@ -300,8 +300,8 @@
                         override_branch=override_branch,
                         default_branch=project_default_branch)
 
-        if job.repos:
-            for job_project in job.repos.values():
+        if job.required_projects:
+            for job_project in job.required_projects.values():
                 (trusted, project) = tenant.getProject(
                     job_project.project_name)
                 if project is None:
diff --git a/zuul/model.py b/zuul/model.py
index 3e16302..292353e 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -752,7 +752,7 @@
             attempts=3,
             final=False,
             roles=frozenset(),
-            repos={},
+            required_projects={},
             allowed_projects=None,
         )
 
@@ -820,10 +820,10 @@
         Job._deepUpdate(v, other_vars)
         self.variables = v
 
-    def updateRepos(self, other_repos):
-        repos = self.repos
-        Job._deepUpdate(repos, other_repos)
-        self.repos = repos
+    def updateProjects(self, other_projects):
+        required_projects = self.required_projects
+        Job._deepUpdate(required_projects, other_projects)
+        self.required_projects = required_projects
 
     @staticmethod
     def _deepUpdate(a, b):
@@ -877,7 +877,7 @@
                                         repr(self), k, other._get(k),
                                         repr(other)))
                 if k not in set(['pre_run', 'post_run', 'roles', 'variables',
-                                 'repos']):
+                                 'required_projects']):
                     setattr(self, k, copy.deepcopy(other._get(k)))
 
         # Don't set final above so that we don't trip an error halfway
@@ -893,8 +893,8 @@
             self.roles = self.roles.union(other.roles)
         if other._get('variables') is not None:
             self.updateVariables(other.variables)
-        if other._get('repos') is not None:
-            self.updateRepos(other.repos)
+        if other._get('required_projects') is not None:
+            self.updateProjects(other.required_projects)
 
         for k in self.context_attributes:
             if (other._get(k) is not None and
@@ -922,7 +922,7 @@
         return True
 
 
-class JobRepo(object):
+class JobProject(object):
     """ A reference to a project from a job. """
 
     def __init__(self, project_name, override_branch=None):