Skip to content
Merged
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
8 changes: 4 additions & 4 deletions application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.quarkus</groupId>-->
<!-- <artifactId>quarkus-smallrye-openapi</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.quarkus</groupId>-->
<!-- <artifactId>quarkus-oidc</artifactId>-->
Expand Down
244 changes: 244 additions & 0 deletions application/src/main/resources/META-INF/resources/index.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions application/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ quarkus:
http:
enable-compression: true
enable-decompression: true
swagger-ui:
always-include: true
websocket:
dispatch-to-worker: true
hibernate-orm:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.commonjava.maven.galley.auth.MemoryPasswordManager;
import org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider;
import org.commonjava.maven.galley.config.TransportManagerConfig;
import org.commonjava.maven.galley.config.TransportMetricConfig;
import org.commonjava.maven.galley.event.NoOpFileEventManager;
import org.commonjava.maven.galley.filearc.FileTransportConfig;
import org.commonjava.maven.galley.io.HashedLocationPathGenerator;
Expand All @@ -20,7 +19,6 @@
import org.commonjava.maven.galley.maven.rel.ModelProcessorConfig;
import org.commonjava.maven.galley.maven.spi.defaults.MavenPluginDefaults;
import org.commonjava.maven.galley.maven.spi.defaults.MavenPluginImplications;
import org.commonjava.maven.galley.model.Location;
import org.commonjava.maven.galley.nfc.MemoryNotFoundCache;
import org.commonjava.maven.galley.proxy.NoOpProxySitesCache;
import org.commonjava.maven.galley.spi.auth.PasswordManager;
Expand All @@ -30,11 +28,8 @@
import org.commonjava.maven.galley.spi.proxy.ProxySitesCache;
import org.commonjava.maven.galley.spi.transport.LocationExpander;
import org.commonjava.maven.galley.transport.NoOpLocationExpander;
import org.commonjava.maven.galley.transport.htcli.Http;
import org.commonjava.maven.galley.transport.htcli.HttpImpl;
import org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration;
import org.commonjava.maven.galley.transport.htcli.conf.GlobalProxyConfig;
import org.commonjava.o11yphant.metrics.api.MetricRegistry;
import org.commonjava.util.partyline.Partyline;

