Skip to content

Commit

Permalink
project: migrate to concord-client2 and target platform 2.14.0 (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
benbroadaway authored Oct 4, 2024
1 parent 385a9f6 commit bfc7c0b
Show file tree
Hide file tree
Showing 20 changed files with 110 additions and 85 deletions.
17 changes: 14 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@

<scm.connection>scm:git:https://github.com/walmartlabs/concord-plugins.git</scm.connection>

<concord.version>2.5.0</concord.version>
<concord.version>2.14.0</concord.version>
<gson.version>2.10</gson.version>
<okhttp3.version>3.14.9</okhttp3.version>
<wiremock.version>2.27.2</wiremock.version>
<wiremock.version>3.5.2</wiremock.version>
</properties>

<dependencyManagement>
Expand All @@ -79,9 +79,20 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>${wiremock.version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty.http2</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
5 changes: 3 additions & 2 deletions tasks/akeyless/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<maven-plugin-version>1.0.0</maven-plugin-version>
<threetenbp-version>1.4.0</threetenbp-version>

<testcontainers.concord.version>0.0.40</testcontainers.concord.version>
<testcontainers.concord.version>2.0.1</testcontainers.concord.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -55,6 +55,7 @@
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<scope>provided</scope>
</dependency>


Expand Down Expand Up @@ -164,7 +165,7 @@
</dependency>
<dependency>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>concord-client</artifactId>
<artifactId>concord-client2</artifactId>
<version>${concord.version}</version>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import ca.ibodrov.concord.testcontainers.NewSecretQuery;
import ca.ibodrov.concord.testcontainers.Payload;
import ca.ibodrov.concord.testcontainers.junit5.ConcordRule;
import com.walmartlabs.concord.ApiException;
import com.walmartlabs.concord.client.ProcessEntry;
import com.walmartlabs.concord.client2.ApiException;
import com.walmartlabs.concord.client2.ProcessEntry;
import com.walmartlabs.concord.common.IOUtils;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand Down
29 changes: 4 additions & 25 deletions tasks/argocd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,43 +46,22 @@
</dependency>
<dependency>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>concord-client</artifactId>
<artifactId>concord-client2</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -122,7 +101,7 @@
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
<scope>provided</scope>
</dependency>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
* =====
*/

import com.walmartlabs.concord.ApiClient;
import com.walmartlabs.concord.client.ProcessEventsApi;
import com.walmartlabs.concord.client2.ApiClient;
import com.walmartlabs.concord.client2.ProcessEventsApi;
import com.walmartlabs.concord.common.ConfigurationUtils;
import com.walmartlabs.concord.plugins.argocd.model.EventStatus;
import com.walmartlabs.concord.plugins.argocd.openapi.ApiException;
import com.walmartlabs.concord.plugins.argocd.openapi.model.*;
import com.walmartlabs.concord.runtime.v2.sdk.*;
import org.slf4j.Logger;
Expand All @@ -39,7 +38,7 @@
@Named("argocd")
public class ArgoCdTask implements Task {

private final static Logger log = LoggerFactory.getLogger(ArgoCdTask.class);
private static final Logger log = LoggerFactory.getLogger(ArgoCdTask.class);

private final ObjectMapper objectMapper = new ObjectMapper();
private final Context context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* =====
*/

import com.walmartlabs.concord.ApiException;
import com.walmartlabs.concord.plugins.argocd.openapi.ApiException;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.CookieStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
* =====
*/

import com.walmartlabs.concord.ApiException;
import com.walmartlabs.concord.client.ProcessEventRequest;
import com.walmartlabs.concord.client.ProcessEventsApi;
import com.walmartlabs.concord.client2.ApiException;
import com.walmartlabs.concord.client2.ProcessEventRequest;
import com.walmartlabs.concord.client2.ProcessEventsApi;
import com.walmartlabs.concord.plugins.argocd.model.EventStatus;
import com.walmartlabs.concord.runtime.v2.sdk.TaskResult;
import org.slf4j.Logger;
Expand All @@ -33,8 +33,8 @@

public class RecordEvents {

private final static Logger log = LoggerFactory.getLogger(RecordEvents.class);
private final static List<String> BLACK_LIST = Arrays.asList("auth", "spec", "helm");
private static final Logger log = LoggerFactory.getLogger(RecordEvents.class);
private static final List<String> BLACK_LIST = Arrays.asList("auth", "spec", "helm");

static void recordEvent(ProcessEventsApi processEventsApi, UUID instanceId, UUID correlationId,
EventStatus eventStatus, String error, TaskParamsImpl taskParams, TaskResult taskResult) throws IOException {
Expand Down Expand Up @@ -65,8 +65,8 @@ static void recordEvent(ProcessEventsApi processEventsApi, UUID instanceId, UUID
}
try {
processEventsApi.event(instanceId, new ProcessEventRequest()
.setEventType("ARGOCD")
.setData(eventData));
.eventType("ARGOCD")
.data(eventData));
} catch (ApiException e) {
log.warn("recordEvents -> error while recording the event, ignoring: {}", e.getMessage());
}
Expand Down
9 changes: 7 additions & 2 deletions tasks/git/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-jetty12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
16 changes: 16 additions & 0 deletions tasks/hashivault/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] [%-5level] %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<!-- Turning down the apache http client logging -->
<logger name="org.apache.http" level="WARN"/>
<logger name="org.apache" level="ERROR"/>
<logger name="com.walmartlabs.concord" level="INFO"/>

<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
9 changes: 7 additions & 2 deletions tasks/jira/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-jetty12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
9 changes: 7 additions & 2 deletions tasks/msteams/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-jetty12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
9 changes: 7 additions & 2 deletions tasks/puppet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@
</dependency>

<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-jetty12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
13 changes: 9 additions & 4 deletions tasks/terraform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<properties>
<skipTests>true</skipTests>
<testcontainers.concord.version>0.0.40</testcontainers.concord.version>
<testcontainers.concord.version>2.0.1</testcontainers.concord.version>
</properties>

<dependencies>
Expand All @@ -33,7 +33,7 @@
</dependency>
<dependency>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>concord-client</artifactId>
<artifactId>concord-client2</artifactId>
<version>${concord.version}</version>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -90,8 +90,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-jetty12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* =====
*/

import com.walmartlabs.concord.ApiClient;
import com.walmartlabs.concord.client2.ApiClient;
import com.walmartlabs.concord.plugins.terraform.actions.TerraformActionResult;
import com.walmartlabs.concord.plugins.terraform.backend.Backend;
import com.walmartlabs.concord.plugins.terraform.backend.BackendFactoryV2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

import com.fasterxml.jackson.databind.ObjectMapper;
import com.walmartlabs.concord.ApiClient;
import com.walmartlabs.concord.client2.ApiClient;
import com.walmartlabs.concord.plugins.terraform.TaskConstants;
import com.walmartlabs.concord.runtime.v2.sdk.Context;
import com.walmartlabs.concord.runtime.v2.sdk.LockService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
*/

import com.fasterxml.jackson.databind.ObjectMapper;
import com.walmartlabs.concord.ApiClient;
import com.walmartlabs.concord.client.JsonStoreApi;
import com.walmartlabs.concord.client.JsonStoreRequest;
import com.walmartlabs.concord.client2.ApiClient;
import com.walmartlabs.concord.client2.JsonStoreApi;
import com.walmartlabs.concord.client2.JsonStoreRequest;
import com.walmartlabs.concord.plugins.terraform.TaskConstants;
import com.walmartlabs.concord.runtime.v2.sdk.Context;
import com.walmartlabs.concord.runtime.v2.sdk.LockService;
Expand Down Expand Up @@ -90,9 +90,9 @@ public void init(Path tfDir) throws Exception {
String orgName = getCurrentOrgName(ctx);

JsonStoreApi jsonStoreApi = new JsonStoreApi(apiClient);
jsonStoreApi.createOrUpdate(orgName, new JsonStoreRequest().setName(stateId));
jsonStoreApi.createOrUpdateJsonStore(orgName, new JsonStoreRequest().name(stateId));

String address = String.format("%s/api/v1/org/%s/jsonstore/%s/item/state", apiClient.getBasePath(), orgName, stateId);
String address = String.format("%s/api/v1/org/%s/jsonstore/%s/item/state", apiClient.getBaseUri(), orgName, stateId);
if (debug) {
log.info("init -> using state URL: {}", address);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public abstract class AbstractTerraformTest {
@RegisterExtension
protected static WireMockExtension wireMockRule = WireMockExtension.newInstance()
.options(wireMockConfig()
.extensions(new StateBackendTransformer())
.bindAddress("0.0.0.0")
.port(12345))
.extensions(new StateBackendTransformer())
.bindAddress("0.0.0.0")
.dynamicPort())
.build();

public void abstractSetup() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import ca.ibodrov.concord.testcontainers.ConcordProcess;
import ca.ibodrov.concord.testcontainers.Payload;
import ca.ibodrov.concord.testcontainers.junit5.ConcordRule;
import com.walmartlabs.concord.client.ProcessEntry;
import com.walmartlabs.concord.client2.ProcessEntry;
import com.walmartlabs.concord.common.IOUtils;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand Down
Loading

0 comments on commit bfc7c0b

Please sign in to comment.