aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github-gq.hxx
diff options
context:
space:
mode:
authorFrancois Kritzinger <francois@codesynthesis.com>2024-12-10 16:27:24 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-12-10 16:32:40 +0200
commitc7cb981910fd97128ca5e3f7aa77355a18a56738 (patch)
tree1a93dd62a9ee676cf62253af28f849f0f61da28b /mod/mod-ci-github-gq.hxx
parenteedef97cd9679ae68d7c989f194d957a35a00dd1 (diff)
Handle queued, building notifications
Diffstat (limited to 'mod/mod-ci-github-gq.hxx')
-rw-r--r--mod/mod-ci-github-gq.hxx67
1 files changed, 67 insertions, 0 deletions
diff --git a/mod/mod-ci-github-gq.hxx b/mod/mod-ci-github-gq.hxx
new file mode 100644
index 0000000..3d8c6cc
--- /dev/null
+++ b/mod/mod-ci-github-gq.hxx
@@ -0,0 +1,67 @@
+// file : mod/mod-ci-github-gq.hxx -*- C++ -*-
+// license : MIT; see accompanying LICENSE file
+
+#ifndef MOD_MOD_CI_GITHUB_GQ_HXX
+#define MOD_MOD_CI_GITHUB_GQ_HXX
+
+#include <libbrep/types.hxx>
+#include <libbrep/utility.hxx>
+
+#include <libbrep/build.hxx>
+
+#include <mod/tenant-service.hxx> // build_hints
+
+#include <mod/mod-ci-github-gh.hxx>
+#include <mod/mod-ci-github-service-data.hxx>
+
+namespace brep
+{
+ // GraphQL functions (all start with gq_).
+ //
+
+ // Create a new check run on GitHub for each build. Update `check_runs` with
+ // the new states and node IDs. Return false and issue diagnostics if the
+ // request failed.
+ //
+ bool
+ gq_create_check_runs (vector<check_run>& check_runs,
+ const string& installation_access_token,
+ const string& repository_id,
+ const string& head_sha,
+ const vector<reference_wrapper<const build>>&,
+ build_state,
+ const build_queued_hints&,
+ const basic_mark& error);
+
+ // Create a new check run on GitHub for a build. Update `cr` with the new
+ // state and the node ID. Return false and issue diagnostics if the request
+ // failed.
+ //
+ bool
+ gq_create_check_run (check_run& cr,
+ const string& installation_access_token,
+ const string& repository_id,
+ const string& head_sha,
+ const build&,
+ build_state,
+ const build_queued_hints&,
+ const basic_mark& error);
+
+ // Update a check run on GitHub.
+ //
+ // Send a GraphQL request that updates an existing check run. Update `cr`
+ // with the new state. Return false and issue diagnostics if the request
+ // failed.
+ //
+ // @@ TODO Support conclusion, output, etc.
+ //
+ bool
+ gq_update_check_run (check_run& cr,
+ const string& installation_access_token,
+ const string& repository_id,
+ const string& node_id,
+ build_state,
+ const basic_mark& error);
+}
+
+#endif // MOD_MOD_CI_GITHUB_GQ_HXX