Skip to content

Commit

Permalink
GH-780 Update 2.x dependencies and release 2.9.25 (Fix #780)
Browse files Browse the repository at this point in the history
* GH-780 Update repository URL, bump dependencies and update workflow

* GH-780 Mark sources as 2.9.25, apply migration changes

* GH-780 Fix tests that were affected by previous changes
  • Loading branch information
dzikoysk authored Oct 7, 2021
1 parent c93619e commit 10535ab
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Reposilite CI
on:
push:
branches: [ master ]
branches: [ "2.x" ]
pull_request:
branches: [ master ]
branches: [ "2.x" ]

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
reposilite:
image: reposilite:2.9.24
image: reposilite:2.9.25
build:
context: .
dockerfile: Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/docker.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</ul>
<h2><a class="anchor" aria-hidden="true" id="installation"></a><a href="#installation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Installation</h2>
<p>First of all, you have to pull the image from <a href="https://hub.docker.com/r/dzikoysk/reposilite">DockerHub</a>:</p>
<pre><code class="hljs css language-shell-session"><span class="hljs-comment">// released builds, e.g. 2.9.24-SNAPSHOT</span>
<pre><code class="hljs css language-shell-session"><span class="hljs-comment">// released builds, e.g. 2.9.25-SNAPSHOT</span>
$ docker pull dzikoysk/reposilite:<span class="hljs-number">2.9</span><span class="hljs-number">.21</span>-SNAPSHOT

<span class="hljs-comment">// nightly builds</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/docker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</ul>
<h2><a class="anchor" aria-hidden="true" id="installation"></a><a href="#installation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Installation</h2>
<p>First of all, you have to pull the image from <a href="https://hub.docker.com/r/dzikoysk/reposilite">DockerHub</a>:</p>
<pre><code class="hljs css language-shell-session"><span class="hljs-comment">// released builds, e.g. 2.9.24-SNAPSHOT</span>
<pre><code class="hljs css language-shell-session"><span class="hljs-comment">// released builds, e.g. 2.9.25-SNAPSHOT</span>
$ docker pull dzikoysk/reposilite:<span class="hljs-number">2.9</span><span class="hljs-number">.21</span>-SNAPSHOT

<span class="hljs-comment">// nightly builds</span>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<groupId>org.panda-lang</groupId>
<artifactId>reposilite-parent</artifactId>
<packaging>pom</packaging>
<version>2.9.24</version>
<version>2.9.25</version>

<modules>
<module>reposilite-backend</module>
Expand Down
54 changes: 27 additions & 27 deletions reposilite-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>reposilite-parent</artifactId>
<groupId>org.panda-lang</groupId>
<version>2.9.24</version>
<version>2.9.25</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -37,15 +37,23 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- Dependencies -->
<jetty.version>9.4.43.v20210629</jetty.version>
<jetty.version>9.4.44.v20210927</jetty.version>
</properties>

<repositories>
<repository>
<name>Panda Repository</name>
<id>panda-repository</id>
<url>https://repo.panda-lang.org/releases</url>
</repository>
</repositories>

<dependencies>
<!-- OpenAPI -->
<dependency>
<groupId>io.javalin</groupId>
<artifactId>javalin-openapi</artifactId>
<version>4.0.0.ALPHA1</version>
<version>4.0.1</version>
<exclusions>
<exclusion>
<artifactId>snakeyaml</artifactId>
Expand All @@ -71,7 +79,7 @@
<dependency>
<groupId>io.javalin</groupId>
<artifactId>javalin</artifactId>
<version>4.0.0.ALPHA1</version>
<version>4.0.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -113,7 +121,7 @@
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
<version>1.39.2</version>
<version>1.40.0</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -142,7 +150,7 @@
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
<version>5.4.6</version>
<version>5.5.1</version>
</dependency>

<!-- Utilities -->
Expand All @@ -159,7 +167,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.1.1-jre</version>
<version>31.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand All @@ -174,41 +182,41 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.28</version>
<version>1.29</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.12.3</version>
<version>2.12.5</version>
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>2.3.2</version>
<version>2.3.4</version>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>slf4j-tinylog</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>tinylog-api</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>tinylog-impl</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</dependency>

<!-- Tests -->
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-jackson2</artifactId>
<version>1.39.2</version>
<version>1.40.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -220,43 +228,35 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>3.9.0</version>
<version>3.12.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.12.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.7</version>
<version>3.0.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.1</version>
<version>5.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.7.1</version>
<version>5.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<repositories>
<repository>
<name>Panda Repository</name>
<id>panda-repository</id>
<url>https://repo.panda-lang.org/</url>
</repository>
</repositories>

<build>
<defaultGoal>clean install</defaultGoal>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public final class ReposiliteConstants {

public static final String NAME = "Reposilite";

public static final String VERSION = "2.9.24";
public static final String VERSION = "2.9.25";

public static final String REMOTE_VERSION = "https://repo.panda-lang.org/org/panda-lang/reposilite/latest";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import io.javalin.Javalin;
import io.javalin.core.JavalinConfig;
import io.javalin.core.JavalinServer;
import io.javalin.jetty.JettyServer;
import io.javalin.plugin.openapi.OpenApiOptions;
import io.javalin.plugin.openapi.OpenApiPlugin;
import io.javalin.plugin.openapi.ui.SwaggerOptions;
Expand Down Expand Up @@ -54,7 +54,6 @@ void start(Configuration configuration, Runnable onStart) {
DeployEndpoint deployEndpoint = new DeployEndpoint(reposilite.getContextFactory(), reposilite.getDeployService());

LookupController lookupController = new LookupController(
configuration.proxied.size() > 0,
reposilite.getContextFactory(),
reposilite.getFrontendService(),
reposilite.getLookupService(),
Expand Down Expand Up @@ -158,8 +157,8 @@ private void configure(Configuration configuration, JavalinConfig config) {

public boolean isAlive() {
return getJavalin()
.map(Javalin::server)
.map(JavalinServer::server)
.map(Javalin::jettyServer)
.map(JettyServer::server)
.map(Server::isStarted)
.orElseGet(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void init() {

@Override
protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
reposilite.getHttpServer().getJavalin().get().servlet().service(req, res);
reposilite.getHttpServer().getJavalin().get().javalinServlet().service(req, res);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import net.dzikoysk.cdn.entity.Description;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -82,7 +83,7 @@ public final class Configuration implements Serializable {
@Description("# List of proxied repositories.")
@Description("# Reposilite will search for an artifact in remote repositories listed below,")
@Description("# if the requested artifact was not found.")
public List<String> proxied = Collections.emptyList();
public List<String> proxied = new ArrayList<>(0);
@Description("# Reposilite can store proxied artifacts locally to reduce response time and improve stability")
public Boolean storeProxied = true;
@Description("# Proxying is disabled by default in private repositories because of the security policy.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void handle(Context ctx) {
Reposilite.getLogger().info("DEPLOY " + context.uri() + " from " + context.address());

deployService.deploy(context)
.map(future -> ctx.result(future.thenAccept(result -> result
.map(future -> ctx.future(future.thenAccept(result -> result
.map(ctx::json)
.onError(error -> Reposilite.getLogger().debug("Cannot deploy artifact due to: (future) " + error.getMessage()))
.mapErr(error -> ResponseUtils.errorResponse(ctx, error)))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,19 @@

public final class LookupController implements Handler {

private final boolean hasProxied;
private final ReposiliteContextFactory contextFactory;
private final FrontendProvider frontend;
private final LookupService lookupService;
private final ProxyService proxyService;
private final FailureService failureService;

public LookupController(
boolean hasProxied,
ReposiliteContextFactory contextFactory,
FrontendProvider frontendProvider,
LookupService lookupService,
ProxyService proxyService,
FailureService failureService) {

this.hasProxied = hasProxied;
this.contextFactory = contextFactory;
this.frontend = frontendProvider;
this.lookupService = lookupService;
Expand Down Expand Up @@ -91,7 +88,7 @@ public void handle(Context ctx) {
Result<LookupResponse, ErrorDto> response = lookupService.findLocal(context);

if (isProxied(response)) {
if (hasProxied) {
if (proxyService.hasProxied()) {
handleProxied(ctx, context, proxyService.findProxied(context));
return;
}
Expand All @@ -107,7 +104,7 @@ public void handle(Context ctx) {
private void handleProxied(Context ctx, ReposiliteContext context, Result<CompletableFuture<Result<LookupResponse, ErrorDto>>, ErrorDto> response) {
response
.map(task -> task.thenAccept(result -> handleResult(ctx, context, result)))
.peek(ctx::result)
.peek(ctx::future)
.onError(error -> handleError(ctx, error));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,8 @@ private Option<CompletableFuture<Result<LookupResponse, ErrorDto>>> store(Reposi

}

public boolean hasProxied() {
return !proxied.isEmpty();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals
@CompileStatic
class MetadataComparatorTest {

private static final MetadataComparator<Pair<String[], String>> METADATA_COMPARATOR = new MetadataComparator<>(
private static final MetadataComparator<Pair<String[], String>> METADATA_COMPARATOR = new MetadataComparator<Pair<String[], String>>(
{ Pair<String[], String> pair -> pair.getValue() },
{ Pair<String[], String> pair -> pair.getKey() },
{ pair -> false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,18 @@ class LookupControllerTest extends ReposiliteIntegrationTestSpecification {
@Test
void 'should return 200 and proxied file' () {
def proxyPort = String.valueOf(Integer.parseInt(PORT) + 1)
super.reposilite.getConfiguration().proxied = Collections.singletonList("http://localhost:" + proxyPort)
super.reposilite.getConfiguration().proxied.add("http://localhost:" + proxyPort + "/releases")

try {
def proxiedReposilite = super.reposilite(proxyPort, proxiedWorkingDirectory)
proxiedReposilite.launch()

def proxiedFile = new File(proxiedWorkingDirectory, "/repositories/releases/proxiedGroup/proxiedArtifact/proxied.txt")
def proxiedFile = new File(proxiedWorkingDirectory, "/repositories/releases/proxiedGroup/proxiedArtifact/proxied.jar")
proxiedFile.getParentFile().mkdirs()
proxiedFile.createNewFile()
FileUtils.overrideFile(proxiedFile, "proxied content")

def response = getRequest("/releases/proxiedGroup/proxiedArtifact/proxied.txt")
def response = getRequest("/releases/proxiedGroup/proxiedArtifact/proxied.jar")
assertEquals HttpStatus.SC_OK, response.getStatusCode()

def content = response.parseAsString()
Expand Down
4 changes: 2 additions & 2 deletions reposilite-packages/reposilite-helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.9.24
version: 2.9.25

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "2.9.24"
appVersion: "2.9.25"
4 changes: 2 additions & 2 deletions reposilite-site/docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Reposilite defines two types of builds:
First of all, you have to pull the image from [DockerHub](https://hub.docker.com/r/dzikoysk/reposilite):

```shell-session
// released builds, e.g. 2.9.24-SNAPSHOT
$ docker pull dzikoysk/reposilite:2.9.24-SNAPSHOT
// released builds, e.g. 2.9.25
$ docker pull dzikoysk/reposilite:2.9.25
// nightly builds
$ docker pull dzikoysk/reposilite:nightly
Expand Down

0 comments on commit 10535ab

Please sign in to comment.