diff options
-rw-r--r-- | mod/mod-build-force.cxx | 9 | ||||
-rw-r--r-- | mod/mod-build-result.cxx | 10 | ||||
-rw-r--r-- | mod/mod-build-task.cxx | 18 | ||||
-rw-r--r-- | mod/mod-ci.cxx | 4 | ||||
-rw-r--r-- | mod/mod-ci.hxx | 4 | ||||
-rw-r--r-- | mod/tenant-service.hxx | 31 |
6 files changed, 34 insertions, 42 deletions
diff --git a/mod/mod-build-force.cxx b/mod/mod-build-force.cxx index 780bd40..ea921e9 100644 --- a/mod/mod-build-force.cxx +++ b/mod/mod-build-force.cxx @@ -188,7 +188,7 @@ handle (request& rq, response& rs) // const tenant_service_build_queued* tsq (nullptr); optional<pair<tenant_service, shared_ptr<build>>> tss; - tenant_service_base::build_hints bhs; + tenant_service_build_queued::build_queued_hints qhs; // Acquire the database connection for the subsequent transactions. // @@ -269,9 +269,8 @@ handle (request& rq, response& rs) shared_ptr<build_package> p ( build_db_->load<build_package> (b->id.package)); - bhs = - tenant_service_base::build_hints {tpc == 1, - p->configs.size () == 1}; + qhs = tenant_service_build_queued::build_queued_hints { + tpc == 1, p->configs.size () == 1}; // Set the package tenant's queued timestamp. // @@ -312,7 +311,7 @@ handle (request& rq, response& rs) if (auto f = tsq->build_queued (ss, qbs, build_state::building, - bhs, + qhs, log_writer_)) { conn = build_db_->connection (); diff --git a/mod/mod-build-result.cxx b/mod/mod-build-result.cxx index 3ee1f57..3ba18e1 100644 --- a/mod/mod-build-result.cxx +++ b/mod/mod-build-result.cxx @@ -203,7 +203,7 @@ handle (request& rq, response&) const tenant_service_build_built* tsb (nullptr); const tenant_service_build_queued* tsq (nullptr); optional<pair<tenant_service, shared_ptr<build>>> tss; - tenant_service_base::build_hints bhs; + tenant_service_build_queued::build_queued_hints qhs; // Acquire the database connection for the subsequent transactions. // @@ -357,8 +357,8 @@ handle (request& rq, response&) shared_ptr<build_package> p ( build_db_->load<build_package> (b->id.package)); - bhs = tenant_service_base::build_hints {tpc == 1, - p->configs.size () == 1}; + qhs = tenant_service_build_queued::build_queued_hints { + tpc == 1, p->configs.size () == 1}; // Set the package tenant's queued timestamp. // @@ -531,7 +531,7 @@ handle (request& rq, response&) if (auto f = tsq->build_queued (ss, qbs, build_state::building, - bhs, + qhs, log_writer_)) { conn = build_db_->connection (); @@ -555,7 +555,7 @@ handle (request& rq, response&) // conn.reset (); - if (auto f = tsb->build_built (ss, b, bhs, log_writer_)) + if (auto f = tsb->build_built (ss, b, log_writer_)) { conn = build_db_->connection (); update_tenant_service_state (conn, b.tenant, f); diff --git a/mod/mod-build-task.cxx b/mod/mod-build-task.cxx index 305aaca..6be77f6 100644 --- a/mod/mod-build-task.cxx +++ b/mod/mod-build-task.cxx @@ -1109,7 +1109,7 @@ handle (request& rq, response& rs) const tenant_service_build_queued* tsq (nullptr); optional<pair<tenant_service, shared_ptr<build>>> tss; vector<build> qbs; - tenant_service_base::build_hints bhs; + tenant_service_build_queued::build_queued_hints qhs; optional<build_state> initial_state; bool rebuild_forced_build (false); bool rebuild_interrupted_rebuild (false); @@ -1181,14 +1181,14 @@ handle (request& rq, response& rs) return r; }; - auto build_hints = [this] (const build_package& p) + auto queue_hints = [this] (const build_package& p) { buildable_package_count tpc ( build_db_->query_value<buildable_package_count> ( query<buildable_package_count>::build_tenant::id == p.id.tenant)); - return tenant_service_base::build_hints {tpc == 1, - p.configs.size () == 1}; + return tenant_service_build_queued::build_queued_hints { + tpc == 1, p.configs.size () == 1}; }; // Collect the auxiliary machines required for testing of the specified @@ -1975,7 +1975,7 @@ handle (request& rq, response& rs) (*initial_state != build_state::queued && !rebuild_forced_build)) { - bhs = build_hints (*p); + qhs = queue_hints (*p); t->queued_timestamp = system_clock::now (); build_db_->update (t); @@ -2215,8 +2215,6 @@ handle (request& rq, response& rs) tsb = dynamic_cast<const tenant_service_build_building*> (s); tsq = dynamic_cast<const tenant_service_build_queued*> (s); - bhs = build_hints (*p); - if (tsq != nullptr) { qbs = queue_builds (*p, *b); @@ -2230,6 +2228,8 @@ handle (request& rq, response& rs) // if (!qbs.empty () || !rebuild_interrupted_rebuild) { + qhs = queue_hints (*p); + t->queued_timestamp = system_clock::now (); build_db_->update (t); } @@ -2312,7 +2312,7 @@ handle (request& rq, response& rs) if (auto f = tsq->build_queued (ss, qbs, nullopt /* initial_state */, - bhs, + qhs, log_writer_)) { conn = build_db_->connection (); @@ -2344,7 +2344,7 @@ handle (request& rq, response& rs) if (auto f = tsq->build_queued (ss, qbs, initial_state, - bhs, + qhs, log_writer_)) { conn = build_db_->connection (); diff --git a/mod/mod-ci.cxx b/mod/mod-ci.cxx index 30e3648..8c47bc4 100644 --- a/mod/mod-ci.cxx +++ b/mod/mod-ci.cxx @@ -426,7 +426,7 @@ function<optional<string> (const brep::tenant_service&)> brep::ci:: build_queued (const tenant_service&, const vector<build>& bs, optional<build_state> initial_state, - const build_hints& hints, + const build_queued_hints& hints, const diag_epilogue& log_writer) const noexcept { NOTIFICATION_DIAG (log_writer); @@ -470,7 +470,6 @@ build_queued (const tenant_service&, function<optional<string> (const brep::tenant_service&)> brep::ci:: build_building (const tenant_service&, const build& b, - const build_hints&, const diag_epilogue&) const noexcept { return [&b] (const tenant_service& ts) @@ -491,7 +490,6 @@ build_building (const tenant_service&, function<optional<string> (const brep::tenant_service&)> brep::ci:: build_built (const tenant_service&, const build& b, - const build_hints&, const diag_epilogue&) const noexcept { return [&b] (const tenant_service& ts) diff --git a/mod/mod-ci.hxx b/mod/mod-ci.hxx index d7617f4..bd91e99 100644 --- a/mod/mod-ci.hxx +++ b/mod/mod-ci.hxx @@ -75,19 +75,17 @@ namespace brep build_queued (const tenant_service&, const vector<build>&, optional<build_state> initial_state, - const build_hints&, + const build_queued_hints&, const diag_epilogue& log_writer) const noexcept override; virtual function<optional<string> (const tenant_service&)> build_building (const tenant_service&, const build&, - const build_hints&, const diag_epilogue& log_writer) const noexcept override; virtual function<optional<string> (const tenant_service&)> build_built (const tenant_service&, const build&, - const build_hints&, const diag_epilogue& log_writer) const noexcept override; #ifdef BREP_CI_TENANT_SERVICE_UNLOADED diff --git a/mod/tenant-service.hxx b/mod/tenant-service.hxx index 3f1896b..c46cb7b 100644 --- a/mod/tenant-service.hxx +++ b/mod/tenant-service.hxx @@ -18,20 +18,6 @@ namespace brep class tenant_service_base { public: - - // The build_hints can be used to omit certain components from the build - // id. If single_package_version is true, then this tenant contains a - // single (non-test) package version and this package name and package - // version can be omitted. If single_package_config is true, then the - // package version being built only has the default package configuration - // and thus it can be omitted. - // - struct build_hints - { - bool single_package_version; - bool single_package_config; - }; - virtual ~tenant_service_base () = default; }; @@ -100,11 +86,24 @@ namespace brep // the function name suffix (_queued, _building, _built) signify the // logical end state. // + // The build_queued_hints can be used to omit certain components from the + // build id. If single_package_version is true, then this tenant contains + // a single (non-test) package version and this package name and package + // version can be omitted. If single_package_config is true, then the + // package version being built only has the default package configuration + // and thus it can be omitted. + // + struct build_queued_hints + { + bool single_package_version; + bool single_package_config; + }; + virtual function<optional<string> (const tenant_service&)> build_queued (const tenant_service&, const vector<build>&, optional<build_state> initial_state, - const build_hints&, + const build_queued_hints&, const diag_epilogue& log_writer) const noexcept = 0; }; @@ -114,7 +113,6 @@ namespace brep virtual function<optional<string> (const tenant_service&)> build_building (const tenant_service&, const build&, - const build_hints&, const diag_epilogue& log_writer) const noexcept = 0; }; @@ -124,7 +122,6 @@ namespace brep virtual function<optional<string> (const tenant_service&)> build_built (const tenant_service&, const build&, - const build_hints&, const diag_epilogue& log_writer) const noexcept = 0; }; |