aboutsummaryrefslogtreecommitdiff
path: root/libbrep/build.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-03-11 21:23:21 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-03-21 18:00:39 +0300
commit7fa57f8522ed7741c00ed3cd64cf956716aebd2c (patch)
tree96a6a22ac86707faefc069bbd0edcbc9431414b0 /libbrep/build.hxx
parent3b53b72fd5691fcb9e684b902efcdd4c36a2da49 (diff)
Add support for build auxiliary machines/configurations
Diffstat (limited to 'libbrep/build.hxx')
-rw-r--r--libbrep/build.hxx45
1 files changed, 41 insertions, 4 deletions
diff --git a/libbrep/build.hxx b/libbrep/build.hxx
index 1e9a9fc..be7cdf5 100644
--- a/libbrep/build.hxx
+++ b/libbrep/build.hxx
@@ -28,7 +28,7 @@
//
#define LIBBREP_BUILD_SCHEMA_VERSION_BASE 20
-#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 24, closed)
+#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 25, closed)
// We have to keep these mappings at the global scope instead of inside the
// brep namespace because they need to be also effective in the bbot namespace
@@ -230,6 +230,13 @@ namespace brep
using bbot::operation_results;
+ #pragma db value
+ struct build_machine
+ {
+ string name;
+ string summary;
+ };
+
#pragma db object pointer(shared_ptr) session
class build
{
@@ -249,7 +256,8 @@ namespace brep
optional<string> interactive,
optional<string> agent_fingerprint,
optional<string> agent_challenge,
- string machine, string machine_summary,
+ build_machine,
+ vector<build_machine> auxiliary_machines,
string controller_checksum,
string machine_checksum);
@@ -262,6 +270,21 @@ namespace brep
string package_config_name,
string toolchain_name, version toolchain_version);
+ // Create the build object with the built state, the specified status and
+ // operation results, all the timestamps set to now, and the force state
+ // set to unforced.
+ //
+ build (string tenant,
+ package_name_type, version,
+ target_triplet,
+ string target_config_name,
+ string package_config_name,
+ string toolchain_name, version toolchain_version,
+ result_status,
+ operation_results,
+ build_machine,
+ vector<build_machine> auxiliary_machines = {});
+
// Move-only type.
//
build (build&&);
@@ -325,8 +348,9 @@ namespace brep
optional<string> agent_fingerprint;
optional<string> agent_challenge;
- string machine;
- string machine_summary;
+ build_machine machine;
+ vector<build_machine> auxiliary_machines;
+ odb::section auxiliary_machines_section;
// Note that the logs are stored as std::string/TEXT which is Ok since
// they are UTF-8 and our database is UTF-8.
@@ -368,6 +392,19 @@ namespace brep
//
#pragma db member(timestamp) index
+ #pragma db member(machine) transient
+
+ #pragma db member(machine_name) virtual(std::string) \
+ access(machine.name) column("machine")
+
+ #pragma db member(machine_summary) virtual(std::string) \
+ access(machine.summary)
+
+ #pragma db member(auxiliary_machines) id_column("") value_column("") \
+ section(auxiliary_machines_section)
+
+ #pragma db member(auxiliary_machines_section) load(lazy) update(always)
+
#pragma db member(results) id_column("") value_column("") \
section(results_section)