diff options
author | Francois Kritzinger <francois@codesynthesis.com> | 2024-04-30 14:38:08 +0200 |
---|---|---|
committer | Francois Kritzinger <francois@codesynthesis.com> | 2024-10-15 09:05:28 +0200 |
commit | a05f09a08fe14f1c9a896975cfa3aed605574695 (patch) | |
tree | 497d72b6b4f9d2e5b61e68e03b373ff1e80b431f /mod/mod-ci-github.cxx | |
parent | 47dd5a71330556342c765ba282d7acdec5c4d75a (diff) |
Post-review changes
Diffstat (limited to 'mod/mod-ci-github.cxx')
-rw-r--r-- | mod/mod-ci-github.cxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx index 29097be..52431d2 100644 --- a/mod/mod-ci-github.cxx +++ b/mod/mod-ci-github.cxx @@ -5,6 +5,8 @@ #include <libbutl/json/parser.hxx> +#include <web/server/mime-url-encoding.hxx> // mime_url_encode() + #include <mod/jwt.hxx> #include <mod/hmac.hxx> #include <mod/module-options.hxx> @@ -711,6 +713,7 @@ namespace brep iat->token, sd.repository_id, *cr->node_id, + details_url (b), build_state::building)) { // Do nothing further if the state was already built on GitHub (note @@ -851,6 +854,12 @@ namespace brep // instead of passing it to gq_*() functions? Let's see how we handle // the report. + // @@ TODO Summary + // + gq_built_result br (gh_to_conclusion (*b.status, sd.warning_success), + ucase (to_string (*b.status)), + "SUMMARY"); + if (cr.node_id) { // Update existing check run to built. @@ -860,8 +869,9 @@ namespace brep iat->token, sd.repository_id, *cr.node_id, + "", // Don't update details_url again. build_state::built, - *b.status, sd.warning_success)) + move (br))) { assert (cr.state == build_state::built); @@ -883,8 +893,9 @@ namespace brep iat->token, sd.repository_id, sd.head_sha, + details_url (b), build_state::built, - *b.status, sd.warning_success)) + move (br))) { assert (cr.state == build_state::built); @@ -938,6 +949,20 @@ namespace brep }; } + string ci_github:: + details_url (const build& b) const + { + return options_->host () + + "/@" + b.tenant + + "?builds=" + mime_url_encode (b.package_name.string ()) + + "&pv=" + b.package_version.string () + + "&tg=" + mime_url_encode (b.target.string ()) + + "&tc=" + mime_url_encode (b.target_config_name) + + "&pc=" + mime_url_encode (b.package_config_name) + + "&th=" + mime_url_encode (b.toolchain_version.string ()) + + "&rs=*"; + } + optional<string> ci_github:: generate_jwt (const basic_mark& trace, const basic_mark& error) const |