Fix dynamic reconfiguration

The dynamic reconfiguration would omit portions of the configuration
which originated from config-repos.  Specifically, pipeline and
semaphore configuration would be copied over because they can not
be changed in dynamic reconfiguration, and are handles as special
cases.  However, all job and project configuration which appeared
in a config-repo would be omitted.  We didn't notice this because
most of our in-repo reconfiguration did not rely on jobs defined
in a config-repo (only project-repos).  The following change does
rely on this and exposed the issue.

Change-Id: Ibaf2d62a6f40bcb1ea96d260d96d6518ee511b85
diff --git a/zuul/configloader.py b/zuul/configloader.py
index ecba760..cc19c0f 100644
--- a/zuul/configloader.py
+++ b/zuul/configloader.py
@@ -1051,14 +1051,16 @@
 
     def _loadDynamicProjectData(self, config, source, project, files,
                                 config_repo):
-        for branch in source.getProjectBranches(project):
-            data = None
-            if config_repo:
-                fn = 'zuul.yaml'
-                data = files.getFile(project.name, branch, fn)
-            if not data:
-                fn = '.zuul.yaml'
-                data = files.getFile(project.name, branch, fn)
+        if config_repo:
+            branches = ['master']
+            fn = 'zuul.yaml'
+        else:
+            branches = source.getProjectBranches(project)
+            fn = '.zuul.yaml'
+
+        for branch in branches:
+            incdata = None
+            data = files.getFile(project.name, branch, fn)
             if data:
                 source_context = model.SourceContext(project, branch,
                                                      fn, config_repo)
@@ -1069,10 +1071,12 @@
                     incdata = TenantParser._parseProjectRepoLayout(
                         data, source_context)
             else:
-                incdata = project.unparsed_branch_config.get(branch)
-            if not incdata:
-                continue
-            config.extend(incdata)
+                if config_repo:
+                    incdata = project.unparsed_config
+                else:
+                    incdata = project.unparsed_branch_config.get(branch)
+            if incdata:
+                config.extend(incdata)
 
     def createDynamicLayout(self, tenant, files, include_config_repos=False):
         if include_config_repos:
@@ -1101,6 +1105,12 @@
         # configuration changes.
         layout.semaphores = tenant.layout.semaphores
 
+        for config_nodeset in config.nodesets:
+            layout.addNodeSet(NodeSetParser.fromYaml(layout, config_nodeset))
+
+        for config_secret in config.secrets:
+            layout.addSecret(SecretParser.fromYaml(layout, config_secret))
+
         for config_job in config.jobs:
             layout.addJob(JobParser.fromYaml(tenant, layout, config_job))