aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github-service-data.hxx
diff options
context:
space:
mode:
authorFrancois Kritzinger <francois@codesynthesis.com>2024-05-17 14:37:30 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-12-10 16:34:15 +0200
commit99a76da2a6c6b9ea4db63e1eba08d59869f6133c (patch)
treef47c66e67197925c44d273b420ab21d482a7c557 /mod/mod-ci-github-service-data.hxx
parentf5e1c04c0a1168a0782948d5f6f17bc8f6ceefbb (diff)
Handle pull requests
Diffstat (limited to 'mod/mod-ci-github-service-data.hxx')
-rw-r--r--mod/mod-ci-github-service-data.hxx38
1 files changed, 36 insertions, 2 deletions
diff --git a/mod/mod-ci-github-service-data.hxx b/mod/mod-ci-github-service-data.hxx
index c4e20b3..21c8a8f 100644
--- a/mod/mod-ci-github-service-data.hxx
+++ b/mod/mod-ci-github-service-data.hxx
@@ -59,10 +59,31 @@ namespace brep
string repository_node_id; // GitHub-internal opaque repository id.
- string head_sha;
+ // The following two are only used for pull requests.
+ //
+ // @@ TODO/LATER: maybe put them in a struct?
+ //
+ optional<string> repository_clone_url;
+ optional<uint32_t> pr_number;
+
+ // The GitHub ID of the synthetic PR merge check run or absent if it
+ // hasn't been created yet.
+ //
+ optional<string> merge_node_id;
+
+ // The commit ID the check suite or pull request (and its check runs) are
+ // reporting to. Note that in the case of a pull request this will be the
+ // head commit (`pull_request.head.sha`) as opposed to the merge commit.
+ //
+ string report_sha;
vector<check_run> check_runs;
+ // The GitHub ID of the synthetic conclusion check run or absent if it
+ // hasn't been created yet. See also merge_node_id above.
+ //
+ optional<string> conclusion_node_id;
+
// Return the check run with the specified build ID or nullptr if not
// found.
//
@@ -76,12 +97,25 @@ namespace brep
explicit
service_data (const string& json);
+ // The check_suite constructor.
+ //
+ service_data (bool warning_success,
+ string iat_token,
+ timestamp iat_expires_at,
+ uint64_t installation_id,
+ string repository_node_id,
+ string report_sha);
+
+ // The pull_request constructor.
+ //
service_data (bool warning_success,
string iat_token,
timestamp iat_expires_at,
uint64_t installation_id,
string repository_node_id,
- string head_sha);
+ string report_sha,
+ string repository_clone_url,
+ uint32_t pr_number);
service_data () = default;