diff options
author | Francois Kritzinger <francois@codesynthesis.com> | 2024-10-22 07:05:57 +0200 |
---|---|---|
committer | Francois Kritzinger <francois@codesynthesis.com> | 2024-10-22 07:56:00 +0200 |
commit | a4c1f60c813783722d889a30d0d98aff177633bf (patch) | |
tree | 658d9ffe61501671206855860349a31272844b0f /mod/mod-ci-github.cxx | |
parent | de4d7616b37f7d0c3bb3a2f0a3a60e4693472675 (diff) |
Get building again
Diffstat (limited to 'mod/mod-ci-github.cxx')
-rw-r--r-- | mod/mod-ci-github.cxx | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx index 56f6d89..b9dc80f 100644 --- a/mod/mod-ci-github.cxx +++ b/mod/mod-ci-github.cxx @@ -825,8 +825,32 @@ namespace brep } function<optional<string> (const tenant_service&)> ci_github:: - build_unloaded_pre_check (service_data&& sd, - const diag_epilogue& log_writer) const noexcept + build_unloaded (tenant_service&& ts, + const diag_epilogue& log_writer) const noexcept + { + NOTIFICATION_DIAG (log_writer); + + service_data sd; + try + { + sd = service_data (*ts.data); + } + catch (const invalid_argument& e) + { + error << "failed to parse service data: " << e; + return nullptr; + } + + return sd.pre_check + ? build_unloaded_pre_check (move (ts), move (sd), log_writer) + : build_unloaded_load (move (ts), move (sd), log_writer); + } + + function<optional<string> (const tenant_service&)> ci_github:: + build_unloaded_pre_check ( + tenant_service&&, + service_data&& sd, + const diag_epilogue& log_writer) const noexcept { NOTIFICATION_DIAG (log_writer); @@ -842,9 +866,13 @@ namespace brep } function<optional<string> (const tenant_service&)> ci_github:: - build_unloaded_load (service_data&& sd, - const diag_epilogue& log_writer) const noexcept + build_unloaded_load ( + tenant_service&& ts, + service_data&& sd, + const diag_epilogue& log_writer) const noexcept { + NOTIFICATION_DIAG (log_writer); + // @@@ TODO: load the tenant: should be the same for both branch push and // PR. // @@ -1204,28 +1232,6 @@ namespace brep }; } - function<optional<string> (const tenant_service&)> ci_github:: - build_unloaded (tenant_service&& ts, - const diag_epilogue& log_writer) const noexcept - { - NOTIFICATION_DIAG (log_writer); - - service_data sd; - try - { - sd = service_data (*ts.data); - } - catch (const invalid_argument& e) - { - error << "failed to parse service data: " << e; - return nullptr; - } - - return sd.pre_check - ? build_unloaded_pre_check (move (sd), log_writer) - : build_unloaded_load (move (sd), log_writer) - } - // Build state change notifications (see tenant-services.hxx for // background). Mapping our state transitions to GitHub pose multiple // problems: @@ -2017,7 +2023,7 @@ namespace brep *build_db_, move (ts), chrono::seconds (30) /* interval */, chrono::seconds (0) /* delay */) - .has_value (); + .first.has_value (); // @@ TODO HACKED AROUND } string ci_github:: |