diff mbox series

[yocto-autobuilder2,v2,2/2] schedulers: docs: pass properties to branch schedulers

Message ID 20250110-docs-build-shared-repos-v2-2-a83a7a09915d@bootlin.com
State New
Headers show
Series Fix the docs build parameters | expand

Commit Message

Antonin Godard Jan. 10, 2025, 3:30 p.m. UTC
Unlike the ForceScheduler, the AnyBranchScheduler does not take a list
of parameters but a simple dict. Add a repos_dict_for_scheduler() helper
that returns a dict containing the {repo,branch}_<repo> keys mapping to
the values in config.py. These are used in the factory definition of the
docs build (see the Git steps).

Also add the missing "yab-helper" to the bitbake-docs-changed scheduler.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 schedulers.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/schedulers.py b/schedulers.py
index a3466d5b596bd0b1e8879a5acabf5ad66ee297a1..e4760ed8bf1d02f4edca9af87725cf116630a14b 100644
--- a/schedulers.py
+++ b/schedulers.py
@@ -322,6 +322,19 @@  def repos_for_builder(buildername):
         parameters = parameters + [util.NestedParameter(name='', label=repo, fields=inputs, columns=2)]
     return parameters
 
+def repos_dict_for_scheduler(buildername):
+    """
+    Returns a dict of repository properties for a scheduler.
+    """
+    props = {}
+    repos = config.buildertorepos.get(buildername)
+    if repos is None:
+        repos = config.buildertorepos["default"]
+    for repo in repos:
+        props["repo_{}".format(repo)] = config.repos[repo][0]
+        props["branch_{}".format(repo)] = config.repos[repo][1]
+    return props
+
 def parent_default_props(buildername, branchname=None):
     props = {}
     props["swat_monitor"] = True
@@ -593,6 +606,7 @@  schedulers.append(sched.AnyBranchScheduler(name="yocto-docs-changed",
             change_filter=util.ChangeFilter(project=["yocto-docs"], branch=[None, "master", "master-next", "styhead", "scarthgap", "mickledore", "langdale", "kirkstone", "honister", "hardknott", "gatesgarth", "dunfell", "transition"]),
             codebases = ['yab-helper', 'yocto-docs', 'bitbake'],
             treeStableTimer=60,
+            properties=repos_dict_for_scheduler("docs"),
             builderNames=["docs"]))
 
 # If bitbake's sphinx docs change, trigger a build
@@ -603,10 +617,11 @@  def isbitbakeDocFile(change):
     return False
 schedulers.append(sched.AnyBranchScheduler(name="bitbake-docs-changed",
             change_filter=util.ChangeFilter(project=["bitbake"], branch=["master", "2.10", "2.8", "2.0"]),
-            codebases = ['', 'yocto-docs', 'bitbake'],
+            codebases = ['yab-helper', 'yocto-docs', 'bitbake'],
             fileIsImportant=isbitbakeDocFile,
             onlyImportant=True,
             treeStableTimer=60,
+            properties=repos_dict_for_scheduler("docs"),
             builderNames=["docs"]))
 
 # Run meta-webosose for kirkstone once a week on weekends (2am on Friday)