Skip to content
Merged
Show file tree
Hide file tree
Changes from 101 commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
870187a
refactor(dsp-api): Align *RestService method signature and simplify *…
seakayone Sep 23, 2025
16bb65d
Merge order query params and move default values into endpoint spec
seakayone Sep 23, 2025
4e6301b
Merge branch 'main' into refactor/align-rest-service-user-methods
seakayone Sep 23, 2025
41b9e83
cleanup
seakayone Sep 23, 2025
8fa280e
Move SearchApiRoutes and SearchRestService to own files
seakayone Sep 23, 2025
356797d
align SearchRestService methods and inline handlers in SearchApiRoutes
seakayone Sep 23, 2025
fb1ab7f
Move ManagementEndpoints to own file and cleanup
seakayone Sep 23, 2025
1ce0fec
Introduce ManagementRestService
seakayone Sep 23, 2025
5df0270
add flaky test aspect to "/maintenance/needs-top-left-correction shou…
seakayone Sep 23, 2025
022090c
(wip) refactor: Replace pekko http with zio http server
seakayone Sep 23, 2025
2c0f848
refactor(dsp-api): Align *RestService method signature and simplify *…
seakayone Sep 23, 2025
864be69
Merge branch 'refactor/align-rest-service-user-methods' into refactor…
seakayone Sep 23, 2025
1823939
remove Public and SecuredHandlers
seakayone Sep 23, 2025
702d825
remove Public and SecuredHandlers
seakayone Sep 23, 2025
f234fec
remove Public and SecuredHandlers
seakayone Sep 23, 2025
e201066
remove Public and SecuredHandlers
seakayone Sep 23, 2025
653725d
remove Public and SecuredHandlers
seakayone Sep 23, 2025
86bcaca
remove Public and SecuredHandlers
seakayone Sep 23, 2025
ea7c717
remove Public and SecuredHandlers
seakayone Sep 23, 2025
5964b2d
remove Public and SecuredHandlers
seakayone Sep 23, 2025
52dec9d
remove Public and SecuredHandlers
seakayone Sep 23, 2025
a9f4cae
remove Public and SecuredHandlers
seakayone Sep 23, 2025
f117357
remove Public and SecuredHandlers
seakayone Sep 23, 2025
79ac657
remove Public and SecuredHandlers
seakayone Sep 23, 2025
69990dd
remove Public and SecuredHandlers
seakayone Sep 23, 2025
11f416b
remove Public and SecuredHandlers
seakayone Sep 23, 2025
2160952
remove Public and SecuredHandlers
seakayone Sep 23, 2025
38afd79
remove Public and SecuredHandlers
seakayone Sep 23, 2025
7ec9d6a
remove Public and SecuredHandlers
seakayone Sep 23, 2025
43d7c54
fix layers
seakayone Sep 23, 2025
0794fb0
fix server
seakayone Sep 23, 2025
ffde02e
organize imports
seakayone Sep 23, 2025
47b0304
start server in main
seakayone Sep 23, 2025
e098a29
start server in main
seakayone Sep 24, 2025
2506eb5
start server in main
seakayone Sep 24, 2025
61fceff
start server in main
seakayone Sep 24, 2025
206d66a
cors
seakayone Sep 24, 2025
47951a7
rm rootUser from E2EZSpec
seakayone Sep 24, 2025
54fb7e7
cors spec
seakayone Sep 24, 2025
67920b8
fmt
seakayone Sep 24, 2025
890406b
Merge branch 'main' into refactor/replace-pekko-http-with-zio-http-2
seakayone Sep 24, 2025
9f23daa
cleanup
seakayone Sep 24, 2025
f848cde
fix SipiIT to be able to run while api server has not shutdown yet
seakayone Sep 24, 2025
fca003a
finetuning
seakayone Sep 24, 2025
746297f
fixup
seakayone Sep 24, 2025
7342840
use OntologyTestHelper
seakayone Sep 24, 2025
09feeb3
introduce api.v2 slice
seakayone Sep 24, 2025
9d38cbb
git ignore claude flow stuff
seakayone Sep 24, 2025
ca03b3d
fix content negotiation
seakayone Sep 25, 2025
c517273
cleanup
seakayone Sep 25, 2025
48f3e50
cleanup
seakayone Sep 25, 2025
dd56cc3
fmt
seakayone Sep 25, 2025
bb9911a
fmt
seakayone Sep 25, 2025
3385a1b
fix Method not allowed by only allowing a single iri for class and pr…
seakayone Sep 26, 2025
5d9cac8
Merge branch 'main' into refactor/replace-pekko-http-with-zio-http-2
seakayone Sep 30, 2025
30acc7e
inline LayersTest
seakayone Sep 30, 2025
5123859
typo
seakayone Sep 30, 2025
2b28c54
fmt
seakayone Sep 30, 2025
31ea939
finetuning
seakayone Sep 30, 2025
08fb001
fmt
seakayone Sep 30, 2025
c76379b
load a file only once into the triplestore
seakayone Sep 30, 2025
23ac67c
rm unused TestStartupUtils.scala
seakayone Sep 30, 2025
a670860
fix deriving schema from provided property IRI
seakayone Sep 30, 2025
bb6f277
fmt
seakayone Sep 30, 2025
77944bc
Migrate InputOntologyV2Spec to E2ESpec
seakayone Sep 30, 2025
f00d5c5
Merge branch 'main' into refactor/replace-pekko-http-with-zio-http-2
seakayone Oct 1, 2025
c0ff833
Merge branch 'main' into refactor/replace-pekko-http-with-zio-http-2
seakayone Oct 1, 2025
f774b16
Migrate ResponseCheckerV2Spec to E2EZSpec
seakayone Oct 1, 2025
f60bed4
Merge branch 'main' into refactor/replace-pekko-http-with-zio-http-2
seakayone Oct 1, 2025
330a155
fmt
seakayone Oct 1, 2025
d13dcef
try without closing the eh cache
seakayone Oct 1, 2025
2ef59f0
add spec for CacheManager
seakayone Oct 1, 2025
665a88f
readd closing the CacheManager and logging
seakayone Oct 1, 2025
7f8fb34
Remove unused config
seakayone Oct 1, 2025
0200246
update buildjet to buildjet-8vcpu-ubuntu-2204
seakayone Oct 2, 2025
35c1557
try fix test on CI by using different api client and improve implemen…
seakayone Oct 2, 2025
6a8cbb0
run e2e using sbt, do not report coverage
seakayone Oct 2, 2025
d603f7f
use latest SipiTestContainer
seakayone Oct 2, 2025
3be3595
fmt
seakayone Oct 2, 2025
9f19da1
split test
seakayone Oct 2, 2025
69d9f5f
add logging timing
seakayone Oct 3, 2025
bef5463
try removing caching from KnoraUserRepoLive
seakayone Oct 3, 2025
461f9fb
Revert "try removing caching from KnoraUserRepoLive"
seakayone Oct 3, 2025
30a8b83
activate response compression
seakayone Oct 3, 2025
ff29d50
refactor TestApiClient, central method for sendRequest
seakayone Oct 3, 2025
2036379
fmt
seakayone Oct 3, 2025
e76f832
try biggest buildjet instance
seakayone Oct 3, 2025
12d8a4c
update fuseki
seakayone Oct 3, 2025
282b045
debug logging
seakayone Oct 3, 2025
e6b53f2
Merge branch 'main' into refactor/replace-pekko-http-with-zio-http-2
seakayone Oct 9, 2025
d1e48b6
Merge branch 'main' into refactor/replace-pekko-http-with-zio-http-2
seakayone Oct 9, 2025
5e7ce64
extract addLogTiming
seakayone Oct 9, 2025
7ea481d
add flaky to AdminUsersProjectMemberShipsEndpointsE2ESpec
seakayone Oct 9, 2025
57182a4
Merge branch 'main' into refactor/replace-pekko-http-with-zio-http-2
seakayone Oct 9, 2025
afaabfd
add timeout
seakayone Oct 9, 2025
bc78136
make tests independent of one another by creating a new user each time
seakayone Oct 9, 2025
2fb6c18
lastname may contain characters not allowed in username, use positive…
seakayone Oct 9, 2025
b5ab7dc
rm extra logging and cleanup
seakayone Oct 9, 2025
3459693
fmt
seakayone Oct 9, 2025
5a22876
use TestAspect.flaky
seakayone Oct 9, 2025
1e19562
use TestAspect.flaky and timeout
seakayone Oct 9, 2025
d67b1f6
remove comment and inline addAuthIfNeeded
seakayone Oct 13, 2025
be78c6f
rm unused jsonLogger()
seakayone Oct 13, 2025
bf9411f
Mark tests as flaky
seakayone Oct 13, 2025
ea0aff6
mark test as flaky
seakayone Oct 13, 2025
cb49db2
mark test as flaky
seakayone Oct 13, 2025
73c87ee
fmt
seakayone Oct 13, 2025
86b1899
Merge branch 'main' into refactor/replace-pekko-http-with-zio-http-2
seakayone Oct 13, 2025
b4ee6a0
mark tests as flaky
seakayone Oct 13, 2025
0bbe546
mark as flaky and refactor for readability
seakayone Oct 13, 2025
032f9a6
Merge branch 'main' into refactor/replace-pekko-http-with-zio-http-2
seakayone Oct 13, 2025
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
15 changes: 3 additions & 12 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI-build-and-test

