-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from gsmet/third-iteration
Handle the Platform release and call a monitoring workflow
- Loading branch information
Showing
14 changed files
with
346 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
src/main/java/io/quarkus/bot/release/step/PreparePlatform.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
package io.quarkus.bot.release.step; | ||
|
||
import java.io.IOException; | ||
|
||
import jakarta.inject.Singleton; | ||
|
||
import org.kohsuke.github.GHIssue; | ||
import org.kohsuke.github.GHIssueComment; | ||
|
||
import io.quarkiverse.githubaction.Commands; | ||
import io.quarkiverse.githubaction.Context; | ||
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.Outputs; | ||
import io.quarkus.bot.release.util.UpdatedIssueBody; | ||
|
||
@Singleton | ||
@Unremovable | ||
public class PreparePlatform implements StepHandler { | ||
|
||
@Override | ||
public boolean shouldPause(Context context, Commands commands, ReleaseInformation releaseInformation, | ||
ReleaseStatus releaseStatus, GHIssue issue, GHIssueComment issueComment) { | ||
|
||
String platformPreparationBranch = Branches.getPlatformPreparationBranch(releaseInformation); | ||
String platformReleaseBranch = Branches.getPlatformReleaseBranch(releaseInformation); | ||
|
||
StringBuilder comment = new StringBuilder(); | ||
if (releaseInformation.isFirstFinal()) { | ||
comment.append("Now is time to update Quarkus in the Quarkus Platform. This is a manual process.\n\n"); | ||
comment.append(":warning: **This is the `.0` release so we update the Platform first then wait one week for the Platform members to contribute their updates then we release. Make sure you follow the instructions closely.**\n\n"); | ||
} else { | ||
comment.append("Now is time to update Quarkus in the Quarkus Platform. This is a manual process:\n\n"); | ||
} | ||
|
||
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("* Then follow (roughly) this process:\n\n"); | ||
comment.append("```\n"); | ||
comment.append("cd <your quarkus-platform clone>\n"); | ||
comment.append("git checkout " + platformPreparationBranch + "\n"); | ||
comment.append("git pull upstream " + platformPreparationBranch + "\n"); | ||
comment.append("git checkout -b quarkus-" + releaseInformation.getVersion() + "\n"); | ||
comment.append("./update-quarkus-version.sh " + releaseInformation.getVersion() + "\n"); | ||
comment.append("```\n\n"); | ||
comment.append("* Check the diff with `git diff`\n\n"); | ||
comment.append("```\n"); | ||
comment.append("git add .\n"); | ||
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) for branch `" + platformPreparationBranch + "`\n"); | ||
comment.append("* Wait for CI to go green\n"); | ||
comment.append("* Merge the pull request\n"); | ||
if (releaseInformation.isFirstFinal()) { | ||
comment.append("* Send an email to the Platform coordination mailing list: [[email protected]](mailto:[email protected]) :\n\n"); | ||
comment.append("> Quarkus " + releaseInformation.getVersion() + " core artifacts are available\n\n"); | ||
comment.append("> Hi,\n" | ||
+ "> \n" | ||
+ "> The Quarkus " + releaseInformation.getVersion() + " core artifacts are available on Maven Central.\n" | ||
+ "> \n" | ||
+ "> CI is still running for the upgrade, the pull request will be merged once CI has passed.\n" | ||
+ "> We will ping teams in the pull request if some components have issues.\n\n" | ||
+ "> If you want to update your components, please create your pull requests and make sure they are merged before next Tuesday.\n" | ||
+ "> \n" | ||
+ "> Thanks.\n\n"); | ||
comment.append("* If CI failed for some Platform members, please contact them so that they are aware of the issues\n\n"); | ||
comment.append(":warning: **IMPORTANT - STOP HERE**\n"); | ||
comment.append(":warning: **IMPORTANT - Wait a week before continuing with the Platform release**\n\n"); | ||
comment.append("* Make sure you have merged all the pull requests that should be included in this version of the Platform\n\n"); | ||
comment.append("* Once all the pull requests are merged, create the branch:\n\n"); | ||
comment.append("```\n"); | ||
comment.append("git checkout main\n"); | ||
comment.append("git pull upstream main\n"); | ||
comment.append("git checkout -b " + platformReleaseBranch + "\n"); | ||
comment.append("git push upstream " + platformReleaseBranch + "\n"); | ||
comment.append("```\n\n"); | ||
} else { | ||
comment.append("* Make sure you have merged [all the pull requests](https://github.com/quarkusio/quarkus-platform/pulls) that should be included in this version of the Platform\n\n"); | ||
} | ||
|
||
comment.append( | ||
"Once everything has been merged to branch `" + platformReleaseBranch + "`, you can continue with the release by adding a `" | ||
+ Command.CONTINUE.getFullCommand() + "` comment."); | ||
commands.setOutput(Outputs.INTERACTION_COMMENT, comment.toString()); | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public boolean shouldContinue(Context context, Commands commands, | ||
ReleaseInformation releaseInformation, ReleaseStatus releaseStatus, GHIssue issue, GHIssueComment issueComment) { | ||
return Command.CONTINUE.matches(issueComment.getBody()); | ||
} | ||
|
||
@Override | ||
public int run(Context context, Commands commands, ReleaseInformation releaseInformation, GHIssue issue, | ||
UpdatedIssueBody updatedIssueBody) throws IOException, InterruptedException { | ||
issue.comment(":white_check_mark: The Platform branch `" + Branches.getPlatformPreparationBranch(releaseInformation) | ||
+ "` is ready to be released, continuing..."); | ||
return 0; | ||
} | ||
} |
107 changes: 12 additions & 95 deletions
107
src/main/java/io/quarkus/bot/release/step/ReleasePlatform.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,119 +1,36 @@ | ||
package io.quarkus.bot.release.step; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
import jakarta.inject.Inject; | ||
import jakarta.inject.Singleton; | ||
|
||
import org.kohsuke.github.GHIssue; | ||
import org.kohsuke.github.GHIssueComment; | ||
|
||
import io.quarkiverse.githubaction.Commands; | ||
import io.quarkiverse.githubaction.Context; | ||
import io.quarkus.arc.Unremovable; | ||
import io.quarkus.bot.release.ReleaseInformation; | ||
import io.quarkus.bot.release.ReleaseStatus; | ||
import io.quarkus.bot.release.util.Command; | ||
import io.quarkus.bot.release.util.Outputs; | ||
import io.quarkus.bot.release.util.Branches; | ||
import io.quarkus.bot.release.util.Processes; | ||
import io.quarkus.bot.release.util.UpdatedIssueBody; | ||
import io.quarkus.bot.release.util.Versions; | ||
|
||
@Singleton | ||
@Unremovable | ||
public class ReleasePlatform implements StepHandler { | ||
|
||
@Override | ||
public boolean shouldPause(Context context, Commands commands, ReleaseInformation releaseInformation, | ||
ReleaseStatus releaseStatus) { | ||
|
||
String branch; | ||
if (releaseInformation.isFinal()) { | ||
branch = releaseInformation.getBranch(); | ||
} else { | ||
branch = "main"; | ||
} | ||
|
||
StringBuilder comment = new StringBuilder(); | ||
if (releaseInformation.isFirstFinal()) { | ||
comment.append("Now is time to update Quarkus in the Quarkus Platform. This is a manual process.\n\n"); | ||
comment.append(":warning: **This is the `.0` release so we update the Platform first then wait one week for the Platform members to contribute their updates then we release. Make sure you follow the instructions closely.**\n\n"); | ||
} else { | ||
comment.append("Now is time to release the Quarkus Platform. This is a manual process:\n\n"); | ||
} | ||
comment.append("* Make sure you have merged [all the pull requests](https://github.com/quarkusio/quarkus-platform/pulls) that should be included in this version of the Platform\n"); | ||
comment.append("* Then follow (roughly) this process:\n\n"); | ||
comment.append("```\n"); | ||
comment.append("cd <your quarkus-platform clone>\n"); | ||
comment.append("git checkout " + branch + "\n"); | ||
comment.append("git pull upstream " + branch + "\n"); | ||
comment.append("git checkout -b quarkus-" + releaseInformation.getVersion() + "\n"); | ||
comment.append("./update-quarkus-version.sh " + releaseInformation.getVersion() + "\n"); | ||
comment.append("```\n\n"); | ||
comment.append("* Check the diff with `git diff`\n\n"); | ||
comment.append("```\n"); | ||
comment.append("git add .\n"); | ||
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) for branch " + branch + "\n"); | ||
comment.append("* Wait for CI to go green\n"); | ||
comment.append("* Merge the pull request\n"); | ||
if (releaseInformation.isFirstFinal()) { | ||
comment.append("* Send an email to the Platform coordination mailing list: [[email protected]](mailto:[email protected]) :\n\n"); | ||
comment.append("> Quarkus " + releaseInformation.getVersion() + " core artifacts are available\n\n"); | ||
comment.append("> Hi,\n" | ||
+ "> \n" | ||
+ "> The Quarkus " + releaseInformation.getVersion() + " core artifacts are available on Maven Central.\n" | ||
+ "> \n" | ||
+ "> CI is still running for the upgrade, the pull request will be merged once CI has passed.\n" | ||
+ "> We will ping teams in the pull request if some components have issues.\n\n" | ||
+ "> If you want to update your components, please create your pull requests and make sure they are merged before next Tuesday.\n" | ||
+ "> \n" | ||
+ "> Thanks.\n\n"); | ||
comment.append("* Merge the pull request when it has passed\n"); | ||
comment.append("* If CI fails for some Platform members, please contact them so that they are aware of the issues\n\n"); | ||
comment.append(":warning: **IMPORTANT - STOP HERE**\n"); | ||
comment.append(":warning: **IMPORTANT - Wait a week before continuing with the Platform release**\n\n"); | ||
comment.append("* Make sure you have merged all the pull requests that should be included in this version of the Platform\n\n"); | ||
comment.append("```\n"); | ||
comment.append("git checkout main\n"); | ||
comment.append("git pull upstream main\n"); | ||
comment.append("git checkout -b " + releaseInformation.getBranch() + "\n"); | ||
comment.append("git push upstream " + releaseInformation.getBranch() + "\n"); | ||
comment.append("```\n\n"); | ||
} else { | ||
comment.append("```\n"); | ||
comment.append("git checkout " + branch + "\n"); | ||
comment.append("git pull upstream " + branch + "\n"); | ||
comment.append("```\n\n"); | ||
} | ||
comment.append("* Then actually release the version with the following line:\n\n"); | ||
comment.append("> TAG=" + releaseInformation.getVersion() + " && ./check-version.sh $TAG && ./mvnw release:prepare release:perform -DdevelopmentVersion=999-SNAPSHOT -DreleaseVersion=$TAG -Dtag=$TAG -DperformRelease -Prelease,releaseNexus -DskipTests -Darguments=-DskipTests\n\n"); | ||
if (Versions.getVersion(releaseInformation.getBranch()).compareTo(Versions.VERSION_3_2) < 0) { | ||
comment.append("* Release the staging repository **manually** at https://s01.oss.sonatype.org/#stagingRepositories.\n\n"); | ||
} | ||
comment.append( | ||
"**IMPORTANT** You need to wait for them to be synced to Maven Central before continuing with the release:\n\n"); | ||
comment.append("* Wait for 40 minutes\n"); | ||
comment.append("* Check that https://repo1.maven.org/maven2/io/quarkus/platform/quarkus-bom/" + releaseInformation.getVersion() + "/" | ||
+ " does not return a 404\n\n"); | ||
comment.append( | ||
"Once these two conditions are met, you can continue with the release by adding a `" | ||
+ Command.CONTINUE.getFullCommand() + "` comment."); | ||
commands.setOutput(Outputs.INTERACTION_COMMENT, comment.toString()); | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public boolean shouldContinue(Context context, Commands commands, | ||
ReleaseInformation releaseInformation, ReleaseStatus releaseStatus, GHIssueComment issueComment) { | ||
return Command.CONTINUE.matches(issueComment.getBody()); | ||
} | ||
@Inject | ||
Processes processes; | ||
|
||
@Override | ||
public int run(Context context, Commands commands, ReleaseInformation releaseInformation, GHIssue issue, | ||
UpdatedIssueBody updatedIssueBody) throws IOException, InterruptedException { | ||
issue.comment(":white_check_mark: Platform artifacts have been synced to Maven Central, continuing..."); | ||
return 0; | ||
String platformReleaseBranch = Branches.getPlatformReleaseBranch(releaseInformation); | ||
|
||
return processes.execute(List.of( | ||
"./release-platform.sh", | ||
platformReleaseBranch | ||
)); | ||
} | ||
} |
Oops, something went wrong.