From 65ba2b47c8d6c83e37fe772a7b54fd6b7480ce17 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 1 Apr 2020 23:01:02 +0300 Subject: Add support for test-exclude task manifest value Note that the last two commits demonstrate an approach to use for migrating data on the ODB object member type change. --- libbrep/common.hxx | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'libbrep/common.hxx') 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, -- cgit v1.1