Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various minor things #141

Merged
merged 4 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public boolean shouldPause(Context context, Commands commands, GitHub quarkusBot
comment.append("- Quarkus `").append(releaseInformation.getVersion()).append("`\n");
comment.append("- On branch `").append(releaseInformation.getBranch()).append("`");
if (releaseInformation.isFirstCR()) {
comment.append(" (it will get created further in the process)");
comment.append(" (it will get created a bit further in the process)");
}
comment.append("\n");
comment.append("- With Java `").append(jdks.getJdkVersion(releaseInformation.getBranch())).append("`\n");
Expand Down Expand Up @@ -66,6 +66,20 @@ public boolean shouldPause(Context context, Commands commands, GitHub quarkusBot
+ "` comment if you want to continue with the release.\n" +
"\n" +
"If not, simply close this issue.") + "\n\n");

if (releaseInformation.isFirstCR()) {
comment.append(Admonitions.tip("Don't go too far, we will need further input from you very soon.") + "\n\n");
}

comment.append("---\n\n<details><summary>Legend for the admonitions</summary>\n\n");
comment.append(Admonitions.important("A manual confirmation/intervention is needed.") + "\n\n");
comment.append(Admonitions.tip("Some useful information about the release process.") + "\n\n");
comment.append(Admonitions.note("Some additional information.") + "\n\n");
comment.append(Admonitions.warning("Something important to consider.") + "\n\n");
comment.append(Admonitions.caution("An error occurred.") + "\n\n");
comment.append("</details>\n\n");


comment.append(Progress.youAreHere(releaseInformation, releaseStatus));
commands.setOutput(Outputs.INTERACTION_COMMENT, comment.toString());
return true;
Expand Down
36 changes: 22 additions & 14 deletions src/main/java/io/quarkus/bot/release/step/CreateBranch.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public boolean shouldPause(Context context, Commands commands, GitHub quarkusBot
previousMinorBranch = "previous minor";
}

comment.append(getBranchEmail(releaseInformation, previousMinorBranch, null) + "\n\n");
comment.append(getBranchEmail(releaseInformation, previousMinorBranch, null, false, null) + "\n\n");
comment.append("Once you are done with all this, add a `" + Command.MANUAL.getFullCommand() + "` comment to let the release process know you have handled everything manually.\n\n");
comment.append("</details>\n\n");

