diff options
author | Francois Kritzinger <francois@codesynthesis.com> | 2024-05-24 09:38:04 +0200 |
---|---|---|
committer | Francois Kritzinger <francois@codesynthesis.com> | 2024-10-15 09:05:28 +0200 |
commit | 02a1142400a2620f53c700bab2b51e8176d33750 (patch) | |
tree | 4c72a8b0f57d9e41e4422c2a0062558bd9267bfc /mod/mod-ci-github-gq.hxx | |
parent | 2b03038101724c7706c064d75bc38a485b7cea20 (diff) |
Fetch pull request mergeability
Diffstat (limited to 'mod/mod-ci-github-gq.hxx')
-rw-r--r-- | mod/mod-ci-github-gq.hxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mod/mod-ci-github-gq.hxx b/mod/mod-ci-github-gq.hxx index 8f7a9ca..7a15b5e 100644 --- a/mod/mod-ci-github-gq.hxx +++ b/mod/mod-ci-github-gq.hxx @@ -78,6 +78,28 @@ namespace brep const 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; + }; + + pair<optional<gq_pr_mergeability>, bool> + gq_pull_request_mergeable (const basic_mark& error, + const string& installation_access_token, + const string& node_id); } #endif // MOD_MOD_CI_GITHUB_GQ_HXX |