aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-10-23 20:58:32 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-12-10 16:34:15 +0200
commit630834173bba497c9f21eb0459ba5cb7264346ee (patch)
tree212949d95c28b71d34b4989b47c15b8a541380c2 /mod
parent33fce80ada305a5c3489e5716d515106b0fe73b2 (diff)
Add suppport for build-task tenant_service_type parameter
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-build-task.cxx35
-rw-r--r--mod/module.cli7
2 files changed, 42 insertions, 0 deletions
diff --git a/mod/mod-build-task.cxx b/mod/mod-build-task.cxx
index 917017b..2ae1237 100644
--- a/mod/mod-build-task.cxx
+++ b/mod/mod-build-task.cxx
@@ -203,6 +203,41 @@ package_query (bool custom_bot,
query::build_repository::id.canonical_name.in_range (rp.begin (),
rp.end ());
+ // Filter by the types of services associated with the tenants, where the
+ // empty type denotes tenants without associated service.
+ //
+ if (params.tenant_service_type_specified ())
+ {
+ cstrings ts;
+ bool et (false);
+
+ for (const string& t: params.tenant_service_type ())
+ {
+ if (!t.empty ())
+ ts.push_back (t.c_str ());
+ else
+ et = true;
+ }
+
+ if (!ts.empty () && et)
+ {
+ q = q &&
+ (query::build_tenant::service.type.in_range (ts.begin (), ts.end ()) ||
+ query::build_tenant::service.type.is_null ());
+ }
+ else if (!ts.empty ())
+ {
+ q = q && query::build_tenant::service.type.in_range (ts.begin (),
+ ts.end ());
+ }
+ else
+ {
+ assert (et);
+
+ q = q && query::build_tenant::service.type.is_null ();
+ }
+ }
+
// If the interactive mode is false or true, then filter out the respective
// packages.
//
diff --git a/mod/module.cli b/mod/module.cli
index 0c6785f..ca750e9 100644
--- a/mod/module.cli
+++ b/mod/module.cli
@@ -1001,6 +1001,13 @@ namespace brep
// Only consider tenants with this interactive build mode.
//
bbot::interactive_mode interactive = bbot::interactive_mode::both;
+
+ // Only consider tenants which have third-party services of any of these
+ // types. The special empty type value denotes tenants without the
+ // associated service. If this parameter is absent, then consider all
+ // tenant types.
+ //
+ vector<string> tenant_service_type | t;
};
class build_result