on:
pull_request:
types: [ opened, reopened, synchronize ]
types: [opened, reopened, synchronize]
branches-ignore:
- "**/graphite-base/**"

Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:

test-e2e:
name: Build and E2E test
runs-on: buildjet-4vcpu-ubuntu-2204
runs-on: buildjet-32vcpu-ubuntu-2204
concurrency:
group: ${{ github.ref }}-e2e
cancel-in-progress: true
Expand All @@ -83,23 +83,14 @@ jobs:
with:
java-version: ${{ env.JAVA_VERSION }}
- name: Run end-to-end tests
run: make test-e2e
run: ./sbtx "test-e2e/test"
- name: WebApi E2E Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: WebApi E2E Test Results
path: ./modules/test-e2e/target/test-reports/TEST-*.xml
reporter: java-junit
- name: Upload coverage data to codacy
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./target/scala-3.3.6/coverage-report/cobertura.xml
- name: Upload coverage data to codecov
uses: codecov/codecov-action@v3
with:
files: ./target/scala-3.3.6/coverage-report/cobertura.xml

test-ingest-integration:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ ingest/docs/openapi/*.yml
# Claude Code
.claude/settings.local.json
/.claude/tmp
.claude-flow/*
.swarm/*

# ingest
localdev/storage/
11 changes: 5 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ When context is insufficient, prefer asking 1–3 focused questions rather than
## Project Overview

DSP-API is the Digital Humanities Service Platform API — a Scala-based REST API for managing semantic data and digital
assets in the humanities. The project uses ZIO for functional programming, Pekko HTTP (Apache Pekko) for the API, and
assets in the humanities. The project uses ZIO for functional programming, zio-http and tapir for the API, and
integrates with Apache Jena Fuseki triplestore and the Sipi media server.

## Build System & Commands
Expand Down Expand Up @@ -74,7 +74,7 @@ Essential commands:
- Technology
- Language: Scala 3.3.x
- FP: ZIO 2.x
- HTTP: Pekko HTTP + Tapir
- HTTP: ZIO HTTP + Tapir
- Store: Apache Jena Fuseki (RDF)
- Media: Sipi
- JSON: ZIO JSON
Expand All @@ -98,17 +98,16 @@ Essential commands:
## API Structure

- Endpoints: defined via Tapir in `*Endpoints.scala`
- Handlers: in `*EndpointsHandler.scala`
- Routes: in `*Routes.scala` and wired through `ApiRoutes.scala`
- ServerEndpoints: in `*ServerEndpoints.scala`
- API areas: Admin API, API v2 (main), Management (health/metrics)
- Auth: JWT; scoped authorization; session management

## Common Agent Tasks

- Add a new endpoint
1. Define endpoint in the appropriate `*Endpoints.scala`
2. Implement handler in `*EndpointsHandler.scala`
3. Add route in `*Routes.scala` and register in `ApiRoutes.scala`
2. Connect endpoint definition with server logic in `*ServerEndpoints.scala`
3. Register in `CompleteApiServerEndpoints.scala`
4. Add unit/integration tests mirroring the main structure
- Code style and patterns
- Use Scalafmt; prefer ZIO effects over side effects
Expand Down
12 changes: 6 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Project Overview

DSP-API is the Digital Humanities Service Platform API - a Scala-based REST API for managing semantic data and digital assets in the humanities.
The project uses ZIO for functional programming, Pekko HTTP (Apache Pekko) for the API, and integrates with Apache Jena Fuseki triplestore and Sipi media server.
The project uses ZIO for functional programming, zio-http as HTTP server and tapir for defining endpoints of the API, and integrates with Apache Jena Fuseki triplestore and Sipi media server.

## Build System & Commands

Expand Down Expand Up @@ -143,10 +143,10 @@ Each slice typically contains:
## Common Development Tasks

### Adding New Endpoints
1. Define endpoint in appropriate `*Endpoints.scala`
2. Implement handler in `*EndpointsHandler.scala`
3. Add route in `*Routes.scala`
4. Add to main router in `ApiRoutes.scala`
1. Define endpoint in the appropriate `*Endpoints.scala`
2. Connect endpoint definition with server logic in `*ServerEndpoints.scala`
3. Register in `CompleteApiServerEndpoints.scala`
4. Add unit/integration tests mirroring the main structure

### Code Style
- Use Scalafmt for formatting
Expand All @@ -164,4 +164,4 @@ Each slice typically contains:
### Debugging
- Use `make stack-logs` to view all service logs
- Check `make stack-health` for API health status
- Use `make stack-status` to see container status
- Use `make stack-status` to see container status
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ lazy val testkit: Project = Project(id = "testkit", base = file("modules/testkit
Dependencies.zioTest,
Dependencies.testcontainers,
Dependencies.wiremock,
Dependencies.dataFaker,
),
publish / skip := true,
name := "testkit",
Expand All @@ -310,7 +311,6 @@ lazy val it: Project = Project(id = "test-it", base = file("modules/test-it"))
Test / fork := true,
Test / testForkedParallel := false,
Test / parallelExecution := false,
Test / javaOptions += "-Dkey=" + sys.props.getOrElse("key", "pekko"),
Test / testOptions += Tests.Argument("-oDF"), // full stack traces and durations
Test / baseDirectory := (ThisBuild / baseDirectory).value,
libraryDependencies ++= Dependencies.webapiDependencies ++ Dependencies.webapiTestDependencies ++ Dependencies.integrationTestDependencies,
Expand Down Expand Up @@ -342,7 +342,6 @@ lazy val e2e: Project = Project(id = "test-e2e", base = file("modules/test-e2e")
Test / fork := true,
Test / testForkedParallel := false,
Test / parallelExecution := false,
Test / javaOptions += "-Dkey=" + sys.props.getOrElse("key", "pekko"),
Test / testOptions += Tests.Argument("-oDF"),
Test / baseDirectory := (ThisBuild / baseDirectory).value,
libraryDependencies ++= Dependencies.webapiDependencies ++ Dependencies.webapiTestDependencies ++ Dependencies.integrationTestDependencies,
Expand Down
1 change: 0 additions & 1 deletion docs/03-endpoints/api-util/version.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Server: webapi/v30.9.0
"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"
Expand Down
7 changes: 1 addition & 6 deletions docs/04-publishing-deployment/configuration.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Configuration

All configuration for Knora is done in `application.conf`. Besides the Knora application
specific configuration, there we can also find configuration for the underlying Pekko library.
All configuration for Knora is done in `application.conf`.

For optimal performance it is important to tune the configuration to the hardware used, mainly
to the number of CPUs and cores per CPU.

The relevant sections for tuning are:

- `pekko.actor.deployment`
- `knora-actor-dispatcher`
- `knora-blocking-dispatcher`

Expand All @@ -18,9 +16,6 @@ A number of core settings is additionally configurable through system environmen

| key in application.conf | environment variable | default value |
|----------------------------------------|-------------------------------------------------|-------------------------|
| pekko.log-config-on-start | KNORA_AKKA_LOG_CONFIG_ON_START | off |
| pekko.loglevel | KNORA_AKKA_LOGLEVEL | INFO |
| pekko.stdout-loglevel | KNORA_AKKA_STDOUT_LOGLEVEL | INFO |
| app.print-extended-config | KNORA_WEBAPI_PRINT_EXTENDED_CONFIG | false |
| app.bcrypt-password-strength | KNORA_WEBAPI_BCRYPT_PASSWORD_STRENGTH | 12 |
| app.jwt.secret | KNORA_WEBAPI_JWT_SECRET_KEY | super-secret-key |
Expand Down
47 changes: 0 additions & 47 deletions docs/05-internals/design/api-v2/how-to-add-a-route.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ final case class MaintenanceEndpointsHandler(
.as("work in progress"),
)

val endpoints: List[ZServerEndpoint[Any, Any]] =
List(
postMaintenanceEndpoint,
needsTopLeftCorrectionEndpoint,
wasTopLeftCorrectionAppliedEndpoint,
)
val endpoints: List[ZServerEndpoint[Any, Any]] = List(
postMaintenanceEndpoint,
needsTopLeftCorrectionEndpoint,
wasTopLeftCorrectionAppliedEndpoint,
)
}

object MaintenanceEndpointsHandler {
Expand Down
1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ nav:
- Ontology Schemas: 05-internals/design/api-v2/ontology-schemas.md
- Smart IRIs: 05-internals/design/api-v2/smart-iris.md
- Content Wrappers: 05-internals/design/api-v2/content-wrappers.md
- How to Add an API v2 Route: 05-internals/design/api-v2/how-to-add-a-route.md
- JSON-LD Parsing and Formatting: 05-internals/design/api-v2/json-ld.md
- Ontology Management: 05-internals/design/api-v2/ontology-management.md
- DSP-API and Sipi: 05-internals/design/api-v2/sipi.md
Expand Down
2 changes: 0 additions & 2 deletions modules/test-e2e/src/test/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include "test"

app {
triplestore {
dbtype = "fuseki"
Expand Down
29 changes: 0 additions & 29 deletions modules/test-e2e/src/test/resources/test.conf

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object CORSSupportE2ESpec extends E2EZSpec {
corsClient(_.options(uri"/admin/projects", Header(AccessControlRequestMethod, "GET")))
.map(response =>
assertTrue(
response.code == StatusCode.Ok,
response.code.isSuccess,
response.header(AccessControlAllowOrigin).contains("http://example.com"),
response.header(AccessControlAllowMethods).exists(_.contains("GET")),
response.header(AccessControlAllowMethods).exists(_.contains("PUT")),
Expand All @@ -62,14 +62,13 @@ object CORSSupportE2ESpec extends E2EZSpec {
response.header(AccessControlAllowCredentials).contains("true"),
),
)

},
test("send `Access-Control-Allow-Origin` header when the Knora resource is found ") {
val resourceIri = "http://rdfh.ch/0001/55UrkgTKR2SEQgnsLWI9mg"
corsClient(_.get(uri"/v2/resources/$resourceIri"))
.map(response =>
assertTrue(
response.code == StatusCode.Ok,
response.code.isSuccess,
response.header(AccessControlAllowOrigin).contains("http://example.com"),
),
)
Expand Down
Loading