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

@ -1,21 +1,28 @@
import { Args } from "@bp/service/args/args.types";
import ConfigsParser from "@bp/service/configs/configs-parser";
import { Configs } from "@bp/service/configs/configs.types";
import GitService from "@bp/service/git/git-service";
import GitServiceFactory from "@bp/service/git/git-service-factory";
import GitClient from "@bp/service/git/git-client";
import GitClientFactory from "@bp/service/git/git-client-factory";
import { GitPullRequest } from "@bp/service/git/git.types";
export default class PullRequestConfigsParser extends ConfigsParser {
private gitService: GitService;
private gitService: GitClient;
constructor() {
super();
this.gitService = GitServiceFactory.getService();
this.gitService = GitClientFactory.getClient();
}
public async parse(args: Args): Promise<Configs> {
const pr: GitPullRequest = await this.gitService.getPullRequestFromUrl(args.pullRequest);
let pr: GitPullRequest;
try {
pr = await this.gitService.getPullRequestFromUrl(args.pullRequest);
} catch(error) {
this.logger.error("Something went wrong retrieving pull request");
throw error;
}
const folder: string = args.folder ?? this.getDefaultFolder();
return {