-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Support Release Notes Generation #13964
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f31ddde
Add utilities to run git commands
caithagoras0 4f4dcad
Support fetching and creating pull requests
caithagoras0 225e282
Support generating release notes
caithagoras0 3a35678
Publish executable jar and tarball for presto-release
caithagoras0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,13 @@ | ||
| Presto Release Service contains tools to prepare new Presto releases. | ||
|
|
||
| ## Generate Release Notes | ||
| To collect and generate release notes, run the following commands in the presto repo. | ||
| ``` | ||
| curl -L -o /tmp/presto_release "https://oss.sonatype.org/service/local/artifact/maven/redirect?g=com.facebook.presto&a=presto-release&v=0.232-20200123.012813-4&r=snapshots&c=executable&e=jar" | ||
| chmod 755 /tmp/presto_release | ||
| /tmp/presto_release --release-notes github-user <GITHUB_USER> --github-access-token <GITHUB_ACCESS_TOKEN> | ||
|
caithagoras marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
|
||
| The commands will create a local branch containing the collected release notes, and a pull request | ||
| with description populated with missing release notes, release notes summary, and a list of | ||
| commits within the release. | ||
This file contains hidden or 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,219 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <parent> | ||
| <groupId>com.facebook.presto</groupId> | ||
| <artifactId>presto-root</artifactId> | ||
| <version>0.232-SNAPSHOT</version> | ||
| </parent> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <artifactId>presto-release</artifactId> | ||
| <description>Presto Release Tool</description> | ||
|
|
||
| <properties> | ||
| <air.main.basedir>${project.parent.basedir}</air.main.basedir> | ||
| <main-class>com.facebook.presto.release.PrestoReleaseService</main-class> | ||
| <process-name>${project.artifactId}</process-name> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.facebook.airlift</groupId> | ||
| <artifactId>bootstrap</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.facebook.airlift</groupId> | ||
| <artifactId>configuration</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.facebook.airlift</groupId> | ||
| <artifactId>http-client</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.facebook.airlift</groupId> | ||
| <artifactId>log</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.facebook.airlift</groupId> | ||
| <artifactId>json</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-annotations</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-core</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-databind</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.dataformat</groupId> | ||
| <artifactId>jackson-dataformat-xml</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>guava</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.google.inject</groupId> | ||
| <artifactId>guice</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.airlift</groupId> | ||
| <artifactId>airline</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>javax.inject</groupId> | ||
| <artifactId>javax.inject</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>javax.validation</groupId> | ||
| <artifactId>validation-api</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>javax.ws.rs</groupId> | ||
| <artifactId>javax.ws.rs-api</artifactId> | ||
| </dependency> | ||
|
|
||
| <!-- for testing --> | ||
| <dependency> | ||
| <groupId>com.facebook.airlift</groupId> | ||
| <artifactId>testing</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.testng</groupId> | ||
| <artifactId>testng</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <!-- for assembly --> | ||
| <dependency> | ||
| <groupId>com.facebook.airlift</groupId> | ||
| <artifactId>launcher</artifactId> | ||
| <version>${dep.packaging.version}</version> | ||
| <classifier>bin</classifier> | ||
| <type>tar.gz</type> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.facebook.airlift</groupId> | ||
| <artifactId>launcher</artifactId> | ||
| <version>${dep.packaging.version}</version> | ||
| <classifier>properties</classifier> | ||
| <type>tar.gz</type> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-shade-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>shade</goal> | ||
| </goals> | ||
| <configuration> | ||
| <shadedArtifactAttached>true</shadedArtifactAttached> | ||
| <shadedClassifierName>executable</shadedClassifierName> | ||
| <transformers> | ||
| <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> | ||
| <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | ||
| <manifestEntries> | ||
| <Main-Class>${main-class}</Main-Class> | ||
| </manifestEntries> | ||
| </transformer> | ||
| </transformers> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
|
|
||
| <plugin> | ||
| <groupId>org.skife.maven</groupId> | ||
| <artifactId>really-executable-jar-maven-plugin</artifactId> | ||
| <configuration> | ||
| <flags>-Xmx1G</flags> | ||
| <classifier>executable</classifier> | ||
| </configuration> | ||
| <executions> | ||
| <execution> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>really-executable-jar</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
|
|
||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-dependency-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>unpack-launcher</id> | ||
| <phase>prepare-package</phase> | ||
| <goals> | ||
| <goal>unpack-dependencies</goal> | ||
| </goals> | ||
| <configuration> | ||
| <skip>false</skip> | ||
| <includeArtifactIds>launcher</includeArtifactIds> | ||
| <includeScope>provided</includeScope> | ||
| <outputDirectory>${project.build.directory}/dependency/launcher</outputDirectory> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
|
|
||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-assembly-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>bin</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>single</goal> | ||
| </goals> | ||
| <configuration> | ||
| <formats> | ||
| <format>tar.gz</format> | ||
| </formats> | ||
| <descriptors> | ||
| <descriptor>src/main/assembly/presto-release.xml</descriptor> | ||
| </descriptors> | ||
| <finalName>presto-release-${project.version}</finalName> | ||
| <appendAssemblyId>false</appendAssemblyId> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> |
This file contains hidden or 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,45 @@ | ||
| <assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> | ||
| <id>presto-server</id> | ||
| <includeBaseDirectory>true</includeBaseDirectory> | ||
|
|
||
| <files> | ||
| <file> | ||
| <source>README.md</source> | ||
| </file> | ||
| <file> | ||
| <source>NOTICE</source> | ||
| </file> | ||
| </files> | ||
|
|
||
| <dependencySets> | ||
| <!-- lib --> | ||
| <dependencySet> | ||
| <useProjectArtifact>true</useProjectArtifact> | ||
| <scope>runtime</scope> | ||
| <outputDirectory>lib</outputDirectory> | ||
| <useTransitiveDependencies>true</useTransitiveDependencies> | ||
| </dependencySet> | ||
| </dependencySets> | ||
|
|
||
| <fileSets> | ||
| <!-- bin --> | ||
| <fileSet> | ||
| <directory>${project.build.directory}/dependency/launcher/bin</directory> | ||
| <includes> | ||
| <include>launcher.properties</include> | ||
| </includes> | ||
| <outputDirectory>bin</outputDirectory> | ||
| <filtered>true</filtered> | ||
| </fileSet> | ||
| <fileSet> | ||
| <directory>${project.build.directory}/dependency/launcher/bin</directory> | ||
| <includes> | ||
| <include>launcher</include> | ||
| <include>launcher.py</include> | ||
| </includes> | ||
| <outputDirectory>bin</outputDirectory> | ||
| <fileMode>0755</fileMode> | ||
| </fileSet> | ||
| </fileSets> | ||
| </assembly> |
54 changes: 54 additions & 0 deletions
54
presto-release/src/main/java/com/facebook/presto/release/AbstractAnnotatedProvider.java
This file contains hidden or 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,54 @@ | ||
| /* | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package com.facebook.presto.release; | ||
|
|
||
| import com.google.inject.Inject; | ||
| import com.google.inject.Injector; | ||
|
|
||
| import javax.inject.Provider; | ||
|
|
||
| import java.lang.annotation.Annotation; | ||
|
|
||
| import static com.google.common.base.Preconditions.checkState; | ||
| import static java.util.Objects.requireNonNull; | ||
|
|
||
| /** | ||
| * Abstract base class for {@link Provider} that requires requires {@link Injector} and binds to a given annotation class. | ||
| */ | ||
| public abstract class AbstractAnnotatedProvider<T> | ||
|
caithagoras marked this conversation as resolved.
Outdated
|
||
| implements Provider<T> | ||
| { | ||
| private final Class<? extends Annotation> annotation; | ||
| private Injector injector; | ||
|
|
||
| protected AbstractAnnotatedProvider(Class<? extends Annotation> annotation) | ||
| { | ||
| this.annotation = requireNonNull(annotation, "annotation is null"); | ||
| } | ||
|
|
||
| @Inject | ||
| public final void setInjector(Injector injector) | ||
| { | ||
| this.injector = injector; | ||
| } | ||
|
|
||
| @Override | ||
| public final T get() | ||
| { | ||
| checkState(injector != null, "injector was not set"); | ||
| return get(injector, annotation); | ||
| } | ||
|
|
||
| protected abstract T get(Injector injector, Class<? extends Annotation> annotation); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is what you are supposed to fetch going to change over time when the binary is updated? Is there a better way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. We can do
v=LATESTto fetch the latest snapshot version. When there is a release of this project, we can change it to point to the latest release version.