Skip to content

Commit

Permalink
Merging the latest 'qa' into 'master' (#303)
Browse files Browse the repository at this point in the history
* Change version to 1.19.0-SNAPSHOT

* 1.19.0-QA version (#297)

* updated id and name

* updated id and name

* Added functionality for disabling modules (OHDSI/ArachneUI#859)

* fixed after review(OHDSI/ArachneUI#859)

* updated version to 1.19.1

* Bump commons-compress from 1.19 to 1.21 in /arachne-commons (#295)

Bumps commons-compress from 1.19 to 1.21.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-compress
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cron-utils from 9.1.3 to 9.1.6 in /arachne-scheduler (#299)

Bumps [cron-utils](https://github.com/jmrozanec/cron-utils) from 9.1.3 to 9.1.6.
- [Release notes](https://github.com/jmrozanec/cron-utils/releases)
- [Commits](jmrozanec/cron-utils@9.1.3...9.1.6)

---
updated-dependencies:
- dependency-name: com.cronutils:cron-utils
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Added Spark to DBMSType (#300)

* 1.19.0-QA based on the latest origin/develop

Co-authored-by: Sergey Suvorov <[email protected]>
Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ajit Londhe <[email protected]>
  • Loading branch information
5 people authored Mar 10, 2022
1 parent 6a68055 commit 5e42e2f
Show file tree
Hide file tree
Showing 17 changed files with 167 additions and 14 deletions.
2 changes: 1 addition & 1 deletion arachne-common-types/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>arachne-commons-bundle</artifactId>
<groupId>com.odysseusinc.arachne</groupId>
<version>1.18.0</version>
<version>1.19.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public enum DBMSType {
IMPALA("Impala", "impala"),
BIGQUERY("Google BigQuery", "bigquery"),
NETEZZA("Netezza", "netezza"),
HIVE("Apache Hive", "hive");
HIVE("Apache Hive", "hive"),
SPARK("Spark", "spark");

private String label;
// For further pass into SqlRender.translateSql as "targetDialect" and DatabaseConnector as "dbms"
Expand Down
2 changes: 1 addition & 1 deletion arachne-common-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>arachne-commons-bundle</artifactId>
<groupId>com.odysseusinc.arachne</groupId>
<version>1.18.0</version>
<version>1.19.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
12 changes: 10 additions & 2 deletions arachne-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.odysseusinc.arachne</groupId>
<artifactId>arachne-commons-bundle</artifactId>
<version>1.18.0</version>
<version>1.19.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -26,6 +26,14 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
Expand Down Expand Up @@ -62,7 +70,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.19</version>
<version>1.21</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
*
* Copyright 2018 Odysseus Data Services, inc.
* 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.
*
* Company: Odysseus Data Services, Inc.
* Product Owner/Architecture: Gregory Klebanov
* Authors: Sergey Suvorov
* Created: September 27, 2021
*
*/

package com.odysseusinc.arachne.commons.api.v1.controller;

import com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult;
import com.odysseusinc.arachne.commons.config.ArachneConfiguration;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api
@RestController
public class ModuleSettingsController {
private final ArachneConfiguration arachneConfiguration;

public ModuleSettingsController(ArachneConfiguration arachneConfiguration) {
this.arachneConfiguration = arachneConfiguration;
}

@RequestMapping(value = "/api/v1/modules/disabled-modules", method = RequestMethod.GET)
public JsonResult<List<String>> getDisabledModules() {
JsonResult<List<String>> result = new JsonResult<>(JsonResult.ErrorCode.NO_ERROR);
result.setResult(arachneConfiguration.getDisabledModules());
return result;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.odysseusinc.arachne.commons.conditions.modules;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(HttpStatus.NOT_FOUND)
public class ModuleAccessException extends RuntimeException {
private String module;

public ModuleAccessException(String module) {
this.module = module;
}

@Override
public String getMessage() {
return String.format("Module %s is disabled", this.module);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.odysseusinc.arachne.commons.conditions.modules;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ModuleEnabled {
String value();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.odysseusinc.arachne.commons.conditions.modules;

import com.odysseusinc.arachne.commons.config.ArachneConfiguration;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class ModuleEnabledAspect {
private final ArachneConfiguration arachneConfiguration;

public ModuleEnabledAspect(ArachneConfiguration arachneConfiguration) {
this.arachneConfiguration = arachneConfiguration;
}

@Around("@within(moduleEnabled)")
public Object checkClassEnabled(ProceedingJoinPoint joinPoint, ModuleEnabled moduleEnabled) throws Throwable {
return checkModuleEnabled(joinPoint, moduleEnabled);
}

@Around("@annotation(moduleEnabled)")
public Object checkMethodEnabled(ProceedingJoinPoint joinPoint, ModuleEnabled moduleEnabled) throws Throwable {
return checkModuleEnabled(joinPoint, moduleEnabled);
}

private Object checkModuleEnabled(ProceedingJoinPoint joinPoint, ModuleEnabled moduleEnabled) throws Throwable {
if (arachneConfiguration.isModuleDisabled(moduleEnabled.value())) {
throw new ModuleAccessException(moduleEnabled.value());
}
return joinPoint.proceed();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.odysseusinc.arachne.commons.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
@ConfigurationProperties(prefix = "arachne")
public class ArachneConfiguration {
@Value("${disabledModules:}")
private List<String> disabledModules;

public List<String> getDisabledModules() {
return disabledModules;
}

public void setDisabledModules(List<String> disabledModules) {
this.disabledModules = disabledModules;
}

public boolean isModuleDisabled(String module) {
return this.disabledModules != null && this.disabledModules.contains(module);
}
}
2 changes: 1 addition & 1 deletion arachne-no-handler-found-exception-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.odysseusinc.arachne</groupId>
<artifactId>arachne-commons-bundle</artifactId>
<version>1.18.0</version>
<version>1.19.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions arachne-scheduler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.odysseusinc.arachne</groupId>
<artifactId>arachne-commons-bundle</artifactId>
<version>1.18.0</version>
<version>1.19.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>com.cronutils</groupId>
<artifactId>cron-utils</artifactId>
<version>9.1.3</version>
<version>9.1.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand Down
2 changes: 1 addition & 1 deletion arachne-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.odysseusinc.arachne</groupId>
<artifactId>arachne-commons-bundle</artifactId>
<version>1.18.0</version>
<version>1.19.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion arachne-sys-settings/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.odysseusinc.arachne</groupId>
<artifactId>arachne-commons-bundle</artifactId>
<version>1.18.0</version>
<version>1.19.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion data-source-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>com.odysseusinc.arachne</groupId>
<artifactId>arachne-commons-bundle</artifactId>
<version>1.18.0</version>
<version>1.19.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion execution-engine-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.odysseusinc.arachne</groupId>
<artifactId>arachne-commons-bundle</artifactId>
<version>1.18.0</version>
<version>1.19.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>com.odysseusinc.arachne</groupId>
<artifactId>arachne-commons-bundle</artifactId>
<version>1.18.0</version>
<version>1.19.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<artifactId>arachne-commons-bundle</artifactId>
<groupId>com.odysseusinc.arachne</groupId>
<version>1.18.0</version>
<version>1.19.0</version>
<packaging>pom</packaging>

<modules>
Expand Down Expand Up @@ -61,6 +61,11 @@
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down

0 comments on commit 5e42e2f

Please sign in to comment.