Expand Down Expand Up @@ -129,6 +129,13 @@ public int run(Context context, Commands commands, GitHub quarkusBotGitHub, Rele

Optional<GHMilestone> versionedMilestone = getMilestone(repository, releaseInformation.getVersion());
String nextMinor = getNextMinor(releaseInformation.getBranch());
boolean isNextMinorLts = false;
String nextMinorInMain = nextMinor;

if (Branches.isLts(nextMinor)) {
isNextMinorLts = true;
nextMinorInMain = getNextMinor(nextMinor);
}

if (versionedMilestone.isEmpty()) {
// the version milestone does not exist, we try to rename the "X.Y - main" milestone to the version
Expand All @@ -138,7 +145,7 @@ public int run(Context context, Commands commands, GitHub quarkusBotGitHub, Rele
try {
milestone.get().setTitle(releaseInformation.getVersion());

repository.createMilestone(nextMinor + MAIN_MILESTONE_SUFFIX, "");
repository.createMilestone(nextMinorInMain + MAIN_MILESTONE_SUFFIX, "");
} catch (Exception e) {
throw new IllegalStateException("Unable to update the milestone or create the new milestone: " + e.getMessage(), e);
}
Expand Down Expand Up @@ -194,13 +201,13 @@ public int run(Context context, Commands commands, GitHub quarkusBotGitHub, Rele

String comment = ":white_check_mark: Branch " + releaseInformation.getBranch()
+ " has been created and the milestone and backport labels adjusted.\n\n";
comment += "We created a new `" + nextMinor + " - main`"
comment += "We created a new `" + nextMinorInMain + " - main`"
+ " milestone for future developments.\n\n";
comment += "Make sure to [adjust the name of the milestone](https://github.com/quarkusio/quarkus/milestones) if needed as the name has simply been inferred from the current release.\n\n";
comment += Admonitions.important("Please announce that we branched " + releaseInformation.getBranch()
+ " by sending an email to [[email protected]](mailto:[email protected]) and posting on [Zulip #dev stream](https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/):\n\n"
+ "**(Make sure to adjust the version in the email if you renamed the milestone)**\n\n"
+ getBranchEmail(releaseInformation, previousMinorBranch, nextMinor)) + "\n\n";
+ getBranchEmail(releaseInformation, previousMinorBranch, nextMinor, isNextMinorLts, nextMinorInMain)) + "\n\n";
comment += Admonitions.tip(
"**Apart from sending the email and posting on Zulip, no intervention from you is needed, the release process is in progress.**\n\n"
+
Expand Down Expand Up @@ -229,14 +236,7 @@ private static String getNextMinor(String currentBranch) {
throw new IllegalStateException("CR1 releases should be made from a versioned branch and not from main");
}

String nextMinor = segments[0] + "." + (Integer.parseInt(segments[1]) + 1);

// if the nextMinor is an LTS version, we will skip it for the main branch, thus we increment by 2
if (Branches.isLts(nextMinor)) {
return segments[0] + "." + (Integer.parseInt(segments[1]) + 2);
}

return nextMinor;
return segments[0] + "." + (Integer.parseInt(segments[1]) + 1);
}

private static Optional<GHMilestone> getMilestone(GHRepository repository, String name) {
Expand All @@ -250,7 +250,8 @@ private static Optional<GHMilestone> getMilestone(GHRepository repository, Strin
}
}

private static String getBranchEmail(ReleaseInformation releaseInformation, String previousMinorBranch, String nextMinor) {
private static String getBranchEmail(ReleaseInformation releaseInformation, String previousMinorBranch, String nextMinor,
boolean isNextMinorLts, String nextMinorInMain) {
String email = "Subject:\n"
+ "```\n"
+ "Quarkus " + releaseInformation.getBranch() + " branched\n"
Expand All @@ -259,7 +260,14 @@ private static String getBranchEmail(ReleaseInformation releaseInformation, Stri
+ "```\n"
+ "Hi,\n"
+ "\n"
+ "We just branched " + releaseInformation.getBranch() + ". The main branch is now " + (nextMinor != null ? nextMinor : "**X.Y**") + ".\n"
+ "We just branched " + releaseInformation.getBranch() + ". The main branch is now "
+ (nextMinorInMain != null ? nextMinorInMain : "**X.Y**");

if (isNextMinorLts && nextMinor != null) {
email += " (" + nextMinor + " will be branched from " + releaseInformation.getBranch() + ")";
}

email += ".\n"
+ "\n"
+ "Please make sure you add the appropriate backport labels from now on:\n"
+ "\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ public boolean shouldPause(Context context, Commands commands, GitHub quarkusBot
comment.append(Admonitions.important("First, you need to update the Platform locally, create a pull request, wait for CI and merge it.\n\n" +
"You can find detailed instructions below.") + "\n\n");

comment.append("* Follow (roughly) these steps (`upstream` is the upstream repository, `origin` is your fork):\n\n");
comment.append("* Go into your Quarkus Platform clone directory:\n\n");
comment.append("```\n");
comment.append("cd <your quarkus-platform clone>\n");
comment.append("```\n");
comment.append("* Follow (roughly) these steps (`upstream` is the upstream repository, `origin` is your fork):\n\n");
comment.append("```\n");
if (releaseInformation.isOriginBranchMain()) {
comment.append("git checkout " + platformPreparationBranch + "\n");
comment.append("git pull upstream " + platformPreparationBranch + "\n");
Expand Down