aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github-gh.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'mod/mod-ci-github-gh.hxx')
-rw-r--r--mod/mod-ci-github-gh.hxx36
1 files changed, 24 insertions, 12 deletions
diff --git a/mod/mod-ci-github-gh.hxx b/mod/mod-ci-github-gh.hxx
index b29904b..324dd8a 100644
--- a/mod/mod-ci-github-gh.hxx
+++ b/mod/mod-ci-github-gh.hxx
@@ -21,8 +21,6 @@ namespace butl
namespace brep
{
- // @@@ Check if any data members are unused (once the dust settles).
-
using build_queued_hints = tenant_service_build_queued::build_queued_hints;
// GitHub request/response types (all start with gh_).
@@ -53,6 +51,9 @@ namespace brep
optional<string> head_branch;
string head_sha;
+ size_t check_runs_count;
+ optional<string> conclusion;
+
explicit
gh_check_suite (json::parser&);
@@ -87,15 +88,12 @@ namespace brep
string node_id;
unsigned int number;
- // @@ TMP The unused base/head members may be useful for trace output when
- // we receive the pull_request webhook.
-
string base_path; // Repository path (<org>/<repo>) under github.com.
- string base_ref; // @@ TODO Remove if remains unused.
- string base_sha; // @@ TODO Remove if remains unused.
+ string base_ref;
+ string base_sha;
string head_path;
- string head_ref; // @@ TODO Remove if remains unused.
+ string head_ref;
string head_sha;
explicit
@@ -107,7 +105,7 @@ namespace brep
// Return the GitHub check run status corresponding to a build_state.
//
string
- gh_to_status (build_state st);
+ gh_to_status (build_state);
// Return the build_state corresponding to a GitHub check run status
// string. Throw invalid_argument if the passed status was invalid.
@@ -115,8 +113,11 @@ namespace brep
build_state
gh_from_status (const string&);
- // If warning_success is true, then map result_status::warning to SUCCESS
- // and to FAILURE otherwise.
+ // If warning_success is true, then map result_status::warning to `success`
+ // and to `failure` otherwise.
+ //
+ // Throw invalid_argument in case of unsupported result_status value
+ // (currently skip, interrupt).
//
string
gh_to_conclusion (result_status, bool warning_success);
@@ -130,7 +131,6 @@ namespace brep
struct gh_repository
{
string node_id;
- string name;
string path; // Repository path (<org>/<repo>) under github.com.
string clone_url;
@@ -183,6 +183,12 @@ namespace brep
string action;
gh_pull_request pull_request;
+
+ // The SHA of the previous commit on the head branch before the current
+ // one. Only present if action is "synchronize".
+ //
+ optional<string> before;
+
gh_repository repository;
gh_installation installation;
@@ -205,9 +211,15 @@ namespace brep
gh_installation_access_token () = default;
};
+ // Throw system_error if the conversion fails due to underlying operating
+ // system errors.
+ //
string
gh_to_iso8601 (timestamp);
+ // Throw invalid_argument if the conversion fails due to the invalid
+ // argument and system_error if due to underlying operating system errors.
+ //
timestamp
gh_from_iso8601 (const string&);