Skip to content

Commit

Permalink
Merge pull request #21 from sanctuuary/dev
Browse files Browse the repository at this point in the history
Release 1.2.0
  • Loading branch information
KoenHav authored Jul 6, 2021
2 parents 6009531 + 01e5b72 commit 41ad87a
Show file tree
Hide file tree
Showing 53 changed files with 2,063 additions and 123 deletions.
79 changes: 79 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
stages:
- "Unit"
- "Build"
- "Lint"

# Only build every commit on the master branch (pull requests on other branches are still built)
branches:
only:
- master

jobs:
include:
### Back-end

# Back-end unit tests
#- stage: "Unit"
# name: "Unit test back-end"
# language: java
# jdk: openjdk11
# before_script:
# - cd back-end
# script:
# - mvn test

# Back-end build test
- stage: "Build"
name: "Build back-end"
language: java
jdk: openjdk11
before_script:
- cd back-end
script:
- mvn package -DskipTests=true

# Back-end lint test
- stage: "Lint"
name: "Lint back-end"
language: java
jdk: openjdk11
before_script:
- cd back-end
script:
- mvn ktlint:check


### Front-end

# Front-end unit tests
- stage: "Unit"
name: "Unit test front-end"
language: node_js
node_js: 14
before_script:
- cd front-end
script:
- npm install
- npm run test

# Front-end build test
- stage: "Build"
name: "Build front-end"
language: node_js
node_js: 14
before_script:
- cd front-end
script:
- npm install
- npm run build

# Front-end lint test
- stage: "Lint"
name: "Lint front-end"
language: node_js
node_js: 14
before_script:
- cd front-end
script:
- npm install
- npm run lint
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.0] - 2021-07-06

### Added

- Grant or revoke administrator privileges to / from users in the administrator page.
- Manage access to a domain in the domain edit page.
- Endpoint for changing the administrator status of users.
- (Admin only) endpoint for getting a list of all users.
- Endpoint to get all users with certain access to a domain.
- Endpoint to set a user's access to a domain.
- Endpoint to transfer the ownership of a domain.

### Changed

- More specific error messages are shown when a workflow run / synthesis gets interrupted.
- Change occurrences of "APE Web View" to "APE Web".
- Moved front-end Docker container from Node.js 12 to Node.js 14.
- Logging of back-end tests is less verbose (information about the tests themselves is not affected).
- User's email addresses are no longer included in responses from the back-end by default (previously email addresses were also only given when necessary).

### Fixed

- Test application.properties of back-end was in the wrong location.
- The 403 result on the domain edit page now redirects to the home page instead of a non-existent page.

## [1.1.0] - 2021-05-28

### Added
Expand Down Expand Up @@ -57,5 +82,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Approve user accounts.

[Unreleased]: https://github.com/sanctuuary/APE-Web/compare/master...dev
[1.2.0]: https://github.com/sanctuuary/APE-Web/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/sanctuuary/APE-Web/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/sanctuuary/APE-Web/releases/tag/v1.0.0
2 changes: 1 addition & 1 deletion back-end/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ COPY pom.xml /app
RUN mvn compile
COPY . /app
RUN mvn package -DskipTests=true -P docker
ENTRYPOINT ["java", "-jar", "target/backend-1.1.0.jar"]
ENTRYPOINT ["java", "-jar", "target/backend-1.2.0.jar"]
15 changes: 15 additions & 0 deletions back-end/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,18 @@ You can now build the back-end using:
````shell
$ mvn package -DskipTests=true
````

## Documentation

