diff --git a/src/main/java/io/quarkus/bot/release/GetReleaseInformationAction.java b/src/main/java/io/quarkus/bot/release/GetReleaseInformationAction.java index 7c02ab9..488510d 100644 --- a/src/main/java/io/quarkus/bot/release/GetReleaseInformationAction.java +++ b/src/main/java/io/quarkus/bot/release/GetReleaseInformationAction.java @@ -3,9 +3,11 @@ import jakarta.inject.Inject; import org.kohsuke.github.GHEventPayload; +import org.kohsuke.github.GHIssue; import io.quarkiverse.githubaction.Action; import io.quarkiverse.githubaction.Commands; +import io.quarkiverse.githubapp.event.Issue; import io.quarkiverse.githubapp.event.IssueComment; import io.quarkus.bot.release.util.Issues; import io.quarkus.bot.release.util.Outputs; @@ -16,15 +18,26 @@ public class GetReleaseInformationAction { @Inject Issues issues; + @Action("get-release-information") + void getReleaseInformation(Commands commands, @Issue.Opened GHEventPayload.Issue issuePayload) { + extractReleaseInformation(commands, issuePayload.getIssue()); + } + @Action("get-release-information") void getReleaseInformation(Commands commands, @IssueComment.Created GHEventPayload.IssueComment issueCommentPayload) { + extractReleaseInformation(commands, issueCommentPayload.getIssue()); + } + + private void extractReleaseInformation(Commands commands, GHIssue issue) { + commands.notice("Extracting release information..."); + ReleaseInformation releaseInformation; try { - UpdatedIssueBody updatedIssueBody = new UpdatedIssueBody(issueCommentPayload.getIssue().getBody()); + UpdatedIssueBody updatedIssueBody = new UpdatedIssueBody(issue.getBody()); releaseInformation = issues.extractReleaseInformation(updatedIssueBody); } catch (Exception e) { - releaseInformation = issues.extractReleaseInformationFromForm(issueCommentPayload.getIssue().getBody()); + releaseInformation = issues.extractReleaseInformationFromForm(issue.getBody()); } commands.setOutput(Outputs.BRANCH, releaseInformation.getBranch()); diff --git a/src/main/java/io/quarkus/bot/release/GetReleaseStatusAction.java b/src/main/java/io/quarkus/bot/release/GetReleaseStatusAction.java index 092bbc3..bb9237f 100644 --- a/src/main/java/io/quarkus/bot/release/GetReleaseStatusAction.java +++ b/src/main/java/io/quarkus/bot/release/GetReleaseStatusAction.java @@ -18,6 +18,8 @@ public class GetReleaseStatusAction { @Action("get-release-status") void getReleaseStatus(Commands commands, @IssueComment.Created GHEventPayload.IssueComment issueCommentPayload) { + commands.notice("Extracting release status information..."); + UpdatedIssueBody updatedIssueBody = new UpdatedIssueBody(issueCommentPayload.getIssue().getBody()); ReleaseStatus releaseStatus = issues.extractReleaseStatus(updatedIssueBody); diff --git a/src/main/java/io/quarkus/bot/release/PostInteractionCommentAction.java b/src/main/java/io/quarkus/bot/release/PostInteractionCommentAction.java index f7e46a2..f9177fb 100644 --- a/src/main/java/io/quarkus/bot/release/PostInteractionCommentAction.java +++ b/src/main/java/io/quarkus/bot/release/PostInteractionCommentAction.java @@ -29,6 +29,8 @@ void postInteractionComment(Commands commands, Inputs inputs, } private void postInteractionComment(Commands commands, Inputs inputs, GHIssue issue) throws IOException { + commands.notice("Posting interaction comment"); + Optional interactionCommentInput = inputs.get(Outputs.INTERACTION_COMMENT); if (interactionCommentInput.isEmpty() || interactionCommentInput.get().isBlank()) { commands.warning("No " + Outputs.INTERACTION_COMMENT + " input, not posting interaction comment"); diff --git a/src/main/java/io/quarkus/bot/release/ReleaseAction.java b/src/main/java/io/quarkus/bot/release/ReleaseAction.java index 37c88cf..37ae4fd 100644 --- a/src/main/java/io/quarkus/bot/release/ReleaseAction.java +++ b/src/main/java/io/quarkus/bot/release/ReleaseAction.java @@ -45,6 +45,8 @@ public class ReleaseAction { @Action void startRelease(Context context, Commands commands, @Issue.Opened GHEventPayload.Issue issuePayload) throws Exception { + commands.notice("Starting release..."); + GHIssue issue = issuePayload.getIssue(); UpdatedIssueBody updatedIssueBody = new UpdatedIssueBody(issue.getBody()); @@ -88,6 +90,8 @@ void startRelease(Context context, Commands commands, @Issue.Opened GHEventPaylo @Action void onComment(Context context, Commands commands, @IssueComment.Created GHEventPayload.IssueComment issueCommentPayload) throws Exception { + commands.notice("Continuing release..."); + GHIssueComment issueComment = issueCommentPayload.getComment(); GHIssue issue = issueCommentPayload.getIssue(); UpdatedIssueBody updatedIssueBody = new UpdatedIssueBody(issue.getBody());