From ef162456f1b0a9523af7dd60d2ad32f896659b39 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Mon, 22 Jan 2024 11:05:43 +0300 Subject: [PATCH 1/7] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=81=D0=BE?= =?UTF-8?q?=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../struchkov/bot/gitlab/telegram/service/StartNotify.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java index d4f91a3..00cfc43 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java @@ -25,6 +25,7 @@ import static dev.struchkov.bot.gitlab.telegram.utils.UnitName.DELETE_MESSAGE; import static dev.struchkov.godfather.telegram.domain.keyboard.InlineKeyBoard.inlineKeyBoard; import static dev.struchkov.godfather.telegram.domain.keyboard.button.SimpleButton.simpleButton; import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.DISABLE_WEB_PAGE_PREVIEW; +import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.ENABLE_MARKDOWN; import static dev.struchkov.haiti.utils.Checker.checkNotBlank; /** @@ -62,7 +63,8 @@ public class StartNotify { simpleButton("Open Menu", "/start") ) ) - .payload(DISABLE_WEB_PAGE_PREVIEW, true) + .payload(ENABLE_MARKDOWN) + .payload(DISABLE_WEB_PAGE_PREVIEW) .build(); sending.send(boxAnswer); sendNotice(); From 67e14ca2b5e3c11e0b9d53aa01472b2ef2818647 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Fri, 26 Jan 2024 13:37:48 +0300 Subject: [PATCH 2/7] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D1=82=D0=B8=D1=81=D1=82=D0=B8=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gitlab/telegram/service/StartNotify.java | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java index 00cfc43..78756ac 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/StartNotify.java @@ -5,28 +5,21 @@ import dev.struchkov.bot.gitlab.context.utils.Icons; import dev.struchkov.bot.gitlab.core.config.properties.AppProperty; import dev.struchkov.bot.gitlab.core.config.properties.PersonProperty; import dev.struchkov.godfather.simple.domain.BoxAnswer; -import dev.struchkov.godfather.simple.domain.SentBox; import dev.struchkov.godfather.telegram.domain.ClientBotCommand; import dev.struchkov.godfather.telegram.simple.context.service.TelegramSending; import dev.struchkov.godfather.telegram.simple.context.service.TelegramService; import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; import org.springframework.stereotype.Component; import java.util.List; -import java.util.Optional; -import java.util.UUID; import static dev.struchkov.bot.gitlab.telegram.utils.UnitName.DELETE_MESSAGE; import static dev.struchkov.godfather.telegram.domain.keyboard.InlineKeyBoard.inlineKeyBoard; import static dev.struchkov.godfather.telegram.domain.keyboard.button.SimpleButton.simpleButton; import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.DISABLE_WEB_PAGE_PREVIEW; import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.ENABLE_MARKDOWN; -import static dev.struchkov.haiti.utils.Checker.checkNotBlank; /** * @author upagge 19.01.2021 @@ -36,8 +29,6 @@ import static dev.struchkov.haiti.utils.Checker.checkNotBlank; @RequiredArgsConstructor public class StartNotify { - private final OkHttpClient client = new OkHttpClient(); - private final TelegramSending sending; private final TelegramService telegramService; @@ -67,53 +58,6 @@ public class StartNotify { .payload(DISABLE_WEB_PAGE_PREVIEW) .build(); sending.send(boxAnswer); - sendNotice(); - } - registrationForStatistic(); - } - - - /** - * Отправляет service_key для сбора анонимной статистики использования. - */ - private void registrationForStatistic() { - final UUID serviceKey = settingService.getServiceKey(); - final boolean firstStart = settingService.isFirstStart(); - final String requestUrl = "https://metrika.struchkov.dev/gitlab-notify/registration?key=" + serviceKey + "&initFlow=" + firstStart; - final Request request = new Request.Builder().get().url(requestUrl).build(); - try { - client.newCall(request).execute(); - } catch (Exception e) { - log.warn(e.getMessage()); - } - } - - /** - * Используется для уведомления пользователя о выходе новой версии. - */ - private void sendNotice() { - final String requestUrl = "https://metrika.struchkov.dev/gitlab-notify/start-notice"; - final Request request = new Request.Builder().get().url(requestUrl).build(); - try { - final Response response = client.newCall(request).execute(); - if (response.code() == 200) { - final String noticeMessage = response.body().string(); - if (checkNotBlank(noticeMessage)) { - final BoxAnswer notice = BoxAnswer.builder() - .message(noticeMessage) - .recipientPersonId(personProperty.getTelegramId()) - .payload(DISABLE_WEB_PAGE_PREVIEW, true) - .build(); - final Optional optSentBox = sending.send(notice); - if (optSentBox.isPresent()) { - final SentBox sentBox = optSentBox.get(); - final String messageId = sentBox.getMessageId(); - telegramService.pinMessage(personProperty.getTelegramId(), messageId); - } - } - } - } catch (Exception e) { - log.warn(e.getMessage()); } } From 8f48af4767e93b3adaf368da25e7d9115b228387 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Sat, 27 Jan 2024 09:39:06 +0300 Subject: [PATCH 3/7] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../context/domain/AssigneeChanged.java | 15 +++--- .../impl/MergeRequestsServiceImpl.java | 50 +++++++++++-------- .../service/impl/PipelineServiceImpl.java | 7 +-- .../core/service/parser/PipelineParser.java | 32 ++++++------ .../parser/forktask/GetPipelineTask.java | 17 ++++--- gitlab-app/src/main/resources/application.yml | 9 ++-- .../notify/ConflictPrNotifyGenerator.java | 14 +++--- .../ConflictResolvePrNotifyGenerator.java | 14 +++--- .../notify/NewCommentNotifyGenerator.java | 14 +++--- .../notify/NewMrForReviewNotifyGenerator.java | 14 +++--- .../notify/NewProjectNotifyGenerator.java | 13 ++--- .../notify/NewThreadNotifyGenerator.java | 14 +++--- .../notify/PipelineNotifyGenerator.java | 13 ++--- .../notify/StatusMrNotifyGenerator.java | 13 ++--- .../notify/ThreadCloseNotifyGenerate.java | 13 ++--- .../notify/UpdateMrNotifyGenerator.java | 13 ++--- .../telegram/unit/command/AnswerNoteUnit.java | 13 ++--- 17 files changed, 153 insertions(+), 125 deletions(-) diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/AssigneeChanged.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/AssigneeChanged.java index de57c81..32bce74 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/AssigneeChanged.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/AssigneeChanged.java @@ -4,8 +4,7 @@ import dev.struchkov.bot.gitlab.context.domain.entity.Person; import lombok.Getter; import lombok.RequiredArgsConstructor; -import static dev.struchkov.haiti.utils.Checker.checkNotNull; -import static dev.struchkov.haiti.utils.Checker.checkNull; +import java.util.Optional; @Getter @RequiredArgsConstructor @@ -18,18 +17,18 @@ public enum AssigneeChanged { private final boolean changed; - public static AssigneeChanged valueOf(Long gitlabUserId, Person oldAssignee, Person newAssignee) { - if (checkNull(oldAssignee) && checkNotNull(newAssignee) && gitlabUserId.equals(newAssignee.getId())) { + public static AssigneeChanged valueOf(Long gitlabUserId, Optional oldAssignee, Optional newAssignee) { + if (oldAssignee.isEmpty() && newAssignee.isPresent() && gitlabUserId.equals(newAssignee.get().getId())) { return AssigneeChanged.BECOME; } - if (checkNotNull(oldAssignee) && checkNull(newAssignee) && gitlabUserId.equals(oldAssignee.getId())) { + if (oldAssignee.isPresent() && newAssignee.isEmpty() && gitlabUserId.equals(oldAssignee.get().getId())) { return AssigneeChanged.DELETED; } - if (checkNotNull(oldAssignee) && checkNotNull(newAssignee) && !oldAssignee.getId().equals(newAssignee.getId())) { - if (gitlabUserId.equals(oldAssignee.getId())) { + if (oldAssignee.isPresent() && newAssignee.isPresent() && !oldAssignee.get().getId().equals(newAssignee.get().getId())) { + if (gitlabUserId.equals(oldAssignee.get().getId())) { return AssigneeChanged.DELETED; } - if (gitlabUserId.equals(newAssignee.getId())) { + if (gitlabUserId.equals(newAssignee.get().getId())) { return AssigneeChanged.BECOME; } return AssigneeChanged.NOT_AFFECT_USER; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java index 173603b..1bedbdf 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java @@ -81,10 +81,11 @@ public class MergeRequestsServiceImpl implements MergeRequestsService { private boolean isBotUserAssigneeAndNotAuthor(MergeRequest mergeRequest) { final Long gitlabUserId = personInformation.getId(); - final Person assignee = mergeRequest.getAssignee(); + final Optional optAssignee = getAssignee(mergeRequest); final Person author = mergeRequest.getAuthor(); - if (checkNotNull(assignee)) { + if (optAssignee.isPresent()) { + final Person assignee = optAssignee.get(); if (gitlabUserId.equals(assignee.getId()) && !isAuthorSameAssignee(author, assignee)) { return true; } @@ -116,20 +117,26 @@ public class MergeRequestsServiceImpl implements MergeRequestsService { } private void sendNotifyNewMrReview(MergeRequest mergeRequest, String projectName) { - notifyService.send( - NewMrForReview.builder() - .mrId(mergeRequest.getId()) - .projectName(projectName) - .labels(mergeRequest.getLabels()) - .author(mergeRequest.getAuthor().getName()) - .description(mergeRequest.getDescription()) - .title(mergeRequest.getTitle()) - .url(mergeRequest.getWebUrl()) - .targetBranch(mergeRequest.getTargetBranch()) - .sourceBranch(mergeRequest.getSourceBranch()) - .assignee(mergeRequest.getAssignee().getName()) - .build() - ); + final NewMrForReview.NewMrForReviewBuilder builder = NewMrForReview.builder() + .mrId(mergeRequest.getId()) + .projectName(projectName) + .labels(mergeRequest.getLabels()) + .author(mergeRequest.getAuthor().getName()) + .description(mergeRequest.getDescription()) + .title(mergeRequest.getTitle()) + .url(mergeRequest.getWebUrl()) + .targetBranch(mergeRequest.getTargetBranch()) + .sourceBranch(mergeRequest.getSourceBranch()); + + getAssignee(mergeRequest) + .map(Person::getName) + .ifPresent(builder::assignee); + + notifyService.send(builder.build()); + } + + private Optional getAssignee(MergeRequest mergeRequest) { + return Optional.ofNullable(mergeRequest.getAssignee()); } private void sendNotifyNewAssignee(MergeRequest mergeRequest, String projectName, String oldAssigneeName) { @@ -148,9 +155,9 @@ public class MergeRequestsServiceImpl implements MergeRequestsService { if (checkNotNull(oldAssigneeName)) { builder.oldAssigneeName(oldAssigneeName); - if (checkNotNull(mergeRequest.getAssignee())) { - builder.newAssigneeName(mergeRequest.getAssignee().getName()); - } + getAssignee(mergeRequest) + .map(Person::getName) + .ifPresent(builder::newAssigneeName); } notifyService.send(builder.build()); @@ -165,7 +172,7 @@ public class MergeRequestsServiceImpl implements MergeRequestsService { mergeRequest.setNotification(oldMergeRequest.isNotification()); final Long gitlabUserId = personInformation.getId(); - final AssigneeChanged assigneeChanged = AssigneeChanged.valueOf(gitlabUserId, oldMergeRequest.getAssignee(), mergeRequest.getAssignee()); + final AssigneeChanged assigneeChanged = AssigneeChanged.valueOf(gitlabUserId, getAssignee(oldMergeRequest), getAssignee(mergeRequest)); final ReviewerChanged reviewerChanged = ReviewerChanged.valueOf(gitlabUserId, oldMergeRequest.getReviewers(), mergeRequest.getReviewers()); mergeRequest.setUserAssignee(assigneeChanged.getNewStatus(oldMergeRequest.isUserAssignee())); @@ -201,8 +208,7 @@ public class MergeRequestsServiceImpl implements MergeRequestsService { private void notifyAssignee(AssigneeChanged assigneeChanged, MergeRequest oldMergeRequest, MergeRequest mergeRequest, Project project) { switch (assigneeChanged) { - case BECOME -> - sendNotifyNewAssignee(mergeRequest, project.getName(), Optional.ofNullable(oldMergeRequest.getAssignee()).map(Person::getName).orElse(null)); + case BECOME -> sendNotifyNewAssignee(mergeRequest, project.getName(), getAssignee(oldMergeRequest).map(Person::getName).orElse(null)); } } //TODO [05.12.2022|uPagge]: Добавить уведомление, если происходит удаление ревьювера diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/PipelineServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/PipelineServiceImpl.java index 3c5d17b..739eab4 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/PipelineServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/PipelineServiceImpl.java @@ -101,8 +101,9 @@ public class PipelineServiceImpl implements PipelineService { private boolean isNeedNotifyNewPipeline(@NonNull Pipeline pipeline) { final Person personPipelineCreator = pipeline.getPerson(); return notificationStatus.contains(pipeline.getStatus()) // Пайплайн имеет статус необходимый для уведомления - && checkNotNull(personPipelineCreator) // Создатель пайплайна не null - && personInformation.getId().equals(personPipelineCreator.getId()); // Пользователь приложения является инициатором пайплайна + && checkNotNull(personPipelineCreator) // Создатель пайплайна не null + && personInformation.getId().equals(personPipelineCreator.getId()) // Пользователь приложения является инициатором пайплайна + && LocalDateTime.now().minusDays(1).isBefore(pipeline.getCreated()); // Пайплан был создан не более 24 часов назад } @Override @@ -128,7 +129,7 @@ public class PipelineServiceImpl implements PipelineService { @Override public void cleanOld() { log.debug("Старт очистки старых пайплайнов"); - repository.deleteByCreatedBefore(LocalDateTime.now().minusDays(1L)); + repository.deleteByCreatedBefore(LocalDateTime.now().minusDays(7L)); log.debug("Конец очистки старых пайплайнов"); } diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java index 7db61fc..41f9ee1 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java @@ -35,6 +35,7 @@ import static dev.struchkov.haiti.utils.Checker.checkFalse; import static dev.struchkov.haiti.utils.Checker.checkNotEmpty; import static dev.struchkov.haiti.utils.concurrent.ForkJoinUtils.pullTaskResult; import static dev.struchkov.haiti.utils.concurrent.ForkJoinUtils.pullTaskResults; +import static java.util.stream.Collectors.toMap; /** * Парсер пайплайнов. @@ -79,7 +80,7 @@ public class PipelineParser { final Set projectIds = projectService.getAllIdByProcessingEnable(); final Map pipelineProjectMap = getPipelineShortJsons(projectIds).stream() - .collect(Collectors.toMap(PipelineShortJson::getId, PipelineShortJson::getProjectId)); + .collect(toMap(PipelineShortJson::getId, PipelineShortJson::getProjectId)); if (checkNotEmpty(pipelineProjectMap)) { final ExistContainer existContainer = pipelineService.existsById(pipelineProjectMap.keySet()); @@ -99,14 +100,16 @@ public class PipelineParser { log.debug("Конец обработки новых пайплайнов"); } - private List getNewPipelines(Map pipelineProjectMap, Set idsNotFound) { + private List getNewPipelines(Map pipelineIdAndProjectId, Set idsNotFound) { final List>> tasks = idsNotFound.stream() - .map(pipelineId -> new GetPipelineTask( - gitlabProperty.getPipelineUrl(), - pipelineProjectMap.get(pipelineId), - pipelineId, - personProperty.getToken() - )) + .map( + pipelineId -> GetPipelineTask.builder() + .pipelineId(pipelineId) + .projectId(pipelineIdAndProjectId.get(pipelineId)) + .urlPipeline(gitlabProperty.getPipelineUrl()) + .gitlabToken(personProperty.getToken()) + .build() + ) .map(forkJoinPool::submit) .collect(Collectors.toList()); @@ -141,12 +144,13 @@ public class PipelineParser { final List>> tasks = pipelines.stream() .map( - pipeline -> new GetPipelineTask( - gitlabProperty.getPipelineUrl(), - pipeline.getProjectId(), - pipeline.getId(), - personProperty.getToken() - ) + pipeline -> + GetPipelineTask.builder() + .projectId(pipeline.getProjectId()) + .pipelineId(pipeline.getId()) + .urlPipeline(gitlabProperty.getPipelineUrl()) + .gitlabToken(gitlabProperty.getPipelineUrl()) + .build() ) .map(forkJoinPool::submit) .collect(Collectors.toList()); diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetPipelineTask.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetPipelineTask.java index 8e43d22..5da19dc 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetPipelineTask.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/forktask/GetPipelineTask.java @@ -3,7 +3,10 @@ package dev.struchkov.bot.gitlab.core.service.parser.forktask; import dev.struchkov.bot.gitlab.core.utils.HttpParse; import dev.struchkov.bot.gitlab.core.utils.StringUtils; import dev.struchkov.bot.gitlab.sdk.domain.PipelineJson; -import lombok.RequiredArgsConstructor; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.NoArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -15,13 +18,15 @@ import static dev.struchkov.bot.gitlab.core.utils.HttpParse.ACCEPT; @Slf4j -@RequiredArgsConstructor +@Builder +@NoArgsConstructor +@AllArgsConstructor(access = AccessLevel.PRIVATE) public class GetPipelineTask extends RecursiveTask> { - private final String urlPipeline; - private final long projectId; - private final long pipelineId; - private final String gitlabToken; + private String urlPipeline; + private long projectId; + private long pipelineId; + private String gitlabToken; @Override @SneakyThrows diff --git a/gitlab-app/src/main/resources/application.yml b/gitlab-app/src/main/resources/application.yml index 1638eca..4c2c48b 100644 --- a/gitlab-app/src/main/resources/application.yml +++ b/gitlab-app/src/main/resources/application.yml @@ -19,7 +19,8 @@ spring: logging: level: - "dev.struchkov": ${LOG_LEVEL:info} + "dev.struchkov": ${LOG_LEVEL:INFO} + "dev.struchkov.bot.gitlab": ${APP_LOG_LEVEL:INFO} telegram: bot: @@ -39,9 +40,9 @@ gitlab-bot: version: 1.0.0 cron: scan: - general: "0 */1 * * * *" - new-project: "0 0 */1 * * *" - new-merge-request: "0 */15 * * * *" + general: ${CRON_GENERAL:0 */1 * * * *} + new-project: ${CRON_NEW_PROJECTS:0 0 */1 * * *} + new-merge-request: ${CRON_NEW_MR:0 */15 * * * *} person: telegram-id: ${TELEGRAM_PERSON_ID} token: ${GITLAB_PERSONAL_TOKEN} diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/ConflictPrNotifyGenerator.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/ConflictPrNotifyGenerator.java index d616bba..4b02579 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/ConflictPrNotifyGenerator.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/ConflictPrNotifyGenerator.java @@ -9,11 +9,11 @@ import static dev.struchkov.bot.gitlab.telegram.utils.Const.BUTTON_ARG_CONFIRMAT import static dev.struchkov.bot.gitlab.telegram.utils.Const.BUTTON_ARG_DISABLE_NOTIFY_MR_ID; import static dev.struchkov.bot.gitlab.telegram.utils.Const.BUTTON_VALUE_FALSE; import static dev.struchkov.bot.gitlab.telegram.utils.UnitName.DELETE_MESSAGE; -import static dev.struchkov.godfather.simple.domain.BoxAnswer.boxAnswer; import static dev.struchkov.godfather.telegram.domain.keyboard.InlineKeyBoard.inlineKeyBoard; import static dev.struchkov.godfather.telegram.domain.keyboard.SimpleKeyBoardLine.keyBoardLine; import static dev.struchkov.godfather.telegram.domain.keyboard.button.SimpleButton.simpleButton; import static dev.struchkov.godfather.telegram.domain.keyboard.button.UrlButton.urlButton; +import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.ENABLE_MARKDOWN; import static dev.struchkov.haiti.utils.Strings.escapeMarkdown; @Component @@ -30,16 +30,18 @@ public class ConflictPrNotifyGenerator implements NotifyBoxAnswerGenerator> notes) { diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java index 7ba36ef..87b2871 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java @@ -11,11 +11,11 @@ import org.springframework.stereotype.Service; import java.util.Optional; import static dev.struchkov.bot.gitlab.telegram.utils.UnitName.DELETE_MESSAGE; -import static dev.struchkov.godfather.simple.domain.BoxAnswer.boxAnswer; import static dev.struchkov.godfather.telegram.domain.keyboard.InlineKeyBoard.inlineKeyBoard; import static dev.struchkov.godfather.telegram.domain.keyboard.SimpleKeyBoardLine.keyBoardLine; import static dev.struchkov.godfather.telegram.domain.keyboard.button.SimpleButton.simpleButton; import static dev.struchkov.godfather.telegram.domain.keyboard.button.UrlButton.urlButton; +import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.ENABLE_MARKDOWN; @Service @RequiredArgsConstructor @@ -42,15 +42,16 @@ public class PipelineNotifyGenerator implements NotifyBoxAnswerGeneratorbuilder() .triggerCheck( mail -> { - final List forwardMails = mail.getForwardMail(); - if (Checker.checkNotNull(forwardMails) && forwardMails.size() == 1) { - final Mail forwardMail = forwardMails.get(0); - final boolean isLink = Attachments.findFirstLink(forwardMail.getAttachments()) - .isPresent(); + final Mail replay = mail.getReplayMail(); + if (checkNotNull(replay)) { + final boolean isLink = Attachments.findFirstLink(replay.getAttachments()).isPresent(); if (isLink) { final boolean isAccess = personInformation.getTelegramId().equals(mail.getFromPersonId()); final boolean firstStart = settingService.isFirstStart(); @@ -56,7 +53,7 @@ public class AnswerNoteUnit implements PersonUnitConfiguration { ) .answer( mail -> { - final String noteUrl = Attachments.findFirstLink(mail.getForwardMail().get(0).getAttachments()) + final String noteUrl = Attachments.findFirstLink(mail.getReplayMail().getAttachments()) .map(LinkAttachment::getUrl) .orElseThrow(); final Matcher matcher = NOTE_LINK.matcher(noteUrl); From 39f364c22b41a0b483761e6bd14e75d9e8665c88 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Tue, 6 Feb 2024 09:39:33 +0300 Subject: [PATCH 4/7] fixes --- .../impl/MergeRequestsServiceImpl.java | 3 +- .../core/service/parser/PipelineParser.java | 4 +-- .../bot/gitlab/core/utils/HttpParse.java | 19 ++++++++--- .../main/resources/liquibase/changelog.xml | 1 + .../v.2.0.0/2024-02-06-change-varchar.xml | 34 +++++++++++++++++++ .../resources/liquibase/v.2.0.0/changelog.xml | 12 +++++++ .../notify/NewMrForReviewNotifyGenerator.java | 2 +- 7 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 gitlab-app/src/main/resources/liquibase/v.2.0.0/2024-02-06-change-varchar.xml create mode 100644 gitlab-app/src/main/resources/liquibase/v.2.0.0/changelog.xml diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java index 1bedbdf..683dadd 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/impl/MergeRequestsServiceImpl.java @@ -208,7 +208,8 @@ public class MergeRequestsServiceImpl implements MergeRequestsService { private void notifyAssignee(AssigneeChanged assigneeChanged, MergeRequest oldMergeRequest, MergeRequest mergeRequest, Project project) { switch (assigneeChanged) { - case BECOME -> sendNotifyNewAssignee(mergeRequest, project.getName(), getAssignee(oldMergeRequest).map(Person::getName).orElse(null)); + case BECOME -> + sendNotifyNewAssignee(mergeRequest, project.getName(), getAssignee(oldMergeRequest).map(Person::getName).orElse(null)); } } //TODO [05.12.2022|uPagge]: Добавить уведомление, если происходит удаление ревьювера diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java index 41f9ee1..1d8bc4e 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/parser/PipelineParser.java @@ -120,10 +120,10 @@ public class PipelineParser { } private List getPipelineShortJsons(Set projectIds) { - LocalDateTime newLastUpdate = LocalDateTime.now(); + final LocalDateTime newLastUpdate = LocalDateTime.now(); final List>> tasks = projectIds.stream() .map(projectId -> new GetPipelineShortTask( - gitlabProperty.getPipelinesUrl(), + gitlabProperty.getPipelineUrl(), projectId, lastUpdate, personProperty.getToken() diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java index f3e8866..227c3e4 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java @@ -3,6 +3,7 @@ package dev.struchkov.bot.gitlab.core.utils; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import dev.struchkov.haiti.utils.Inspector; +import jakarta.validation.constraints.NotNull; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; @@ -15,6 +16,7 @@ import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Optional; +import java.util.concurrent.TimeUnit; import static dev.struchkov.haiti.utils.Checker.checkNotNull; import static dev.struchkov.haiti.utils.Inspector.isNotNull; @@ -77,7 +79,7 @@ public class HttpParse { final HttpUrl url = httpUrlBuilder.build(); final Request request = requestBuilder.url(url).build(); log.trace("Выполняется okhttp3 запрос | {}", url); - final OkHttpClient httpClient = new OkHttpClient(); + final OkHttpClient httpClient = getNewClient(); try (final Response execute = httpClient.newCall(request).execute()) { log.trace("Запрос выполнен | {}", url); if (execute.isSuccessful() && checkNotNull(execute.body())) { @@ -95,10 +97,10 @@ public class HttpParse { isNotNull(classOfT); final HttpUrl url = httpUrlBuilder.build(); final Request request = requestBuilder.url(url).build(); - log.trace("Выполняется okhttp3 запрос | {}", url); - final OkHttpClient httpClient = new OkHttpClient(); + log.debug("Выполняется okhttp3 запрос | {}", url); + final OkHttpClient httpClient = getNewClient(); try (Response execute = httpClient.newCall(request).execute()) { - log.trace("Запрос выполнен | {}", url); + log.debug("Запрос выполнен | {}", url); ResponseBody body = execute.body(); if (execute.isSuccessful() && checkNotNull(body)) { final String stringBody = body.string(); @@ -111,4 +113,13 @@ public class HttpParse { return Collections.emptyList(); } + @NotNull + private static OkHttpClient getNewClient() { + return new OkHttpClient().newBuilder() + .connectTimeout(30, TimeUnit.SECONDS) + .readTimeout(30, TimeUnit.SECONDS) + .writeTimeout(30, TimeUnit.SECONDS) + .build(); + } + } \ No newline at end of file diff --git a/gitlab-app/src/main/resources/liquibase/changelog.xml b/gitlab-app/src/main/resources/liquibase/changelog.xml index 7035840..ced62ea 100644 --- a/gitlab-app/src/main/resources/liquibase/changelog.xml +++ b/gitlab-app/src/main/resources/liquibase/changelog.xml @@ -4,5 +4,6 @@ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.17.xsd"> + \ No newline at end of file diff --git a/gitlab-app/src/main/resources/liquibase/v.2.0.0/2024-02-06-change-varchar.xml b/gitlab-app/src/main/resources/liquibase/v.2.0.0/2024-02-06-change-varchar.xml new file mode 100644 index 0000000..7c35c85 --- /dev/null +++ b/gitlab-app/src/main/resources/liquibase/v.2.0.0/2024-02-06-change-varchar.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gitlab-app/src/main/resources/liquibase/v.2.0.0/changelog.xml b/gitlab-app/src/main/resources/liquibase/v.2.0.0/changelog.xml new file mode 100644 index 0000000..4ba8d94 --- /dev/null +++ b/gitlab-app/src/main/resources/liquibase/v.2.0.0/changelog.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java index 0ff33c6..41b8064 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java @@ -31,7 +31,7 @@ public class NewMrForReviewNotifyGenerator implements NotifyBoxAnswerGenerator Date: Wed, 21 Aug 2024 16:34:30 +0300 Subject: [PATCH 5/7] fixes --- .../gitlab/context/domain/entity/MergeRequest.java | 3 +++ .../notify/mergerequest/ConflictMrNotify.java | 5 +++-- .../mergerequest/ConflictResolveMrNotify.java | 5 +++-- .../domain/notify/mergerequest/MrNotify.java | 5 ++++- .../notify/mergerequest/NewMrForAssignee.java | 6 ++++-- .../domain/notify/mergerequest/NewMrForReview.java | 6 ++++-- .../domain/notify/mergerequest/NewMrNotify.java | 5 +++-- .../domain/notify/mergerequest/StatusMrNotify.java | 5 +++-- .../domain/notify/mergerequest/UpdateMrNotify.java | 5 +++-- .../struchkov/bot/gitlab/context/utils/Icons.java | 1 + .../service/convert/MergeRequestJsonConverter.java | 4 ++++ .../service/impl/MergeRequestsServiceImpl.java | 12 +++++++++++- .../gitlab/core/service/parser/PipelineParser.java | 2 +- .../struchkov/bot/gitlab/core/utils/HttpParse.java | 4 ++-- .../liquibase/v.2.0.0/2024-08-21-add-milestone.xml | 14 ++++++++++++++ .../main/resources/liquibase/v.2.0.0/changelog.xml | 1 + .../bot/gitlab/sdk/domain/MergeRequestJson.java | 1 + .../bot/gitlab/sdk/domain/MilestoneJson.java | 9 +++++++++ pom.xml | 8 ++++---- .../service/MessageSendTelegramService.java | 3 +++ .../service/notify/ConflictPrNotifyGenerator.java | 9 ++++++++- .../notify/ConflictResolvePrNotifyGenerator.java | 9 ++++++++- .../notify/NewMrForAssigneeNotifyGenerator.java | 4 ++++ .../notify/NewMrForReviewNotifyGenerator.java | 4 ++++ .../service/notify/StatusMrNotifyGenerator.java | 10 +++++++++- .../service/notify/UpdateMrNotifyGenerator.java | 4 ++++ .../telegram/unit/command/DeleteMessageUnit.java | 3 ++- .../telegram/unit/command/DisableNotifyMrUnit.java | 3 ++- .../unit/command/DisableNotifyThreadUnit.java | 3 ++- .../gitlab/telegram/unit/flow/InitSettingFlow.java | 5 +++++ 30 files changed, 129 insertions(+), 29 deletions(-) create mode 100644 gitlab-app/src/main/resources/liquibase/v.2.0.0/2024-08-21-add-milestone.xml create mode 100644 gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneJson.java diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java index b51d692..5867edf 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java @@ -57,6 +57,9 @@ public class MergeRequest { @Column(name = "description") private String description; + @Column(name = "milestone") + private String milestone; + @Enumerated(EnumType.STRING) @Column(name = "state") private MergeRequestState state; diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/ConflictMrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/ConflictMrNotify.java index 311da6e..4dd42cc 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/ConflictMrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/ConflictMrNotify.java @@ -20,9 +20,10 @@ public class ConflictMrNotify extends MrNotify { String name, String url, String projectKey, - String sourceBranch + String sourceBranch, + String milestone ) { - super(mrId, projectKey, name, url); + super(mrId, projectKey, name, url, milestone); this.sourceBranch = sourceBranch; } diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/ConflictResolveMrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/ConflictResolveMrNotify.java index 7486f25..2a0c129 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/ConflictResolveMrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/ConflictResolveMrNotify.java @@ -20,9 +20,10 @@ public class ConflictResolveMrNotify extends MrNotify { String name, String url, String projectKey, - String sourceBranch + String sourceBranch, + String milestone ) { - super(mrId, projectKey, name, url); + super(mrId, projectKey, name, url, milestone); this.sourceBranch = sourceBranch; } diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/MrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/MrNotify.java index 7fb9e4e..d4c7f0c 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/MrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/MrNotify.java @@ -10,17 +10,20 @@ public abstract class MrNotify implements Notify { protected final String projectName; protected final String title; protected final String url; + protected final String milestone; protected MrNotify( Long mrId, String projectName, String title, - String url + String url, + String milestone ) { this.mrId = mrId; this.projectName = projectName; this.title = title; this.url = url; + this.milestone = milestone; } } diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForAssignee.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForAssignee.java index 5c5747f..3a22ebc 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForAssignee.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForAssignee.java @@ -33,7 +33,8 @@ public class NewMrForAssignee extends NewMrNotify { Set labels, @Singular List reviewers, String oldAssigneeName, - String newAssigneeName + String newAssigneeName, + String milestone ) { super( mrId, @@ -44,7 +45,8 @@ public class NewMrForAssignee extends NewMrNotify { projectName, targetBranch, sourceBranch, - labels + labels, + milestone ); this.reviewers = reviewers; this.oldAssigneeName = oldAssigneeName; diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForReview.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForReview.java index 74134d5..fe79ebe 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForReview.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrForReview.java @@ -27,7 +27,8 @@ public class NewMrForReview extends NewMrNotify { String targetBranch, String sourceBranch, Set labels, - String assignee + String assignee, + String milestone ) { super( mrId, @@ -38,7 +39,8 @@ public class NewMrForReview extends NewMrNotify { projectName, targetBranch, sourceBranch, - labels + labels, + milestone ); this.assignee = assignee; } diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrNotify.java index 20c17ca..2183231 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/NewMrNotify.java @@ -22,9 +22,10 @@ public abstract class NewMrNotify extends MrNotify { String projectName, String targetBranch, String sourceBranch, - Set labels + Set labels, + String milestone ) { - super(mrId, projectName, title, url); + super(mrId, projectName, title, url, milestone); this.description = description; this.author = author; this.targetBranch = targetBranch; diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/StatusMrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/StatusMrNotify.java index 743473c..22c80d4 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/StatusMrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/StatusMrNotify.java @@ -23,9 +23,10 @@ public class StatusMrNotify extends MrNotify { String url, String projectName, MergeRequestState oldStatus, - MergeRequestState newStatus + MergeRequestState newStatus, + String milestone ) { - super(mrId, projectName, name, url); + super(mrId, projectName, name, url, milestone); this.oldStatus = oldStatus; this.newStatus = newStatus; } diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/UpdateMrNotify.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/UpdateMrNotify.java index bb6bd54..61ec84f 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/UpdateMrNotify.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/notify/mergerequest/UpdateMrNotify.java @@ -30,9 +30,10 @@ public class UpdateMrNotify extends MrNotify { Long allResolvedTasks, Long personTasks, Long personResolvedTasks, - String comment + String comment, + String milestone ) { - super(mrId, projectName, name, url); + super(mrId, projectName, name, url, milestone); this.author = author; this.allTasks = allTasks; this.allResolvedTasks = allResolvedTasks; diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Icons.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Icons.java index cdbd037..86d0d05 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Icons.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Icons.java @@ -22,6 +22,7 @@ public class Icons { public static final String BUILD = "⚙️"; public static final String LINK = "\uD83D\uDD17"; public static final String REVIEWER = "\uD83D\uDD0E"; + public static final String MILESTONE = "\uD83C\uDFAF"; public static final String PROJECT = "\uD83C\uDFD7"; public static final String DISABLE_NOTIFY = "\uD83D\uDD15"; public static final String YES = "✅"; diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java index 243b531..d966b17 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/service/convert/MergeRequestJsonConverter.java @@ -43,6 +43,10 @@ public class MergeRequestJsonConverter implements Converter>> tasks = projectIds.stream() .map(projectId -> new GetPipelineShortTask( - gitlabProperty.getPipelineUrl(), + gitlabProperty.getPipelinesUrl(), projectId, lastUpdate, personProperty.getToken() diff --git a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java index 227c3e4..e86fed1 100644 --- a/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java +++ b/bot-core/src/main/java/dev/struchkov/bot/gitlab/core/utils/HttpParse.java @@ -97,10 +97,10 @@ public class HttpParse { isNotNull(classOfT); final HttpUrl url = httpUrlBuilder.build(); final Request request = requestBuilder.url(url).build(); - log.debug("Выполняется okhttp3 запрос | {}", url); + log.trace("Выполняется okhttp3 запрос | {}", url); final OkHttpClient httpClient = getNewClient(); try (Response execute = httpClient.newCall(request).execute()) { - log.debug("Запрос выполнен | {}", url); + log.trace("Запрос выполнен | {}", url); ResponseBody body = execute.body(); if (execute.isSuccessful() && checkNotNull(body)) { final String stringBody = body.string(); diff --git a/gitlab-app/src/main/resources/liquibase/v.2.0.0/2024-08-21-add-milestone.xml b/gitlab-app/src/main/resources/liquibase/v.2.0.0/2024-08-21-add-milestone.xml new file mode 100644 index 0000000..0686992 --- /dev/null +++ b/gitlab-app/src/main/resources/liquibase/v.2.0.0/2024-08-21-add-milestone.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/gitlab-app/src/main/resources/liquibase/v.2.0.0/changelog.xml b/gitlab-app/src/main/resources/liquibase/v.2.0.0/changelog.xml index 4ba8d94..1f72fec 100644 --- a/gitlab-app/src/main/resources/liquibase/v.2.0.0/changelog.xml +++ b/gitlab-app/src/main/resources/liquibase/v.2.0.0/changelog.xml @@ -8,5 +8,6 @@ + \ No newline at end of file diff --git a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MergeRequestJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MergeRequestJson.java index 73b125f..aec5c0b 100644 --- a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MergeRequestJson.java +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MergeRequestJson.java @@ -41,6 +41,7 @@ public class MergeRequestJson { private PersonJson author; private PersonJson assignee; + private MilestoneJson milestone; private List reviewers; @JsonProperty("web_url") diff --git a/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneJson.java b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneJson.java new file mode 100644 index 0000000..dd8c889 --- /dev/null +++ b/gitlab-sdk/src/main/java/dev/struchkov/bot/gitlab/sdk/domain/MilestoneJson.java @@ -0,0 +1,9 @@ +package dev.struchkov.bot.gitlab.sdk.domain; + +import lombok.Data; + +@Data +public class MilestoneJson { + private Long id; + private String title; +} diff --git a/pom.xml b/pom.xml index 6c13369..59dd236 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ 1.0.0-SNAPSHOT - 3.0.2 + 3.0.3 1.1.1 0.0.5 @@ -53,12 +53,12 @@ 3.2.0-M1 - 33.0.0-jre + 33.3.0-jre - 3.12.1 + 3.13.0 - 3.0.1 + 3.1.1 diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/MessageSendTelegramService.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/MessageSendTelegramService.java index 0711799..f185440 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/MessageSendTelegramService.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/MessageSendTelegramService.java @@ -8,6 +8,7 @@ import dev.struchkov.godfather.simple.domain.BoxAnswer; import dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload; import dev.struchkov.godfather.telegram.simple.context.service.TelegramSending; import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import java.util.List; @@ -20,6 +21,7 @@ import java.util.stream.Collectors; * * @author upagge 17.09.2020 */ +@Slf4j @Service public class MessageSendTelegramService implements MessageSendService { @@ -45,6 +47,7 @@ public class MessageSendTelegramService implements MessageSendService { final BoxAnswer answer = generator.generate(notify); answer.setRecipientIfNull(personInformation.getTelegramId()); answer.addPayload(BoxAnswerPayload.DISABLE_WEB_PAGE_PREVIEW, true); + log.debug("Будет отправлено следующее уведомление: {}. Текст: {}", answer, answer.getMessage()); return answer; }) .ifPresent(sending::send); diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/ConflictPrNotifyGenerator.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/ConflictPrNotifyGenerator.java index 4b02579..4066383 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/ConflictPrNotifyGenerator.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/ConflictPrNotifyGenerator.java @@ -14,6 +14,7 @@ import static dev.struchkov.godfather.telegram.domain.keyboard.SimpleKeyBoardLin import static dev.struchkov.godfather.telegram.domain.keyboard.button.SimpleButton.simpleButton; import static dev.struchkov.godfather.telegram.domain.keyboard.button.UrlButton.urlButton; import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.ENABLE_MARKDOWN; +import static dev.struchkov.haiti.utils.Checker.checkNotNull; import static dev.struchkov.haiti.utils.Strings.escapeMarkdown; @Component @@ -26,7 +27,13 @@ public class ConflictPrNotifyGenerator implements NotifyBoxAnswerGenerator reviewers = notify.getReviewers(); if (checkNotEmpty(reviewers)) { builder.append(Icons.REVIEWER).append(": ").append(String.join(", ", reviewers)).append("\n"); diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java index 41b8064..de9bc7b 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForReviewNotifyGenerator.java @@ -43,6 +43,10 @@ public class NewMrForReviewNotifyGenerator implements NotifyBoxAnswerGenerator { final ButtonClickAttachment clickButton = Attachments.findFirstButtonClick(mail.getAttachments()).orElseThrow(); - telegramSending.deleteMessage(mail.getFromPersonId(), clickButton.getMessage().getId()); + //TODO [21.08.2024|uPagge]: fixme + telegramSending.deleteMessage(mail.getFromPersonId(), clickButton.getMessage().get().getId()); }) .build(); } diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/command/DisableNotifyMrUnit.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/command/DisableNotifyMrUnit.java index 71fc377..909ab97 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/command/DisableNotifyMrUnit.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/command/DisableNotifyMrUnit.java @@ -77,7 +77,8 @@ public class DisableNotifyMrUnit implements PersonUnitConfiguration { if (confirmation) { mergeRequestsService.notification(false, mrId); - scheduledExecutorService.schedule(() -> telegramSending.deleteMessage(mail.getFromPersonId(), clickButton.getMessage().getId()), 5, TimeUnit.SECONDS); + //TODO [21.08.2024|uPagge]: fixme + scheduledExecutorService.schedule(() -> telegramSending.deleteMessage(mail.getFromPersonId(), clickButton.getMessage().get().getId()), 5, TimeUnit.SECONDS); return replaceBoxAnswer(SUCCESSFULLY_DISABLED); } else { return replaceBoxAnswer( diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/command/DisableNotifyThreadUnit.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/command/DisableNotifyThreadUnit.java index 075802d..ce8d2f2 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/command/DisableNotifyThreadUnit.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/command/DisableNotifyThreadUnit.java @@ -73,7 +73,8 @@ public class DisableNotifyThreadUnit implements PersonUnitConfiguration { if (confirmation) { discussionService.notification(false, discussionId); - scheduledExecutorService.schedule(() -> telegramSending.deleteMessage(mail.getFromPersonId(), clickButton.getMessage().getId()), 5, TimeUnit.SECONDS); + //TODO [21.08.2024|uPagge]: fixme + scheduledExecutorService.schedule(() -> telegramSending.deleteMessage(mail.getFromPersonId(), clickButton.getMessage().get().getId()), 5, TimeUnit.SECONDS); return replaceBoxAnswer(SUCCESSFULLY_DISABLED); } else { return replaceBoxAnswer( diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java index 84a5d5c..bf035d7 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java @@ -24,6 +24,7 @@ import dev.struchkov.godfather.telegram.starter.PersonUnitConfiguration; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; +import java.util.Optional; import java.util.Set; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -218,6 +219,8 @@ public class InitSettingFlow implements PersonUnitConfiguration { final String personId = mail.getFromPersonId(); final String messageId = Attachments.findFirstButtonClick(mail.getAttachments()) .map(ButtonClickAttachment::getMessage) + //TODO [21.08.2024|uPagge]: fixme + .map(Optional::get) .map(Mail::getId) .orElseThrow(); sending.send( @@ -407,6 +410,8 @@ public class InitSettingFlow implements PersonUnitConfiguration { final String personId = mail.getFromPersonId(); final String messageId = Attachments.findFirstButtonClick(mail.getAttachments()) .map(ButtonClickAttachment::getMessage) + //TODO [21.08.2024|uPagge]: fixme + .map(Optional::get) .map(Message::getId) .orElseThrow(); sending.send( From 6eab8daf315e305c2cd3d6e6fa6dcddb04895b48 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 21 Aug 2024 16:50:44 +0300 Subject: [PATCH 6/7] update .drone.yml --- .drone.yml | 235 +++++++++++++++++++++++++---------------------------- 1 file changed, 111 insertions(+), 124 deletions(-) diff --git a/.drone.yml b/.drone.yml index 23dc182..1682622 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,13 +3,17 @@ kind: pipeline type: docker name: develop build +image_pull_secrets: + - DOCKER_AUTH + trigger: branch: - develop services: - name: docker - image: docker:20.10.22-dind-alpine3.17 + # https://hub.docker.com/r/library/docker + image: hub.docker.struchkov.dev/docker:27.0.3-dind-alpine3.20 privileged: true volumes: - name: dockersock @@ -24,7 +28,8 @@ volumes: steps: - name: create jar - image: maven:3.8.6-eclipse-temurin-17 + # https://hub.docker.com/_/maven + image: hub.docker.struchkov.dev/maven:3.9-eclipse-temurin-17-alpine volumes: - name: m2 path: /root/.m2/repository @@ -32,26 +37,15 @@ steps: - mvn -U clean package - name: docker publish develop - image: upagge/docker-buildx:latest + image: docker.struchkov.dev/docker-buildx:latest environment: - STRUCHKOV_DOCKER_REGISTRY_TOKEN: - from_secret: STRUCHKOV_DOCKER_REGISTRY_TOKEN - STRUCHKOV_DOCKER_IMAGE_NAME: - from_secret: STRUCHKOV_DOCKER_IMAGE_NAME - DOCKER_REGISTRY_TOKEN: - from_secret: DOCKER_REGISTRY_TOKEN - DOCKER_IMAGE_NAME: - from_secret: DOCKER_IMAGE_NAME - DOCKER_REGISTRY_USER: from_secret: DOCKER_REGISTRY_USER volumes: - name: dockersock path: /var/run commands: - - echo "$STRUCHKOV_DOCKER_REGISTRY_TOKEN" | docker login git.struchkov.dev --username $DOCKER_REGISTRY_USER --password-stdin - - echo "$DOCKER_REGISTRY_TOKEN" | docker login docker.io --username $DOCKER_REGISTRY_USER --password-stdin - docker buildx create --use - - docker buildx build -f Dockerfile-develop --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:develop" -t "git.struchkov.dev/$STRUCHKOV_DOCKER_IMAGE_NAME:develop" . + - docker buildx build -f Dockerfile-develop --push --platform linux/amd64,linux/arm64/v8 -t "docker.struchkov.dev/gitlab-notify:develop" . --- @@ -59,13 +53,17 @@ kind: pipeline type: docker name: release build +image_pull_secrets: + - DOCKER_AUTH + trigger: ref: - refs/tags/v.*.*.* services: - name: docker - image: docker:20.10.22-dind-alpine3.17 + # https://hub.docker.com/r/library/docker + image: hub.docker.struchkov.dev/docker:27.0.3-dind-alpine3.20 privileged: true volumes: - name: dockersock @@ -88,122 +86,111 @@ steps: - mvn -U clean package - name: docker publish release - image: upagge/docker-buildx:latest - environment: - STRUCHKOV_DOCKER_REGISTRY_TOKEN: - from_secret: STRUCHKOV_DOCKER_REGISTRY_TOKEN - STRUCHKOV_DOCKER_IMAGE_NAME: - from_secret: STRUCHKOV_DOCKER_IMAGE_NAME - DOCKER_REGISTRY_TOKEN: - from_secret: DOCKER_REGISTRY_TOKEN - DOCKER_IMAGE_NAME: - from_secret: DOCKER_IMAGE_NAME - DOCKER_REGISTRY_USER: - from_secret: DOCKER_REGISTRY_USER + image: docker.struchkov.dev/docker-buildx:latest volumes: - name: dockersock path: /var/run commands: - - echo "$STRUCHKOV_DOCKER_REGISTRY_TOKEN" | docker login git.struchkov.dev --username $DOCKER_REGISTRY_USER --password-stdin - - echo "$DOCKER_REGISTRY_TOKEN" | docker login docker.io --username $DOCKER_REGISTRY_USER --password-stdin - docker buildx create --use - - docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:latest" -t "$DOCKER_IMAGE_NAME:$DRONE_TAG" -t "git.struchkov.dev/$STRUCHKOV_DOCKER_IMAGE_NAME:latest" -t "git.struchkov.dev/$STRUCHKOV_DOCKER_IMAGE_NAME:$DRONE_TAG" . + - docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "docker.struchkov.dev/gitlab-notify:latest" -t "docker.struchkov.dev/gitlab-notify:$DRONE_TAG" . ---- -kind: pipeline -type: docker -name: create-develop-docs-site +#--- +#kind: pipeline +#type: docker +#name: create-develop-docs-site +# +#trigger: +# branch: +# - develop +# - docs +# +#clone: +# disable: true +# +#steps: +# +# - name: build docs +# image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest +# volumes: +# - name: mkdocs_cache +# path: ${DRONE_WORKSPACE}/documentation/ru/.cache +# environment: +# GIT_SSH: +# from_secret: GIT_SSH +# GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222" +# commands: +# - eval $(ssh-agent -s) +# - mkdir -p ~/.ssh +# - chmod 700 ~/.ssh +# - echo "$GIT_SSH" >> ~/.ssh/id_rsa +# - chmod 600 ~/.ssh/id_rsa +# - ssh-keyscan -p 222 git.struchkov.dev >> ~/.ssh/known_hosts +# - chmod 644 ~/.ssh/known_hosts +# - git config --global user.name "${DRONE_COMMIT_AUTHOR_NAME}" +# - git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}" +# - git clone ssh://git@git.struchkov.dev:222/Telegram-Bots/gitlab-notification.git . +# - git checkout $DRONE_COMMIT +# - cd documentation/ru +# - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases develop +# +#image_pull_secrets: +# - DOCKER_AUTH +# +#volumes: +# - name: mkdocs_cache +# host: +# path: /drone/volume/mkdocs_cache/gitlab_notification/ru +# +#--- +#kind: pipeline +#type: docker +#name: create-release-docs-site +# +#trigger: +# ref: +# - refs/tags/v.*.*.* +# +#clone: +# disable: true +# +#steps: +# +# - name: build docs +# image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest +# volumes: +# - name: mkdocs_cache +# path: ${DRONE_WORKSPACE}/documentation/ru/.cache +# environment: +# GIT_SSH: +# from_secret: GIT_SSH +# GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222" +# commands: +# - eval $(ssh-agent -s) +# - mkdir -p ~/.ssh +# - chmod 700 ~/.ssh +# - echo "$GIT_SSH" >> ~/.ssh/id_rsa +# - chmod 600 ~/.ssh/id_rsa +# - ssh-keyscan -p 222 git.struchkov.dev >> ~/.ssh/known_hosts +# - chmod 644 ~/.ssh/known_hosts +# - git config --global user.name "${DRONE_COMMIT_AUTHOR_NAME}" +# - git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}" +# - git clone ssh://git@git.struchkov.dev:222/Telegram-Bots/gitlab-notification.git . +# - git checkout $DRONE_COMMIT +# - cd documentation/ru +# - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases ${DRONE_TAG} +# - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases latest +# +#image_pull_secrets: +# - DOCKER_AUTH +# +#volumes: +# - name: mkdocs_cache +# host: +# path: /drone/volume/mkdocs_cache/gitlab_notification\ -trigger: - branch: - - develop - - docs - -clone: - disable: true - -steps: - - - name: build docs - image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest - volumes: - - name: mkdocs_cache - path: ${DRONE_WORKSPACE}/documentation/ru/.cache - environment: - GIT_SSH: - from_secret: GIT_SSH - GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222" - commands: - - eval $(ssh-agent -s) - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - echo "$GIT_SSH" >> ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa - - ssh-keyscan -p 222 git.struchkov.dev >> ~/.ssh/known_hosts - - chmod 644 ~/.ssh/known_hosts - - git config --global user.name "${DRONE_COMMIT_AUTHOR_NAME}" - - git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}" - - git clone ssh://git@git.struchkov.dev:222/Telegram-Bots/gitlab-notification.git . - - git checkout $DRONE_COMMIT - - cd documentation/ru - - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases develop - -image_pull_secrets: - - DOCKER_AUTH - -volumes: - - name: mkdocs_cache - host: - path: /drone/volume/mkdocs_cache/gitlab_notification/ru - ---- -kind: pipeline -type: docker -name: create-release-docs-site - -trigger: - ref: - - refs/tags/v.*.*.* - -clone: - disable: true - -steps: - - - name: build docs - image: git.struchkov.dev/upagge/mkdocs-material-insiders:latest - volumes: - - name: mkdocs_cache - path: ${DRONE_WORKSPACE}/documentation/ru/.cache - environment: - GIT_SSH: - from_secret: GIT_SSH - GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -p 222" - commands: - - eval $(ssh-agent -s) - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - echo "$GIT_SSH" >> ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa - - ssh-keyscan -p 222 git.struchkov.dev >> ~/.ssh/known_hosts - - chmod 644 ~/.ssh/known_hosts - - git config --global user.name "${DRONE_COMMIT_AUTHOR_NAME}" - - git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}" - - git clone ssh://git@git.struchkov.dev:222/Telegram-Bots/gitlab-notification.git . - - git checkout $DRONE_COMMIT - - cd documentation/ru - - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases ${DRONE_TAG} - - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases latest - -image_pull_secrets: - - DOCKER_AUTH - -volumes: - - name: mkdocs_cache - host: - path: /drone/volume/mkdocs_cache/gitlab_notification +# drone sign --save Telegram-Bots/gitlab-notification --- kind: signature -hmac: cf1bd0800e8f6bb49dae0a6c5f607676b87d5ee713f4203f4f1ed08a17f71f68 +hmac: 0f4fa66591566ee4272ac8c36e887966037a407a1441575ef26e1813205a7ae8 ... From 60a71731bd6eb999d94ae0d755140c94fc2dde6e Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 21 Aug 2024 16:57:04 +0300 Subject: [PATCH 7/7] fixed Dockerfile --- Dockerfile | 2 +- Dockerfile-develop | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4c4e97e..ae5aecf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:17 as app-build +FROM eclipse-temurin:17 AS app-build ENV RELEASE=17 WORKDIR /opt/build diff --git a/Dockerfile-develop b/Dockerfile-develop index f1faba1..9341a57 100644 --- a/Dockerfile-develop +++ b/Dockerfile-develop @@ -1,4 +1,4 @@ -FROM eclipse-temurin:17 as app-build +FROM eclipse-temurin:17 AS app-build ENV RELEASE=17 WORKDIR /opt/build