diff mbox series

[yocto-autobuilder2,v2,1/2] docs build: make it possible to override repo settings

Message ID 20250110-docs-build-shared-repos-v2-1-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
In the current form when forcing a docs build, the different repo
parameters do nothing and are not propagated. The properties from
props_for_builder() are propagated, but weren't used in the factory
definition.

So use FixedParameters in the codebases definition: this removes the
useless entries in the form (we cannot simply remove the codebases arg
or it triggers another error "No sourcestamp found in build for
codebase"). Then in config.py, populate the "docs" entry in
buildertorepos, so that these show up in the form. Finally, in the docs
factory build, use Interpolate to get the property (I had issues using
util.Property directly).

Note: in latest buildbot version I hit a known bug
https://github.com/buildbot/buildbot/issues/8274. It shouldn't affect us
since we use an older version of Buildbot, but leaving this here just in
case.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 builders.py   | 12 ++++++------
 config.py     |  2 +-
 schedulers.py | 18 +++++++++++++++---
 3 files changed, 22 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/builders.py b/builders.py
index 88ff328c7ec6ecf0f28da2693cc9c0210e760b35..4f2bf00e5387d910f23579028a410e250fccf588 100644
--- a/builders.py
+++ b/builders.py
@@ -382,24 +382,24 @@  def create_doc_builder_factory():
         haltOnFailure=True,
         name="Clobber build dir"))
     f.addStep(steps.Git(
-        repourl=config.repos["yocto-autobuilder-helper"][0],
-        branch=config.repos["yocto-autobuilder-helper"][1],
+        repourl=util.Interpolate("%(prop:repo_yocto-autobuilder-helper)s"),
+        branch=util.Property('branch_yocto-autobuilder-helper'),
         codebase='yab-helper',
         workdir=util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper"),
         mode='incremental',
         haltOnFailure=True,
         name='Fetch yocto-autobuilder-helper'))
     f.addStep(steps.Git(
-        repourl=config.repos["yocto-docs"][0],
-        branch=config.repos["yocto-docs"][1],
+        repourl=util.Interpolate("%(prop:repo_yocto-docs)s"),
+        branch=util.Property('branch_yocto-docs'),
         codebase='yocto-docs',
         workdir=util.Interpolate("%(prop:builddir)s/yocto-docs"),
         mode='incremental',
         haltOnFailure=True,
         name='Fetch yocto-docs'))
     f.addStep(steps.Git(
-        repourl=config.repos["bitbake"][0],
-        branch=config.repos["bitbake"][1],
+        repourl=util.Interpolate("%(prop:repo_bitbake)s"),
+        branch=util.Property('branch_bitbake'),
         codebase='bitbake',
         workdir=util.Interpolate("%(prop:builddir)s/bitbake"),
         mode='incremental',
diff --git a/config.py b/config.py
index 94d0405803fb9c916e06518f12d257e978ffc46e..8e2797aaeed7e2c688983d3d1f3c4b1895d393b8 100644
--- a/config.py
+++ b/config.py
@@ -27,7 +27,7 @@  buildertorepos = {
     "checkuri": ["poky"],
     "check-layer": ["poky", "meta-mingw", "meta-gplv2"],
     "check-layer-nightly": ["poky", "meta-agl", "meta-arm", "meta-aws", "meta-intel", "meta-openembedded", "meta-virtualization", "meta-ti", "meta-security", "meta-clang", "meta-exein"],
-    "docs": [],
+    "docs": ["yocto-autobuilder-helper", "yocto-docs", "bitbake"],
     "reproducible-meta-oe": ["poky", "meta-openembedded"],
     "patchtest": ["poky", "meta-patchtest", "meta-openembedded"],
     "meta-oe-mirror":  ["poky", "meta-openembedded"],
diff --git a/schedulers.py b/schedulers.py
index bbd249a3aec45f60faec6c7f67056050794866a3..a3466d5b596bd0b1e8879a5acabf5ad66ee297a1 100644
--- a/schedulers.py
+++ b/schedulers.py
@@ -498,15 +498,27 @@  schedulers.append(parent_scheduler("a-full"))
 schedulers.append(sched.ForceScheduler(
         name="docs",
         builderNames=["docs"],
+        # Note: we pass FixedParameters here to hide these in the form, since
+        # entries to override the URL and branch are already created thanks to
+        # props_for_builder() below.
         codebases=[util.CodebaseParameter(codebase='yab-helper',
                                           label="yocto-autobuilder-helper:",
-                                          project=None),
+                                          branch=util.FixedParameter(name="branch", default=""),
+                                          revision=util.FixedParameter(name="revision", default=""),
+                                          repository=util.FixedParameter(name="repository", default=""),
+                                          project=util.FixedParameter(name="project", default="")),
                    util.CodebaseParameter(codebase='yocto-docs',
                                           label="yocto-docs:",
-                                          project=None),
+                                          branch=util.FixedParameter(name="branch", default=""),
+                                          revision=util.FixedParameter(name="revision", default=""),
+                                          repository=util.FixedParameter(name="repository", default=""),
+                                          project=util.FixedParameter(name="project", default="")),
                    util.CodebaseParameter(codebase='bitbake',
                                           label="bitbake:",
-                                          project=None),
+                                          branch=util.FixedParameter(name="branch", default=""),
+                                          revision=util.FixedParameter(name="revision", default=""),
+                                          repository=util.FixedParameter(name="repository", default=""),
+                                          project=util.FixedParameter(name="project", default="")),
                    ],
         reason=util.StringParameter(
                 name="reason",