The documentation of the back-end is generated using [Orchid](https://orchid.run/).
To generate and view the documentation, use:
```shell
mvn orchid:serve
```
You can now view the documentation when you go to http://localhost:8080 in your browser.

If you wish to only build the documentation, run:
```shell
mvn orchid:build
```
The documentation is placed in `target/docs`.
126 changes: 63 additions & 63 deletions back-end/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.apexdevs</groupId>
<artifactId>backend</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
<name>backend</name>
<description>APE Web back-end</description>

Expand Down Expand Up @@ -41,67 +41,67 @@
</profile>
</profiles>

<dependencies>
<!-- new APE version with all its dependencies-->
<dependency>
<groupId>io.github.sanctuuary</groupId>
<artifactId>APE</artifactId>
<version>1.1.7</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.sat4j</groupId>
<artifactId>org.sat4j.core</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
<version>5.1.17</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- new APE version with all its dependencies-->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>guru.nidi</groupId>
<artifactId>graphviz-java</artifactId>
<version>0.17.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependencies>
<!-- new APE version with all its dependencies-->
<dependency>
<groupId>io.github.sanctuuary</groupId>
<artifactId>APE</artifactId>
<version>1.1.7</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.sat4j</groupId>
<artifactId>org.sat4j.core</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
<version>5.1.17</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- new APE version with all its dependencies-->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>guru.nidi</groupId>
<artifactId>graphviz-java</artifactId>
<version>0.17.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down Expand Up @@ -227,7 +227,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
<version>0.8.7</version>
<configuration>
<excludes>
<exclude>**/*/exception/*</exclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import com.apexdevs.backend.ape.entity.workflow.WorkflowOutput
import com.apexdevs.backend.persistence.RunParametersOperation
import com.apexdevs.backend.persistence.database.entity.Domain
import com.apexdevs.backend.persistence.exception.RunParametersExceedLimitsException
import com.apexdevs.backend.persistence.exception.SynthesisFlagException
import guru.nidi.graphviz.attribute.Rank
import nl.uu.cs.ape.sat.APE
import nl.uu.cs.ape.sat.core.implSAT.SATsolutionsList
import nl.uu.cs.ape.sat.core.solutionStructure.CWLCreator
import nl.uu.cs.ape.sat.core.solutionStructure.ModuleNode
import nl.uu.cs.ape.sat.core.solutionStructure.TypeNode
import nl.uu.cs.ape.sat.models.enums.SynthesisFlag
import nl.uu.cs.ape.sat.models.logic.constructs.TaxonomyPredicate
import java.io.ByteArrayOutputStream
import java.nio.file.Path
Expand Down Expand Up @@ -52,6 +54,7 @@ class ApeRequest(val domain: Domain, private val rootLocation: Path, val ape: AP
* Runs APE with the current config, then parses it to a suitable FE format
* @param: The amount of workflows wanted
* @throws RunParametersExceedLimitsException When the given config exceeds the configured run parameters limits
* @throws SynthesisFlagException When the run is interrupted
* @return: A list of resulting workflows
*/
fun getWorkflows(runConfig: RunConfig): MutableList<WorkflowOutput> {
Expand All @@ -68,6 +71,11 @@ class ApeRequest(val domain: Domain, private val rootLocation: Path, val ape: AP
runWithConfig(runConfig)
val resultingWorkflows = mutableListOf<WorkflowOutput>()

// check if the run was interrupted
if (solutions.flag != SynthesisFlag.NONE) {
throw SynthesisFlagException(this, solutions.flag)
}

for (i in 0 until solutions.numberOfSolutions) {

val solutionWorkflow = solutions.get(i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,18 @@ class DomainOperation(val domainRepository: DomainRepository, val userRepository
// Return true if user has access rights and these are better or equal to required access rights
return userAccess.isPresent && userAccess.get().access >= requiredAccess
}

/**
* Gets all users who have one of the given access levels to a certain domain.
* @param domainId The id of the domain to which the users should have access.
* @param access The access levels which the users should have.
* @return A list of user id's with the access level the users have to the domain.
*/
fun getUsersByDomainAndAccess(domainId: ObjectId, access: List<DomainAccess>): List<UserDomainAccess> {
val usersByDomainAndAccess: MutableList<UserDomainAccess> = mutableListOf()
for (accessRight in access) {
usersByDomainAndAccess += userDomainAccessRepository.findAllByDomainIdAndAccess(domainId, accessRight)
}
return usersByDomainAndAccess.toList()
}
}
Loading

0 comments on commit 41ad87a

Please sign in to comment.