From 58381695290f179346c9cbb024dc6f887f2ce7c5 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Tue, 20 Dec 2022 14:04:52 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BB=20=D0=BF=D1=80=D0=BE=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D1=82=D0=B8=20pull-request=20=D0=B2=20merge-request?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bot/gitlab/core/config/properties/GitlabProperty.java | 8 ++++---- .../gitlab/core/service/parser/MergeRequestParser.java | 4 ++-- gitlab-app/src/main/resources/application.yml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/GitlabProperty.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/GitlabProperty.java index df2033c..87cc05f 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/GitlabProperty.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/config/properties/GitlabProperty.java @@ -21,22 +21,22 @@ public class GitlabProperty { /** * Адрес, по которому можно получить открытые ПР */ - private String urlPullRequestOpen; + private String urlMergeRequestOpen; /** * Адрес, по которому можно получить закрытые ПР */ - private String urlPullRequestClose; + private String urlMergeRequestClose; /** * Адрес, по которому можно получить комментарии к ПР */ - private String urlPullRequestComment; + private String urlMergeRequestComment; /** * Адрес ПР */ - private String urlPullRequest; + private String urlMergeRequest; private String urlProject; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/MergeRequestParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/MergeRequestParser.java index e409b20..635b374 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/MergeRequestParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/MergeRequestParser.java @@ -130,7 +130,7 @@ public class MergeRequestParser { */ private List getMergeRequests(Set projectIds) { final List>> tasks = projectIds.stream() - .map(projectId -> new GetMergeRequestTask(projectId, gitlabProperty.getUrlPullRequestOpen(), personProperty.getToken())) + .map(projectId -> new GetMergeRequestTask(projectId, gitlabProperty.getUrlMergeRequestOpen(), personProperty.getToken())) .map(forkJoinPool::submit) .collect(Collectors.toList()); @@ -176,7 +176,7 @@ public class MergeRequestParser { } private Optional getMergeRequest(IdAndStatusPr existId) { - final String mrUrl = MessageFormat.format(gitlabProperty.getUrlPullRequest(), existId.getProjectId(), existId.getTwoId()); + final String mrUrl = MessageFormat.format(gitlabProperty.getUrlMergeRequest(), existId.getProjectId(), existId.getTwoId()); return HttpParse.request(mrUrl) .header(ACCEPT) .header(StringUtils.H_PRIVATE_TOKEN, personProperty.getToken()) diff --git a/gitlab-app/src/main/resources/application.yml b/gitlab-app/src/main/resources/application.yml index 5aca7a0..2abd92b 100644 --- a/gitlab-app/src/main/resources/application.yml +++ b/gitlab-app/src/main/resources/application.yml @@ -36,10 +36,10 @@ gitlab-bot: base-url: ${GITLAB_URL} replaceUrl: ${GITLAB_REPLACE_URL} url-project: ${GITLAB_URL}/api/v4/projects?page={0, number, integer}&per_page=100 - url-pull-request-open: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests?state=opened&page={1, number, integer}&per_page={2, number, integer}" - url-pull-request-close: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests?state=closed&page={1, number, integer}&per_page=100" - url-pull-request-comment: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests/{1,number,#}/notes?&page={2,number,#}&per_page=100" - url-pull-request: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests/{1,number,#}" + url-merge-request-open: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests?state=opened&page={1, number, integer}&per_page={2, number, integer}" + url-merge-request-close: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests?state=closed&page={1, number, integer}&per_page=100" + url-merge-request-comment: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests/{1,number,#}/notes?&page={2,number,#}&per_page=100" + url-merge-request: "${GITLAB_URL}/api/v4/projects/{0,number,#}/merge_requests/{1,number,#}" url-merge-request-add: "${GITLAB_URL}/api/v4/projects/" user-url: ${GITLAB_URL}/api/v4/user users-url: ${GITLAB_URL}/api/v4/users