Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

remove workflow-service-sdk dependency from prebuilt-tasks #491

Closed
wants to merge 1 commit into from
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
18 changes: 0 additions & 18 deletions prebuilt-tasks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@
<artifactId>notification-service-sdk</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>dev.parodos</groupId>
<artifactId>workflow-service-sdk</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
Expand All @@ -103,19 +98,16 @@
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>${jgit-version}</version>
</dependency>

<dependency>
<groupId>com.github.mwiede</groupId>
<artifactId>jsch</artifactId>
<version>0.2.9</version>
</dependency>

<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.ssh.jsch</artifactId>
Expand All @@ -127,25 +119,21 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.73</version>
</dependency>

<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.ssh.apache</artifactId>
<version>${jgit-version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.gpg.bc</artifactId>
<version>${jgit-version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.archive</artifactId>
Expand Down Expand Up @@ -178,7 +166,6 @@
<version>${azure-resourcemanager-version}</version>
</dependency>
<!-- End libraries for Azure access -->

<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
Expand All @@ -200,34 +187,29 @@
<artifactId>generator-annotations</artifactId>
<version>${fabric8.version}</version>
</dependency>

<!-- This specific version is needed for openshift server mock -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>4.11.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-core</artifactId>
<version>2.10.0</version>
<type>test-jar</type>
</dependency>

<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-common</artifactId>
<version>2.10.0</version>
</dependency>

<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-git</artifactId>
<version>2.10.0</version>
</dependency>

</dependencies>

<build>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 1 addition & 2 deletions workflow-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
</dependency>

<!-- This specific version is needed for openshift server mock -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
Expand All @@ -110,7 +109,6 @@
<groupId>dev.parodos</groupId>
<artifactId>workflow-service-sdk</artifactId>
<version>${revision}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.parodos</groupId>
Expand Down Expand Up @@ -140,6 +138,7 @@
<version>${markdowngenerator.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.redhat.parodos.examples.prebuilt.project;
package com.redhat.parodos.examples.project;

import java.util.Date;
import java.util.List;

import com.redhat.parodos.examples.project.checker.ProjectAccessRequestApprovalWorkFlowCheckerTask;
import com.redhat.parodos.examples.project.client.ProjectRequester;
import com.redhat.parodos.examples.project.escalation.ProjectAccessRequestEscalationWorkFlowTask;
import com.redhat.parodos.examples.project.task.ProjectAccessRequestApprovalWorkFlowTask;
import com.redhat.parodos.examples.project.task.ProjectAccessRequestWorkFlowTask;
import com.redhat.parodos.infrastructure.Notifier;
import com.redhat.parodos.infrastructure.ProjectRequester;
import com.redhat.parodos.tasks.project.ProjectAccessRequestApprovalWorkFlowTask;
import com.redhat.parodos.tasks.project.ProjectAccessRequestWorkFlowTask;
import com.redhat.parodos.tasks.project.checker.ProjectAccessRequestApprovalWorkFlowCheckerTask;
import com.redhat.parodos.tasks.project.escalation.ProjectAccessRequestEscalationWorkFlowTask;
import com.redhat.parodos.workflow.annotation.Checker;
import com.redhat.parodos.workflow.annotation.Escalation;
import com.redhat.parodos.workflow.annotation.Infrastructure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.redhat.parodos.tasks.project.checker;
package com.redhat.parodos.examples.project.checker;

import java.util.Objects;
import java.util.UUID;

import com.redhat.parodos.infrastructure.ProjectRequester;
import com.redhat.parodos.examples.project.client.ProjectRequester;
import com.redhat.parodos.examples.project.consts.ProjectAccessRequestConstant;
import com.redhat.parodos.sdk.invoker.ApiException;
import com.redhat.parodos.sdk.model.AccessStatusResponseDTO;
import com.redhat.parodos.workflow.exception.MissingParameterException;
Expand All @@ -30,8 +31,6 @@
import com.redhat.parodos.workflows.workflow.WorkFlow;
import lombok.extern.slf4j.Slf4j;

import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_ID;

/**
* Project access request approval workflow checker task
*
Expand All @@ -54,7 +53,8 @@ public WorkReport checkWorkFlowStatus(WorkContext workContext) {
log.info("Start projectAccessRequestApprovalWorkFlowCheckerTask...");
UUID accessRequestId;
try {
accessRequestId = UUID.fromString(getRequiredParameterValue(ACCESS_REQUEST_ID));
accessRequestId = UUID
.fromString(getRequiredParameterValue(ProjectAccessRequestConstant.ACCESS_REQUEST_ID));
}
catch (MissingParameterException e) {
log.error("Exception when trying to get required parameter: {}", e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redhat.parodos.infrastructure;
package com.redhat.parodos.examples.project.client;

import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redhat.parodos.tasks.project.consts;
package com.redhat.parodos.examples.project.consts;

public class ProjectAccessRequestConstant {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.redhat.parodos.tasks.project.escalation;
package com.redhat.parodos.examples.project.escalation;

import java.util.UUID;

import com.redhat.parodos.examples.project.client.ProjectRequester;
import com.redhat.parodos.examples.project.consts.ProjectAccessRequestConstant;
import com.redhat.parodos.infrastructure.Notifier;
import com.redhat.parodos.infrastructure.ProjectRequester;
import com.redhat.parodos.notification.sdk.model.NotificationMessageCreateRequestDTO;
import com.redhat.parodos.workflow.exception.MissingParameterException;
import com.redhat.parodos.workflow.task.BaseWorkFlowTask;
Expand All @@ -28,10 +29,6 @@
import com.redhat.parodos.workflows.work.WorkStatus;
import lombok.extern.slf4j.Slf4j;

import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_ESCALATION_USERNAME;
import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_ID;
import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.NOTIFICATION_SUBJECT_ACCESS_REQUEST_ESCALATION;

/**
* Project access request escalation workflow task
*
Expand All @@ -57,15 +54,18 @@ public WorkReport execute(WorkContext workContext) {
String escalationUsername;
UUID accessRequestId;
try {
accessRequestId = UUID.fromString(getRequiredParameterValue(ACCESS_REQUEST_ID));
escalationUsername = getRequiredParameterValue(ACCESS_REQUEST_ESCALATION_USERNAME);
accessRequestId = UUID
.fromString(getRequiredParameterValue(ProjectAccessRequestConstant.ACCESS_REQUEST_ID));
escalationUsername = getRequiredParameterValue(
ProjectAccessRequestConstant.ACCESS_REQUEST_ESCALATION_USERNAME);
}
catch (MissingParameterException e) {
log.error("Exception when trying to get required parameter(s): {}", e.getMessage());
return new DefaultWorkReport(WorkStatus.FAILED, workContext, e);
}
NotificationMessageCreateRequestDTO notificationMessageCreateRequestDTO = new NotificationMessageCreateRequestDTO();
notificationMessageCreateRequestDTO.setSubject(NOTIFICATION_SUBJECT_ACCESS_REQUEST_ESCALATION);
notificationMessageCreateRequestDTO
.setSubject(ProjectAccessRequestConstant.NOTIFICATION_SUBJECT_ACCESS_REQUEST_ESCALATION);
notificationMessageCreateRequestDTO.addUsernamesItem(escalationUsername);
notificationMessageCreateRequestDTO.setBody(getMessage(
String.format("%s/api/v1/projects/access/%s/status", projectRequester.getBasePath(), accessRequestId)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.redhat.parodos.tasks.project;
package com.redhat.parodos.examples.project.task;

import java.util.Arrays;
import java.util.UUID;

import com.redhat.parodos.examples.project.client.ProjectRequester;
import com.redhat.parodos.examples.project.consts.ProjectAccessRequestConstant;
import com.redhat.parodos.infrastructure.Notifier;
import com.redhat.parodos.infrastructure.ProjectRequester;
import com.redhat.parodos.notification.sdk.model.NotificationMessageCreateRequestDTO;
import com.redhat.parodos.workflow.exception.MissingParameterException;
import com.redhat.parodos.workflow.task.BaseWorkFlowTask;
Expand All @@ -29,10 +30,6 @@
import com.redhat.parodos.workflows.work.WorkStatus;
import lombok.extern.slf4j.Slf4j;

import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_APPROVAL_USERNAMES;
import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_ID;
import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.NOTIFICATION_SUBJECT_ACCESS_REQUEST_APPROVAL;

/**
* Project access request approval workflow task
*
Expand All @@ -58,16 +55,19 @@ public WorkReport execute(WorkContext workContext) {
UUID accessRequestId;
String approvalUsernames;
try {
accessRequestId = UUID.fromString(getRequiredParameterValue(ACCESS_REQUEST_ID));
approvalUsernames = getRequiredParameterValue(ACCESS_REQUEST_APPROVAL_USERNAMES);
accessRequestId = UUID
.fromString(getRequiredParameterValue(ProjectAccessRequestConstant.ACCESS_REQUEST_ID));
approvalUsernames = getRequiredParameterValue(
ProjectAccessRequestConstant.ACCESS_REQUEST_APPROVAL_USERNAMES);
}
catch (MissingParameterException e) {
log.error("Exception when trying to get required parameter(s): {}", e.getMessage());
return new DefaultWorkReport(WorkStatus.FAILED, workContext, e);
}

NotificationMessageCreateRequestDTO notificationMessageCreateRequestDTO = new NotificationMessageCreateRequestDTO();
notificationMessageCreateRequestDTO.setSubject(NOTIFICATION_SUBJECT_ACCESS_REQUEST_APPROVAL);
notificationMessageCreateRequestDTO
.setSubject(ProjectAccessRequestConstant.NOTIFICATION_SUBJECT_ACCESS_REQUEST_APPROVAL);
notificationMessageCreateRequestDTO.setUsernames(Arrays.stream(approvalUsernames.split(",")).toList());
notificationMessageCreateRequestDTO.setBody(getMessage(
String.format("%s/api/v1/projects/access/%s", projectRequester.getBasePath(), accessRequestId)));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.redhat.parodos.tasks.project;
package com.redhat.parodos.examples.project.task;

import java.util.List;
import java.util.Objects;

import com.redhat.parodos.infrastructure.ProjectRequester;
import com.redhat.parodos.examples.project.client.ProjectRequester;
import com.redhat.parodos.sdk.invoker.ApiException;
import com.redhat.parodos.sdk.model.AccessRequestDTO;
import com.redhat.parodos.sdk.model.AccessResponseDTO;
Expand All @@ -18,12 +18,12 @@
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;

import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_APPROVAL_USERNAMES;
import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_ESCALATION_USERNAME;
import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_ID;
import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.PARAMETER_ROLE;
import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.PARAMETER_ROLE_DEFAULT;
import static com.redhat.parodos.tasks.project.consts.ProjectAccessRequestConstant.PARAMETER_USERNAME;
import static com.redhat.parodos.examples.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_APPROVAL_USERNAMES;
import static com.redhat.parodos.examples.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_ESCALATION_USERNAME;
import static com.redhat.parodos.examples.project.consts.ProjectAccessRequestConstant.ACCESS_REQUEST_ID;
import static com.redhat.parodos.examples.project.consts.ProjectAccessRequestConstant.PARAMETER_ROLE;
import static com.redhat.parodos.examples.project.consts.ProjectAccessRequestConstant.PARAMETER_ROLE_DEFAULT;
import static com.redhat.parodos.examples.project.consts.ProjectAccessRequestConstant.PARAMETER_USERNAME;

@Slf4j
public class ProjectAccessRequestWorkFlowTask extends BaseWorkFlowTask {
Expand Down
Loading
Loading