Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/deploy-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- api-internal
- sync-github
- sync-jira
- sync-ipraktikum
steps:
- name: Checkout repository
uses: actions/checkout@v5
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode/settings.json
.env
.env
.local/
51 changes: 51 additions & 0 deletions IPRAKTIKUM_LOCAL_ENVIRONMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Local iPraktikum acceptance environment

Provisioned on this machine on 2026-10-18. The stack uses the implementation branches in this checkout and the official ARM64 GitLab CE 19.5.0 image, pinned by digest. All published ports bind to 127.0.0.1. Its Docker Compose project, network, and named volumes are named `ipraktikum-local-test`; existing `gropius-production` containers and volumes are independent.

## Open and sign in

- Gropius: http://localhost:14200 (username `admin`).
- GitLab: http://localhost:18929 (username `root`).
- Monorepo: http://localhost:18929/root/ipraktikum-monorepo.
- GitLab board: http://localhost:18929/root/ipraktikum-monorepo/-/boards/1.
- Gropius project: http://localhost:14200/projects/bc6f6fcb-0055-494c-99dd-a08dfd6a2581.
- Gropius board: http://localhost:14200/projects/bc6f6fcb-0055-494c-99dd-a08dfd6a2581/boards/61118772-2c5e-4730-9f59-32eaa0e7c9b1.

Passwords are in `.local/ipraktikum/credentials.json`, readable only by the local file owner. This ignored directory also contains the Compose configuration, encrypted-token key, private development configuration, and disposable GitLab API token. Keep these local. The GitLab token expires 90 days after provisioning; it can be rotated using the GitLab token strategy's update action in Gropius.

This is a local development stack using the testing configuration's development keys and internal database credentials. The GitLab `root` account is linked to Gropius `admin` as the test sync identity. GitLab sign-ups are disabled. SMTP is not configured, HTTPS and Git-over-SSH are not provisioned, and no services are exposed to the LAN.

## Prepared cohort

Project **iPraktikum Local Test** has **Frontend** and **Backend** components and an **iPraktikum Issue** template:

- Types: Task, Bug.
- States: Ready, In Progress, Review, Testing, Done.
- Assignment roles: Implementer, Reviewer.
- Directed relation: Depends on / Required by; symmetric relation: Related / Related.
- Native assignee projects the Implementer role. Native generic relation projection is disabled.

Component labels use the configured aliases `component/frontend` and `component/backend`; internal component keys remain stable. Frontend uses a rectangular template and Backend a hexagonal template.

Ordinary labels (such as `UI`) synchronize additions and removals in both directions by exact name. New counterpart labels copy color and description; later changes to those attributes are not mirrored automatically.

Automatic bidirectional sync is enabled and polls every 15 seconds. GitHub/Jira adapters are absent from this stack. The GitLab board has `workflow/ready`, `workflow/doing`, and `workflow/review` lists, plus its built-in Open/Closed lists. Review and Testing share the review bucket; exact Gropius state survives unchanged labels. Done closes the GitLab issue. The Gropius board has all five individual states. New issues can be added to Gropius boards through the normal board UI; board membership itself is not synchronized.

Two sample issues demonstrate import/export, identity metadata, multi-component labels, typed assignments/relations and comment attribution. The generated YAML section in GitLab descriptions is editable. Component/vocabulary keys come from runtime discovery in the IMSProject setup panel. To inspect or change sync configuration, open **IMSs → Local GitLab → iPraktikum Monorepo → General**.

## Control the stack

From this repository:

```sh
./ipraktikum-local.sh # status
./ipraktikum-local.sh stop # stop, retaining all test data
./ipraktikum-local.sh up -d # start again
./ipraktikum-local.sh logs --tail 100 sync-ipraktikum
```

Docker Desktop must be running. Initial GitLab startup can take several minutes. Data persists in the stack's named volumes. Do not use `down --volumes` unless you intend to erase the entire disposable cohort and GitLab instance.

The local runtime images contain jars copied from this checkout's backend builds into `.local/ipraktikum/runtime/`. After Kotlin changes, rebuild the affected `:module:bootJar`, replace the corresponding `runtime/module.jar`, then run `./ipraktikum-local.sh up -d --build module`. For frontend/login changes use `./ipraktikum-local.sh up -d --build frontend login-service`. Building frontend/login services uses their normal repository Dockerfiles. The local Compose configuration and provisioning helpers are retained under `.local/ipraktikum/`; they contain machine-specific paths and are intentionally untracked.

