diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-03-18 22:17:49 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-03-27 17:28:44 +0300 |
commit | 35359f038f571dc46de3d14af72a2bc911fb0a24 (patch) | |
tree | de3e89d678e78b9efc4d395274fd7ccc68f4a213 /mod/mod-builds.cxx | |
parent | 8ad672cc7211952716ffe1fbf76c179b4f1149e3 (diff) |
Implement brep-monitor
Diffstat (limited to 'mod/mod-builds.cxx')
-rw-r--r-- | mod/mod-builds.cxx | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/mod/mod-builds.cxx b/mod/mod-builds.cxx index 77ebc05..ab9e93e 100644 --- a/mod/mod-builds.cxx +++ b/mod/mod-builds.cxx @@ -16,9 +16,10 @@ #include <libbbot/manifest.hxx> // to_result_status(), to_string(result_status) -#include <web/xhtml.hxx> -#include <web/module.hxx> -#include <web/mime-url-encoding.hxx> +#include <web/server/module.hxx> +#include <web/server/mime-url-encoding.hxx> + +#include <web/xhtml/serialization.hxx> #include <libbrep/build.hxx> #include <libbrep/build-odb.hxx> @@ -26,7 +27,7 @@ #include <libbrep/build-package-odb.hxx> #include <mod/page.hxx> -#include <mod/options.hxx> +#include <mod/module-options.hxx> using namespace std; using namespace butl; @@ -231,7 +232,10 @@ build_query (const brep::cstrings* configs, else { query sq (qb::status == rs); - result_status st (to_result_status(rs)); // May throw invalid_argument. + + // May throw invalid_argument. + // + result_status st (to_result_status (rs)); if (st != result_status::success) { @@ -312,22 +316,6 @@ package_query (const brep::params::builds& params, return q; } -template <typename T, typename ID> -static inline query<T> -package_id_eq (const ID& x, const brep::package_id& y) -{ - using query = query<T>; - const auto& qv (x.version); - - return - x.tenant == query::_ref (y.tenant) && - x.name == query::_ref (y.name) && - qv.epoch == query::_ref (y.version.epoch) && - qv.canonical_upstream == query::_ref (y.version.canonical_upstream) && - qv.canonical_release == query::_ref (y.version.canonical_release) && - qv.revision == query::_ref (y.version.revision); -} - static const vector<pair<string, string>> build_results ({ {"unbuilt", "<unbuilt>"}, {"*", "*"}, @@ -821,9 +809,8 @@ handle (request& rq, response& rs) const auto& bid (bld_query::build::id); - bld_query bq ( - package_id_eq<package_build_count> (bid.package, id) && - bid.configuration == bld_query::_ref (config) && + bld_query bq (equal<package_build_count> (bid.package, id) && + bid.configuration == bld_query::_ref (config) && // Note that the query already constrains configurations via the // configuration name and the tenant via the build package id. @@ -936,7 +923,7 @@ handle (request& rq, response& rs) package_id id; bld_query bq ( - package_id_eq<package_build> (bld_query::build::id.package, id) && + equal<package_build> (bld_query::build::id.package, id) && // Note that the query already constrains the tenant via the build // package id. |