Skip to content
Closed
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
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
<module>presto-spark-launcher</module>
<module>presto-spark-testing</module>
<module>presto-druid</module>
<module>presto-release</module>
</modules>

<dependencyManagement>
Expand Down
2,836 changes: 2,836 additions & 0 deletions presto-release/NOTICE

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions presto-release/README.md
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"
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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=LATEST to fetch the latest snapshot version. When there is a release of this project, we can change it to point to the latest release version.

chmod 755 /tmp/presto_release
/tmp/presto_release --release-notes github-user <GITHUB_USER> --github-access-token <GITHUB_ACCESS_TOKEN>
Comment thread
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.
219 changes: 219 additions & 0 deletions presto-release/pom.xml
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>
45 changes: 45 additions & 0 deletions presto-release/src/main/assembly/presto-release.xml
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>
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>
Comment thread
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);
}
Loading