Additional localhost debugging endpoints: public GraphQL 18080, internal GraphQL 18081, login service 13000, Neo4j HTTP 17474 and Bolt 17688. The internal GraphQL API uses the testing configuration's internal token. MongoDB/PostgreSQL have no published host ports.
44 changes: 44 additions & 0 deletions IPRAKTIKUM_TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# iPraktikum adapter testing handoff

Implemented on the local branch `feat/ipraktikum-issue-sync` in this deployment repository and all three submodules. The deployment commit pins the tested submodule commits. No production repository was connected or modified. The related pull requests in the deployment repository and all three submodules describe the integration and merge dependencies.

## What is ready

* `sync-ipraktikum`: repository-wide identity/enrollment, runtime component/template discovery, component labels, coarse/fine workflow states, typed assignments and directed relations, optional native assignee/generic-link projections, comments, persistent reconciliation receipts/outbox, conflict handling, and repair controls.
* Login service: `gitlab-token` account linking, current-user verification, numeric identities, encrypted PAT storage, and same-account token rotation.
* Frontend: runtime setup/status panel on the iPraktikum IMSProject General page. Defaults use discovered choices; advanced JSON supports grouped workflows, required-field defaults, primary selections, conflict resolutions, and recovery.
* Deployment: production and development Compose overlays that run the dedicated worker and exclude the GitHub/Jira workers by default.

## Checks completed locally

| Check | Result |
|---|---|
| Kotlin metadata/merge/workflow tests | 10 passed |
| Integration scenario with real isolated Neo4j/MongoDB and stateful GitLab HTTP fixture | Passed |
| GitLab credential encryption/linking/rotation and validation-failure tests | 3 passed |
| Runnable adapter JAR | Built |
| Login-service build and runtime module loading in credential tests | Passed |
| Frontend graph-editor build, Vue type check, production build | Passed |
| Both Compose overlay configurations | Valid |

The integration scenario exercises incoming/outgoing issue creation, unchanged-cycle idempotency, component labels, workflow moves, parallel assignment roles, explicit empty primary assignment, rich relation edits/removals, native generic-link deletion, human-owned comment corrections, and copied-identity rejection/adoption. Test containers were isolated from application data and removed after verification.

## Acceptance testing

A local self-hosted GitLab acceptance environment was exercised with bidirectional issue creation and edits, readable component labels, coarse/fine states, ordinary labels, comments, linked user display, and the issue editing controls. Its machine-local access details are recorded in [the local environment guide](IPRAKTIKUM_LOCAL_ENVIRONMENT.md). Repeat acceptance checks on the intended deployment with a disposable monorepo, test cohort, and bot PAT. Component IDs, issue vocabulary, and state/default mappings are supplied through runtime setup rather than deployment constants.

Follow the [adapter setup and testing guide](gropius-backend/sync-ipraktikum/README.md). Start with dry run, inspect the discovered vocabulary and proposed imports/exports, then enable writes. Check the native GitLab boards and permissions on this instance; the HTTP fixture cannot validate its UI or server-specific behavior.

Accepted constraints: shared cohort visibility, structured description editing, best-effort concurrency (students avoid concurrent edits), and one adapter per cohort. The initial worker performs complete scans suitable for a teaching cohort; it does not depend on webhook delivery. Architectural `affects` mapping, attachment mirroring, and complete historical impersonation are outside this implementation.

The production Compose overlay additionally requires the normal deployment secrets and a persistent `GROPIUS_GITLAB_TOKEN_ENCRYPTION_KEY`. Back up that key and the Neo4j integration records before using real cohort data.

### Linked user presentation

GitLab users are identified by their numeric ID within the IMS instance, and explicitly linked to a Gropius account. The frontend resolves that link when displaying authors, timeline actors, and assignees: it uses the linked Gropius name/avatar and retains the external account in the tooltip. Unlinked users keep their external profile. Historical items retain their original IMSUser reference, so later linking/unlinking takes effect without rewriting history or confusing user IDs in mutations.

Verify an existing imported GitLab comment displays the linked Gropius profile after refresh. Verify the tooltip still identifies the external account. The ordinary GitLab API attributes exported issues/comments to the configured token account; account linking does not impersonate users or rewrite GitLab's native author. Exported comments include a Gropius attribution footer.

The linked-user change passed frontend type checking and a production build.

