Skip to content

Commit

Permalink
Merge pull request #88 from gsmet/lts
Browse files Browse the repository at this point in the history
Handle LTS releases
  • Loading branch information
gsmet authored Mar 7, 2024
2 parents 4c64604 + 0cb19c7 commit 6289624
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.quarkus.arc.Unremovable;
import io.quarkus.bot.release.ReleaseInformation;
import io.quarkus.bot.release.ReleaseStatus;
import io.quarkus.bot.release.util.Branches;
import io.quarkus.bot.release.util.Repositories;
import io.quarkus.bot.release.util.UpdatedIssueBody;
import io.quarkus.bot.release.util.Versions;
Expand All @@ -43,9 +44,13 @@ public int run(Context context, Commands commands, GitHub quarkusBotGitHub, Rele
comment.append("to trigger the performance evaluation testing for this release.\n\n");

if (releaseInformation.isFinal()) {
comment.append("Then it is time to write the announcement:\n\n");
comment.append("Then it is time to announce the release:\n\n");
if (!releaseInformation.isMaintenance()) {
comment.append("* Update the versions in `_data/versions.yaml`\n");
comment.append("* Update the versions of the website in [`_data/versions.yaml`](https://github.com/quarkusio/quarkusio.github.io/blob/develop/_data/versions.yaml)\n");
}
if (Branches.isLts(releaseInformation.getBranch())) {
comment.append(
"* This is a LTS version so make sure the version is referenced in the `documentation:` section of [`_data/versions.yaml`](https://github.com/quarkusio/quarkusio.github.io/blob/develop/_data/versions.yaml)\n");
}
comment.append("* Write a blog post for [the website](https://github.com/quarkusio/quarkusio.github.io)\n");
comment.append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.quarkus.arc.Unremovable;
import io.quarkus.bot.release.ReleaseInformation;
import io.quarkus.bot.release.ReleaseStatus;
import io.quarkus.bot.release.util.Branches;
import io.quarkus.bot.release.util.Command;
import io.quarkus.bot.release.util.Jdks;
import io.quarkus.bot.release.util.Outputs;
Expand All @@ -39,7 +40,9 @@ public boolean shouldPause(Context context, Commands commands, GitHub quarkusBot
comment.append("- :bulb: We detected that this `" + releaseInformation.getVersion() + "` release will be the first final as `"
+ Versions.getDot0(releaseInformation.getVersion()) + "` has not been fully released\n");
}
if (releaseInformation.isMaintenance()) {
if (Branches.isLts(releaseInformation.getBranch())) {
comment.append("- This is a `LTS` release.\n");
} else if (releaseInformation.isMaintenance()) {
comment.append("- This is a `maintenance` release.\n");
}
if (!releaseInformation.isFinal()) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/io/quarkus/bot/release/step/CreateBranch.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ private static String getBranchEmail(ReleaseInformation releaseInformation, Stri
+ "- for fixes we also want in future " + previousMinorBranch + ", please add the triage/backport-" + previousMinorBranch + "? label\n";

for (String ltsBranch : Branches.LTS_BRANCHES) {
if (ltsBranch.equals(releaseInformation.getBranch())) {
continue;
}

email += "- for fixes we also want in future " + ltsBranch + ", please add the triage/backport-" + ltsBranch + "? label\n";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.quarkus.arc.Unremovable;
import io.quarkus.bot.release.ReleaseInformation;
import io.quarkus.bot.release.ReleaseStatus;
import io.quarkus.bot.release.util.Branches;
import io.quarkus.bot.release.util.Processes;
import io.quarkus.bot.release.util.UpdatedIssueBody;

Expand All @@ -27,6 +28,17 @@ public class UpdateDocumentation implements StepHandler {
@Override
public int run(Context context, Commands commands, GitHub quarkusBotGitHub, ReleaseInformation releaseInformation,
ReleaseStatus releaseStatus, GHIssue issue, UpdatedIssueBody updatedIssueBody) throws IOException, InterruptedException {
return processes.execute(List.of("./update-docs.sh"));
int status = processes.execute(List.of("./update-docs.sh"));

if (status != 0) {
return status;
}

// for LTS releases that are not maintenance release yet, we also push the version in a versioned directory
if (Branches.isLts(releaseInformation.getBranch()) && !releaseInformation.isMaintenance()) {
status = processes.execute(List.of("./update-docs.sh", releaseInformation.getBranch()));
}

return status;
}
}
14 changes: 13 additions & 1 deletion src/main/java/io/quarkus/bot/release/step/UpdateQuickstarts.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.quarkus.arc.Unremovable;
import io.quarkus.bot.release.ReleaseInformation;
import io.quarkus.bot.release.ReleaseStatus;
import io.quarkus.bot.release.util.Branches;
import io.quarkus.bot.release.util.Processes;
import io.quarkus.bot.release.util.UpdatedIssueBody;

Expand All @@ -27,7 +28,18 @@ public class UpdateQuickstarts implements StepHandler {
@Override
public int run(Context context, Commands commands, GitHub quarkusBotGitHub, ReleaseInformation releaseInformation,
ReleaseStatus releaseStatus, GHIssue issue, UpdatedIssueBody updatedIssueBody) throws IOException, InterruptedException {
return processes.execute(List.of("./update-quickstarts.sh"));
int status = processes.execute(List.of("./update-quickstarts.sh"));

if (status != 0) {
return status;
}

// for LTS releases that are not maintenance release yet, we also push the version in a branch
if (Branches.isLts(releaseInformation.getBranch()) && !releaseInformation.isMaintenance()) {
status = processes.execute(List.of("./update-quickstarts.sh", releaseInformation.getBranch()));
}

return status;
}

@Override
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/io/quarkus/bot/release/util/Branches.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class Branches {

public static final String MAIN = "main";
public static final List<String> LTS_BRANCHES = List.of("3.2", "2.13");
public static final List<String> LTS_BRANCHES = List.of("3.8", "3.2", "2.13");

public static String getPlatformPreparationBranch(ReleaseInformation releaseInformation) {
if (releaseInformation.isFinal() && !releaseInformation.isFirstFinal()) {
Expand All @@ -25,6 +25,10 @@ public static String getPlatformReleaseBranch(ReleaseInformation releaseInformat
return MAIN;
}

public static boolean isLts(String branch) {
return LTS_BRANCHES.contains(branch);
}

private Branches() {
}
}
10 changes: 10 additions & 0 deletions src/test/java/io/quarkus/bot/release/BranchesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,14 @@ void testBugfixFinalRelease() {
assertThat(Branches.getPlatformPreparationBranch(releaseInformation)).isEqualTo("3.6");
assertThat(Branches.getPlatformReleaseBranch(releaseInformation)).isEqualTo("3.6");
}

@Test
void testLts() {
assertThat(Branches.isLts("2.13")).isTrue();
assertThat(Branches.isLts("2.14")).isFalse();
assertThat(Branches.isLts("3.2")).isTrue();
assertThat(Branches.isLts("3.4")).isFalse();
assertThat(Branches.isLts("3.8")).isTrue();
assertThat(Branches.isLts("3.9")).isFalse();
}
}

0 comments on commit 6289624

Please sign in to comment.