feat: integrate tool with gitlab service (#39)

* feat: integrate tool with gitlab service

Fix https://github.com/lampajr/backporting/issues/30
This commit is contained in:
Andrea Lamparelli 2023-07-02 00:05:17 +02:00 committed by GitHub
parent 8a007941d1
commit 107f5e52d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 17821 additions and 1553 deletions

View file

@ -0,0 +1,35 @@
import { BackportPullRequest, GitPullRequest } from "@bp/service/git/git.types";
/**
* Git management service interface, which provides a common API for interacting
* with several git management services like GitHub, Gitlab or Bitbucket.
*/
export default interface GitClient {
// READ
/**
* Get a pull request object from the underneath git service
* @param owner repository's owner
* @param repo repository's name
* @param prNumber pull request number
* @returns {Promise<PullRequest>}
*/
getPullRequest(owner: string, repo: string, prNumber: number): Promise<GitPullRequest>;
/**
* Get a pull request object from the underneath git service
* @param prUrl pull request html url
* @returns {Promise<PullRequest>}
*/
getPullRequestFromUrl(prUrl: string): Promise<GitPullRequest>;
// WRITE
/**
* Create a new pull request on the underneath git service
* @param backport backport pull request data
* @returns {Promise<string>} the pull request url
*/
createPullRequest(backport: BackportPullRequest): Promise<string>;
}