The label mutation response regression script (`gropius-backend/api-public/scripts/check-label-response.mjs`) completed 100 consecutive add/remove checks against the local API without response-loading errors. The priority picker was verified with an unset priority and an empty priority vocabulary. The Affects picker was verified to list the cohort project, its Frontend/Backend components, and their versions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ To execute the github sync use:
docker compose -f docker-compose-testing.yaml up github
```

### iPraktikum GitLab sync

The dedicated GitLab Free monorepo adapter has production and development Compose overlays:

```sh
docker compose -f docker-compose.yaml -f docker-compose-ipraktikum.yaml up --build -d
# Or, with the development setup:
docker compose -f docker-compose-testing.yaml -f docker-compose-ipraktikum-testing.yaml up --build -d
```

Set a persistent `GROPIUS_GITLAB_TOKEN_ENCRYPTION_KEY` before starting. The overlays disable the GitHub/Jira workers by default. Configure the cohort through the iPraktikum IMSProject panel; components and issue vocabularies are discovered at runtime. See the [adapter setup and testing guide](gropius-backend/sync-ipraktikum/README.md).

### Volumes

Data is persisted in volumes.
Expand Down
29 changes: 29 additions & 0 deletions docker-compose-ipraktikum-testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Layer over docker-compose-testing.yaml. Uses that setup's development credentials.
services:
sync-github:
profiles: [traditional-sync]
sync-jira:
profiles: [traditional-sync]
login-service:
environment:
GROPIUS_GITLAB_TOKEN_ENCRYPTION_KEY: ${GROPIUS_GITLAB_TOKEN_ENCRYPTION_KEY:?Set a persistent base64-encoded 32-byte encryption key}
sync-ipraktikum:
build:
context: ./gropius-backend
args:
module: sync-ipraktikum
depends_on: [neo4j, mongo, login-service]
environment:
SPRING_NEO4J_URI: bolt://neo4j:7687
SPRING_MONGODB_HOST: mongo
SPRING_MONGODB_PORT: 27017
SPRING_MONGODB_DATABASE: gropius
SPRING_MONGODB_USERNAME: root
SPRING_MONGODB_PASSWORD: root
GROPIUS_SYNC_LOGIN_SERVICE_BASE: http://login-service:3000/
GROPIUS_SYNC_API_SECRET: TODO_loginSecret
healthcheck:
test: wget -qO - http://localhost:8080/health || exit 1
interval: 10s
timeout: 10s
retries: 20
32 changes: 32 additions & 0 deletions docker-compose-ipraktikum.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Layer over docker-compose.yaml for the dedicated iPraktikum deployment.
services:
sync-github:
profiles: [traditional-sync]
sync-jira:
profiles: [traditional-sync]
login-service:
environment:
GROPIUS_GITLAB_TOKEN_ENCRYPTION_KEY: ${GROPIUS_GITLAB_TOKEN_ENCRYPTION_KEY:?Set a persistent base64-encoded 32-byte encryption key}
sync-ipraktikum:
build:
context: ./gropius-backend
args:
module: sync-ipraktikum
restart: unless-stopped
depends_on: [neo4j, mongo, login-service]
environment:
SPRING_NEO4J_URI: bolt://neo4j:7687
SPRING_NEO4J_AUTHENTICATION_USERNAME: neo4j
SPRING_NEO4J_AUTHENTICATION_PASSWORD: ${GROPIUS_NEO4J_PASSWORD}
SPRING_MONGODB_HOST: mongo
SPRING_MONGODB_PORT: 27017
SPRING_MONGODB_DATABASE: gropius
SPRING_MONGODB_USERNAME: root
SPRING_MONGODB_PASSWORD: ${GROPIUS_MONGO_PASSWORD}
GROPIUS_SYNC_LOGIN_SERVICE_BASE: http://login-service:3000/
GROPIUS_SYNC_API_SECRET: ${GROPIUS_SYNC_API_SECRET}
healthcheck:
test: wget -qO - http://localhost:8080/health || exit 1
interval: 10s
timeout: 10s
retries: 20
2 changes: 1 addition & 1 deletion gropius-backend
11 changes: 11 additions & 0 deletions ipraktikum-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
# Operates only on this machine's isolated, already-provisioned test stack.
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
config="$root/.local/ipraktikum/compose.json"
if [ ! -f "$config" ]; then
echo 'Local test stack has not been provisioned on this machine.' >&2
exit 1
fi
if [ "$#" -eq 0 ]; then set -- ps; fi
exec docker compose -p ipraktikum-local-test -f "$config" "$@"
Loading