import java.io.File;
Expand All @@ -55,22 +50,6 @@ public class GalleyMavenProducer {

private PathGenerator pathGenerator;

private final TransportMetricConfig transportMetricConfig = new TransportMetricConfig() {
public boolean isEnabled() {
return false;
}

@Override
public String getNodePrefix() {
return null;
}

@Override
public String getMetricUniqueName(Location location) {
return null;
}
};

@PostConstruct
void init() {
try {
Expand Down Expand Up @@ -128,11 +107,6 @@ public WeftConfig getWeftConfig() {
return new DefaultWeftConfig();
}

@Produces
public Http getHttp() {
return new HttpImpl(getPasswordManager());
}

@Produces
public PasswordManager getPasswordManager() {
return new MemoryPasswordManager();
Expand All @@ -158,11 +132,6 @@ public GlobalHttpConfiguration getGlobalHttpConfiguration() {
return globalHttpConfiguration;
}

@Produces
public TransportMetricConfig getTransportMetricConfig() {
return transportMetricConfig;
}

@Produces
public ObjectMapper getObjectMapper() {
return new ObjectMapper();
Expand Down Expand Up @@ -203,11 +172,6 @@ public ProxySitesCache getProxySitesCache() {
return new NoOpProxySitesCache();
}

@Produces
public MetricRegistry getMetricRegistry() {
return null;
}

// Only appears to be used by GalleyWrapperTestIT
@Produces
public ModelProcessorConfig getModelProcessorConfig() {
Expand Down
4 changes: 0 additions & 4 deletions reports-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-websockets</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-validator</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,51 +31,28 @@
title = "Dependency Analyzer",
license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html"),
version = DA_VERSION),
servers = { @Server(url = "/da", description = "Dependency Analyzer") },
servers = { @Server(url = "/", description = "Dependency Analyzer") },
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.

We will need to change this in all services using it right? And possibly communicate it in case other teams use DA directly.

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.

Isn't that just used for the openapi definition? Although I do agree that the Quarkus app in the prior PR creates the REST API on '/rest/api...'

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.

Discussed offline - that @Server annotation is only for OpenAPI. However Quarkus does deploy differently so we will need to change other service configs eventually.

tags = {
@Tag(name = "lookup", description = "Lookup of artifact versions."),
@Tag(name = "blocklist", description = "Listings of blocklisted artifacts"),
@Tag(name = "reports", description = "Get report of dependencies of projects"),
@Tag(name = "deprecated", description = "Deprecated endpoints.") })
public class ReportsRestActivator extends Application {

// @Context
// private ServletConfig servletConfig;

// @PostConstruct
// public void init() {
// configureSwagger();
// }

/*
* private void configureSwagger() { try { var builder = new JaxrsOpenApiContextBuilder().application(this)
* .resourcePackages(Collections.singleton("org.jboss.da.rest")); if (servletConfig != null) {
* builder.servletConfig(servletConfig); } builder.buildContext(true); } catch (OpenApiConfigurationException ex) {
* throw new IllegalArgumentException("Failed to setup OpenAPI configuration", ex); } }
*/

@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> resources = new HashSet<>();
// addSwaggerResources(resources);
addProjectResources(resources);
addMetricsResources(resources);
addExceptionMappers(resources);
addProviders(resources);
return resources;
}

/**
* Swagger classes required to generate the API JSON generation
*
* @param resources public void addSwaggerResources(Set<Class<?>> resources) { resources.add(OpenApiResource.class);
* }
*/

/**
* Add all JAX-RS classes here to get activated!
*
* @param resources
* @param resources Resource to be added
*/
public void addProjectResources(Set<Class<?>> resources) {
resources.add(Root.class);
Expand Down
2 changes: 1 addition & 1 deletion reports-rest/src/main/java/org/jboss/da/rest/Root.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public String getDescription() {
+ DA_VERSION + "</li>" + "\n" + "<ul><li><strong>Commit Hash:</strong> " + COMMIT_HASH + "</li>" + "\n"
+ "<li><strong>BC REST API Version:</strong> " + REST_API_VERSION_BC + "</li>" + "\n"
+ "<li><strong>Reports REST API Version:</strong> " + REST_API_VERSION_REPORTS + "</li>" + "\n"
+ "<li><a href=\"../doc\">Swagger documentation</a></li>" + "\n"
+ "<li><a href=\"../../q/openapi\">Swagger documentation</a></li>" + "\n"
+ "<li><strong>REST proposal documentation:</strong> <a href=\"https://docs.engineering.redhat.com/display/JP/REST+endpoints+proposal\">https://docs.engineering.redhat.com/display/JP/REST+endpoints+proposal</a></li></ul>";
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private String getExpectedResponse() {
+ DA_VERSION + "</li>" + "\n" + "<ul><li><strong>Commit Hash:</strong> " + COMMIT_HASH + "</li>" + "\n"
+ "<li><strong>BC REST API Version:</strong> " + REST_API_VERSION_BC + "</li>" + "\n"
+ "<li><strong>Reports REST API Version:</strong> " + REST_API_VERSION_REPORTS + "</li>" + "\n"
+ "<li><a href=\"../doc\">Swagger documentation</a></li>" + "\n"
+ "<li><a href=\"../../q/openapi\">Swagger documentation</a></li>" + "\n"
+ "<li><strong>REST proposal documentation:</strong> <a href=\"https://docs.engineering.redhat.com/display/JP/REST+endpoints+proposal\">https://docs.engineering.redhat.com/display/JP/REST+endpoints+proposal</a></li></ul>";
}

Expand Down