From af2085b75a162f716401fe5245c14f5cb8a03ae3 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 17 Jan 2024 15:18:27 +0100 Subject: [PATCH] Provide a platform PR link targeting the proper branch when we can --- .../io/quarkus/bot/release/step/PreparePlatform.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/quarkus/bot/release/step/PreparePlatform.java b/src/main/java/io/quarkus/bot/release/step/PreparePlatform.java index 35041ae..ba4133e 100644 --- a/src/main/java/io/quarkus/bot/release/step/PreparePlatform.java +++ b/src/main/java/io/quarkus/bot/release/step/PreparePlatform.java @@ -41,7 +41,7 @@ public boolean shouldPause(Context context, Commands commands, GitHub quarkusBot if (!releaseInformation.isFinal()) { comment.append("* In the case of `preview releases` (e.g. `Alpha1`, `CR1`...), the release will be built from the `main` branch\n"); } - comment.append("* Follow (roughly) these steps:\n\n"); + comment.append("* Follow (roughly) these steps (`upstream` is the upstream repository, `origin` is your fork):\n\n"); comment.append("```\n"); comment.append("cd \n"); comment.append("git checkout " + platformPreparationBranch + "\n"); @@ -55,7 +55,12 @@ public boolean shouldPause(Context context, Commands commands, GitHub quarkusBot comment.append("git commit -m 'Upgrade to Quarkus " + releaseInformation.getVersion() + "'\n"); comment.append("git push origin quarkus-" + releaseInformation.getVersion() + "\n"); comment.append("```\n\n"); - comment.append("* [Create a pull request](https://github.com/quarkusio/quarkus-platform/pulls) targeting branch `" + platformPreparationBranch + "`\n"); + try { + comment.append("* [Create a pull request](https://github.com/quarkusio/quarkus-platform/compare/" + platformPreparationBranch + "..." + issue.getUser().getLogin() + ":quarkus-" + releaseInformation.getVersion() + "?expand=1) targeting branch `" + platformPreparationBranch + "`" + + " (or [generic link if targeted link doesn't work](https://github.com/quarkusio/quarkus-platform/pulls))\n"); + } catch (IOException e) { + comment.append("* [Create a pull request](https://github.com/quarkusio/quarkus-platform/pulls) targeting branch `" + platformPreparationBranch + "`\n"); + } comment.append("* Wait for CI to go green\n"); comment.append("* Merge the pull request\n"); if (releaseInformation.isFirstFinal()) {