aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github.cxx
diff options
context:
space:
mode:
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 (