aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-03-18 12:30:00 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-10-15 09:05:27 +0200
commitb49feeaee7953b7f675cbdef29e7466eab19781a (patch)
tree39e9fb34060eda764f492fe4903a30ac6010e989 /mod/mod-ci-github.cxx
parent850aa60247642fe668bce8c3a78fd73b7aad5adf (diff)
Review
Diffstat (limited to 'mod/mod-ci-github.cxx')
-rw-r--r--mod/mod-ci-github.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx
index 5ef1a82..d920031 100644
--- a/mod/mod-ci-github.cxx
+++ b/mod/mod-ci-github.cxx
@@ -305,16 +305,28 @@ namespace brep
}
}
- // Tenant service data.
+ // Service data associated with the tenant/check suite.
+ //
+ // It is always a top-level JSON object and the first member is always the
+ // schema version.
//
struct service_data
{
- string installation_access_token;
- string repository_id;
+ // The data schema version. Note: must be first member in the object.
+ //
+ uint64_t version = 1;
+
+ // Check suite-global data.
+ //
+ installation_access_token installation_access;
+
+ string repository_id; // GitHub-internal opaque repository id.
string head_sha;
// Construct from JSON.
//
+ // @@ Load version and check that == 1.
+ //
explicit
service_data (const string& json);
@@ -329,6 +341,9 @@ namespace brep
{
HANDLER_DIAG;
+ // @@ Let's turn this into l3 traces (grep for l2 to see examples).
+ //
+
cout << "<check_suite event>" << endl << cs << endl;
installation_access_token iat (
@@ -346,6 +361,9 @@ namespace brep
cs.repository.node_id,
cs.check_suite.head_sha));
+ // @@ TODO: use GitHub check suite id. I think node_id?
+ //
+
optional<start_result> r (
start (error,
warn,
@@ -850,6 +868,9 @@ namespace brep
resp () = default;
} rs;
+ // @@ TODO: need to check if installation access token expired. If so,
+ // get new one and update it in the service_data.
+
try
{
uint16_t sc (github_post (