diff options
author | Francois Kritzinger <francois@codesynthesis.com> | 2024-05-24 09:38:04 +0200 |
---|---|---|
committer | Francois Kritzinger <francois@codesynthesis.com> | 2024-06-05 09:12:46 +0200 |
commit | 034186327acaeac9f0cb4b445752ddd612515341 (patch) | |
tree | f3d89dcc34b453ee7188e833d04a65f9a62cf365 /mod/mod-ci-github-gq.hxx | |
parent | fb02409aea7168048d9afbc374c4db81c7f1aea7 (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 |