Skip to content

Commit

Permalink
Merge branch 'main' into feature/dev-3374-move-getnonsystemprojects-t…
Browse files Browse the repository at this point in the history
…o-service
  • Loading branch information
seakayone authored Mar 18, 2024
2 parents 0fbb6c2 + e2e57c1 commit 7b51ee4
Show file tree
Hide file tree
Showing 114 changed files with 1,984 additions and 1,777 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build-and-test-empty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ on:
- "release-*"

jobs:
check-formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: Skip with success
run: |
echo "skipped"
exit 0
build-and-test:
name: Build and test
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
uses: google-github-actions/release-please-action@v3
with:
token: ${{ secrets.GH_TOKEN }}
draft-pull-request: true
release-type: simple
package-name: dsp-api
pull-request-title-pattern: "chore${scope}: Release${component} ${version}"
Expand Down
2 changes: 1 addition & 1 deletion .scalafix.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ OrganizeImports {
blankLines = Auto
coalesceToWildcardImportThreshold = null
expandRelative = false
groupExplicitlyImportedImplicitsSeparately = false
groupedImports = Explode
groups = [
"*"
Expand All @@ -18,6 +17,7 @@ OrganizeImports {
importsOrder = Ascii
preset = DEFAULT
removeUnused = true
targetDialect = Scala3
}

RemoveUnused {
Expand Down
14 changes: 10 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import sbt.Keys.version

import scala.language.postfixOps
import scala.sys.process.*

import org.knora.Dependencies
import org.knora.LocalSettings

import java.time.Instant

//////////////////////////////////////
// GLOBAL SETTINGS
//////////////////////////////////////
Expand All @@ -34,6 +35,9 @@ val gitVersion = ("git describe --tag --dirty --abbrev=7 --always " !!).trim +

ThisBuild / version := gitVersion

lazy val buildCommit = ("git rev-parse --short HEAD" !!).trim
lazy val buildTime = Instant.now.toString

lazy val aggregatedProjects: Seq[ProjectReference] = Seq(webapi, sipi, integration)

lazy val buildSettings = Seq(
Expand Down Expand Up @@ -253,9 +257,11 @@ lazy val webapi: Project = Project(id = "webapi", base = file("webapi"))
buildInfoKeys ++= Seq[BuildInfoKey](
name,
version,
"sipi" -> Dependencies.sipiImage,
"fuseki" -> Dependencies.fusekiImage,
"pekkoHttp" -> Dependencies.pekkoHttp,
"sipi" -> Dependencies.sipiImage,
"fuseki" -> Dependencies.fusekiImage,
"pekkoHttp" -> Dependencies.pekkoHttp,
"buildCommit" -> buildCommit,
"buildTime" -> buildTime,
),
buildInfoPackage := "org.knora.webapi.http.version",
)
Expand Down
2 changes: 0 additions & 2 deletions docs/02-dsp-ontologies/knora-base.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ In Knora, each item of data belongs to some particular project. Each project usi

- `projectDescription` (1-n): A description of the project.

- `belongsToInstitution` (0-1): The `kb:Institution` that the project belongs to.

Ontologies and resources are associated with a project by means of the
`kb:attachedToProject` property, as described in [Ontologies](#ontologies)
and [Properties of Resource](#properties-of-resource)). Users are associated with a project by means of
Expand Down
38 changes: 15 additions & 23 deletions docs/03-endpoints/api-util/version.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,29 @@

# Version

The version endpoint provides the versions of the used components in the Knora-stack.
The response has the type `application/json` and contains the following information:

1. name: has the value "version"

2. version numbers for the following components:
- pekkoHttp
- gdbFree
- gdbSE
- sbt
- scala
- sipi
- webapi

The version endpoint provides all versions of used components in the DSP stack.

## Example request

`GET /version`


## Example response

```json
HTTP/1.1 200 OK
Content-Length: 247
Content-Type: application/json
Date: Mon, 11 Mar 2024 17:40:32 GMT
Server: webapi/v30.9.0

{
"pekkoHttp": "10.1.7",
"gdbFree": "8.10.0-free",
"gdbSE": "8.5.0-se",
"name": "version",
"sbt": "1.2.8",
"scala": "2.12.8",
"sipi": "v2.0.1",
"webapi": "10.0.0-7-gc5a72b3-SNAPSHOT"
"buildCommit": "bbb0e65c7",
"buildTime": "2024-03-11T17:40:17.322491Z",
"fuseki": "2.1.5",
"pekkoHttp": "1.0.1",
"scala": "2.13.13",
"sipi": "3.9.0",
"webapi": "v30.9.0"
}

```
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ erDiagram
```

!!! danger "Unclear/Unexpected Stuff"

- User.phone?
- Institution? (name, description, website, phone, address, email)
- Project.belongsToInstitution?

### Overview V2

```mermaid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

package org.knora.webapi.core

import org.apache.pekko
import org.apache.pekko.actor.ActorSystem
import zio.*

object ActorSystemTest {

def layer(sys: pekko.actor.ActorSystem): ZLayer[Any, Nothing, ActorSystem] =
ZLayer.scoped(ZIO.succeed(new ActorSystem { override val system: pekko.actor.ActorSystem = sys }))
def layer(sys: ActorSystem): ZLayer[Any, Nothing, ActorSystem] = ZLayer.succeed(sys)
}
14 changes: 11 additions & 3 deletions integration/src/test/scala/org/knora/webapi/core/LayersTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import org.knora.webapi.slice.admin.repo.service.KnoraProjectRepoLive
import org.knora.webapi.slice.admin.repo.service.KnoraUserRepoLive
import org.knora.webapi.slice.common.api.*
import org.knora.webapi.slice.common.repo.service.PredicateObjectMapper
import org.knora.webapi.slice.infrastructure.api.ManagementEndpoints
import org.knora.webapi.slice.infrastructure.api.ManagementRoutes
import org.knora.webapi.slice.ontology.api.service.RestCardinalityService
import org.knora.webapi.slice.ontology.api.service.RestCardinalityServiceLive
import org.knora.webapi.slice.ontology.domain.service.CardinalityService
Expand Down Expand Up @@ -83,7 +85,11 @@ object LayersTest {
with DspIngestTestContainer
with SharedVolumes.Images

type CommonR0 = ActorSystem with AppConfigurationsTest with JwtService with SipiService with StringFormatter
type CommonR0 = pekko.actor.ActorSystem
with AppConfigurationsTest
with JwtService
with SipiService
with StringFormatter
type CommonR =
ApiRoutes
with AdminApiEndpoints
Expand Down Expand Up @@ -181,10 +187,11 @@ object LayersTest {
InferenceOptimizationService.layer,
IriConverter.layer,
IriService.layer,
KnoraGroupRepoLive.layer,
KnoraProjectRepoLive.layer,
KnoraResponseRenderer.layer,
KnoraGroupRepoLive.layer,
KnoraUserRepoLive.layer,
KnoraUserService.layer,
KnoraUserToUserConverter.layer,
ListRestService.layer,
ListsEndpoints.layer,
Expand All @@ -195,6 +202,7 @@ object LayersTest {
MaintenanceEndpointsHandlers.layer,
MaintenanceRestService.layer,
MaintenanceServiceLive.layer,
ManagementRoutes.layer,
MessageRelayLive.layer,
OntologyCacheLive.layer,
OntologyHelpersLive.layer,
Expand Down Expand Up @@ -235,13 +243,13 @@ object LayersTest {
TapirToPekkoInterpreter.layer,
TestClientService.layer,
TriplestoreServiceLive.layer,
KnoraUserService.layer,
UserService.layer,
UsersEndpoints.layer,
UsersEndpointsHandler.layer,
UsersResponder.layer,
UsersRestService.layer,
ValuesResponderV2Live.layer,
ManagementEndpoints.layer,
)

private val fusekiAndSipiTestcontainers =
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import dsp.valueobjects.Iri
import org.knora.webapi.*
import org.knora.webapi.e2e.v2.ResponseCheckerV2.compareJSONLDForMappingCreationResponse
import org.knora.webapi.messages.OntologyConstants
import org.knora.webapi.messages.store.sipimessages.SipiUploadResponseJsonProtocol.*
import org.knora.webapi.messages.store.sipimessages.*
import org.knora.webapi.messages.store.sipimessages.SipiUploadResponseJsonProtocol.*
import org.knora.webapi.messages.store.triplestoremessages.RdfDataObject
import org.knora.webapi.messages.util.rdf.JsonLDDocument
import org.knora.webapi.messages.util.rdf.JsonLDKeywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import org.knora.webapi.messages.OntologyConstants.KnoraBase.EntityPermissionAbb
import org.knora.webapi.messages.admin.responder.permissionsmessages.PermissionsMessagesUtilADM.PermissionTypeAndCodes
import org.knora.webapi.responders.admin.PermissionsResponderADM
import org.knora.webapi.routing.UnsafeZioRun
import org.knora.webapi.sharedtestdata.*
import org.knora.webapi.sharedtestdata.SharedOntologyTestDataADM.*
import org.knora.webapi.sharedtestdata.SharedTestDataADM2.*
import org.knora.webapi.sharedtestdata.*
import org.knora.webapi.slice.admin.api.service.PermissionsRestService
import org.knora.webapi.util.ZioScalaTestUtil.assertFailsWithA

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import dsp.errors.BadRequestException
import org.knora.webapi.CoreSpec
import org.knora.webapi.IRI
import org.knora.webapi.messages.OntologyConstants
import org.knora.webapi.messages.util.rdf.*
import org.knora.webapi.messages.util.rdf.JenaModel
import org.knora.webapi.messages.util.rdf.JenaModelFactory
import org.knora.webapi.messages.util.rdf.JenaNodeFactory
import org.knora.webapi.messages.util.rdf.*
import org.knora.webapi.util.FileUtil

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import java.io.FileInputStream
import dsp.errors.AssertionException
import org.knora.webapi.CoreSpec
import org.knora.webapi.messages.OntologyConstants
import org.knora.webapi.messages.util.rdf.JenaRepository
import org.knora.webapi.messages.util.rdf.*
import org.knora.webapi.messages.util.rdf.JenaRepository

/**
* Tests implementations of [[RdfModel]].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

package org.knora.webapi.models.filemodels

import spray.json.DefaultJsonProtocol.*
import spray.json.*
import spray.json.DefaultJsonProtocol.*

import java.time.Instant
import java.util.UUID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

package org.knora.webapi.models.standoffmodels

import spray.json.DefaultJsonProtocol.*
import spray.json.*
import spray.json.DefaultJsonProtocol.*

import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import dsp.errors.NotFoundException
import org.knora.webapi.*
import org.knora.webapi.messages.OntologyConstants
import org.knora.webapi.messages.OntologyConstants.KnoraBase.EntityPermissionAbbreviations
import org.knora.webapi.messages.admin.responder.permissionsmessages.PermissionsMessagesUtilADM.PermissionTypeAndCodes
import org.knora.webapi.messages.admin.responder.permissionsmessages.*
import org.knora.webapi.messages.admin.responder.permissionsmessages.PermissionsMessagesUtilADM.PermissionTypeAndCodes
import org.knora.webapi.messages.store.triplestoremessages.RdfDataObject
import org.knora.webapi.messages.util.KnoraSystemInstances
import org.knora.webapi.messages.util.PermissionUtilADM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import dsp.valueobjects.V2
import org.knora.webapi.*
import org.knora.webapi.messages.OntologyConstants
import org.knora.webapi.messages.admin.responder.permissionsmessages.*
import org.knora.webapi.messages.admin.responder.projectsmessages.ProjectIdentifierADM.*
import org.knora.webapi.messages.admin.responder.projectsmessages.*
import org.knora.webapi.messages.admin.responder.projectsmessages.ProjectIdentifierADM.*
import org.knora.webapi.routing.UnsafeZioRun
import org.knora.webapi.sharedtestdata.SharedTestDataADM
import org.knora.webapi.slice.admin.api.model.ProjectsEndpointsRequestsAndResponses.ProjectCreateRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import org.knora.webapi.slice.admin.api.UsersEndpoints.Requests.StatusChangeRequ
import org.knora.webapi.slice.admin.api.UsersEndpoints.Requests.SystemAdminChangeRequest
import org.knora.webapi.slice.admin.api.UsersEndpoints.Requests.UserCreateRequest
import org.knora.webapi.slice.admin.api.service.UsersRestService
import org.knora.webapi.slice.admin.domain.model.*
import org.knora.webapi.slice.admin.domain.model.Group
import org.knora.webapi.slice.admin.domain.model.KnoraProject.ProjectIri
import org.knora.webapi.slice.admin.domain.model.Username
import org.knora.webapi.slice.admin.domain.model.*
import org.knora.webapi.slice.admin.domain.service.UserService
import org.knora.webapi.util.ZioScalaTestUtil.assertFailsWithA

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import org.knora.webapi.messages.store.triplestoremessages.*
import org.knora.webapi.messages.util.KnoraSystemInstances
import org.knora.webapi.messages.v2.responder.CanDoResponseV2
import org.knora.webapi.messages.v2.responder.SuccessResponseV2
import org.knora.webapi.messages.v2.responder.ontologymessages.OwlCardinality.KnoraCardinalityInfo
import org.knora.webapi.messages.v2.responder.ontologymessages.*
import org.knora.webapi.messages.v2.responder.ontologymessages.OwlCardinality.KnoraCardinalityInfo
import org.knora.webapi.messages.v2.responder.resourcemessages.CreateResourceRequestV2
import org.knora.webapi.messages.v2.responder.resourcemessages.CreateResourceV2
import org.knora.webapi.messages.v2.responder.resourcemessages.CreateValueInNewResourceV2
Expand Down
Loading

0 comments on commit 7b51ee4

Please sign in to comment.