aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github-gq.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'mod/mod-ci-github-gq.hxx')
-rw-r--r--mod/mod-ci-github-gq.hxx42
1 files changed, 40 insertions, 2 deletions
diff --git a/mod/mod-ci-github-gq.hxx b/mod/mod-ci-github-gq.hxx
index 8f7a9ca..9721b6e 100644
--- a/mod/mod-ci-github-gq.hxx
+++ b/mod/mod-ci-github-gq.hxx
@@ -38,6 +38,8 @@ namespace brep
// state and the node ID. Return false and issue diagnostics if the request
// failed.
//
+ // If the details_url is absent GitHub will use the app's homepage.
+ //
// The gq_built_result is required if the build_state is built because
// GitHub does not allow a check run status of `completed` without at least
// a conclusion.
@@ -55,7 +57,7 @@ namespace brep
const string& installation_access_token,
const string& repository_id,
const string& head_sha,
- const string& details_url,
+ const optional<string>& details_url,
build_state,
optional<gq_built_result> = nullopt);
@@ -65,6 +67,8 @@ namespace brep
// with the new state. Return false and issue diagnostics if the request
// failed.
//
+ // If the details_url is absent GitHub will use the app's homepage.
+ //
// The gq_built_result is required if the build_state is built because
// GitHub does not allow a check run status of `completed` without at least
// a conclusion.
@@ -75,9 +79,43 @@ namespace brep
const string& installation_access_token,
const string& repository_id,
const string& node_id,
- const string& details_url,
+ const optional<string>& details_url,
build_state,
optional<gq_built_result> = nullopt);
+
+ // Fetch a pull request's mergeability from GitHub and return it in first,
+ // or absent if the merge commit is still being generated.
+ //
+ // Return false in second and issue diagnostics if the request failed.
+ //
+ struct gq_pr_mergeability
+ {
+ // True if the pull request is auto-mergeable; false if it would create
+ // conflicts.
+ //
+ bool mergeable;
+
+ // The ID of the test merge commit. Empty if mergeable is false.
+ //
+ string merge_commit_id;
+ };
+
+
+ // Fetch a pull request's mergeability from GitHub. Return absent value if
+ // the merge commit is still being generated. Return empty string if the
+ // pull request is not auto-mergeable. Otherwise return the test merge
+ // commit id.
+ //
+ // Issue diagnostics and return absent if the request failed (which means it
+ // will be treated by the caller as still being generated).
+ //
+ // Note that the first request causes GitHub to start preparing the test
+ // merge commit.
+ //
+ optional<string>
+ gq_pull_request_mergeable (const basic_mark& error,
+ const string& installation_access_token,
+ const string& node_id);
}
#endif // MOD_MOD_CI_GITHUB_GQ_HXX