aboutsummaryrefslogtreecommitdiff
path: root/libbrep/common.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-01 23:01:02 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-06 15:09:41 +0300
commit65ba2b47c8d6c83e37fe772a7b54fd6b7480ce17 (patch)
treef24967df1c447e10c43206cf599007e98c24afb7 /libbrep/common.hxx
parentd1662abccb91be4844efc1508ff8b0427019a27c (diff)
Add support for test-exclude task manifest valuemigration-example
Note that the last two commits demonstrate an approach to use for migrating data on the ODB object member type change.
Diffstat (limited to 'libbrep/common.hxx')
-rw-r--r--libbrep/common.hxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/libbrep/common.hxx b/libbrep/common.hxx
index b7fc2da..4aea110 100644
--- a/libbrep/common.hxx
+++ b/libbrep/common.hxx
@@ -323,6 +323,42 @@ namespace brep
#pragma db value(build_constraint) definition
+ // Whether a package is buildable by the build bot controller service and
+ // what is the "main" reason if it is not.
+ //
+ // While we could potentially calculate this status on the fly, that would
+ // complicate the database queries significantly.
+ //
+ enum class buildable_status: std::uint8_t
+ {
+ buildable, // Not a test nor stub, from internal buildable repository.
+ unbuildable, // Not a test nor stub, from internal unbuildable repository.
+ external, // Not a test nor stub, from external repository.
+ test, // Test, not a stub.
+ stub // Stub.
+ };
+
+ string
+ to_string (buildable_status);
+
+ buildable_status
+ to_buildable_status (const string&); // May throw invalid_argument.
+
+ inline ostream&
+ operator<< (ostream& os, buildable_status s) {return os << to_string (s);}
+
+ // Return true if the status is not buildable.
+ //
+ inline bool
+ operator! (buildable_status s)
+ {
+ return s != buildable_status::buildable;
+ }
+
+ #pragma db map type(buildable_status) as(string) \
+ to(to_string (?)) \
+ from(brep::to_buildable_status (?))
+
// Version comparison operators.
//
// They allow comparing objects that have epoch, canonical_upstream,