Skip to content

Commit 0fea1de

Browse files
committed
Merge branch 'dtq-dev' into customer/lindat
2 parents 91c1161 + b6729d5 commit 0fea1de

714 files changed

Lines changed: 27315 additions & 11019 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# Copilot Instructions for CLARIN-DSpace Repository
2+
3+
## Repository Overview
4+
5+
This repository contains **CLARIN-DSpace**, an institutional repository backend built on **DSpace v7**. It is a Java-based web application that provides REST APIs and services for digital library management. The system is designed for academic and research institutions to store, organize, and provide access to digital resources.
6+
7+
**Key Technologies:**
8+
- **Language:** Java 11+ (currently Java 17 compatible)
9+
- **Build System:** Apache Maven 3.x
10+
- **Framework:** Spring Boot, Spring MVC, Spring HATEOAS
11+
- **Testing:** JUnit, Maven Surefire (unit tests) and Failsafe (integration tests)
12+
- **Database:** PostgreSQL with pgcrypto extension
13+
- **Search:** Apache Solr 8.x
14+
- **Container Support:** Docker and Docker Compose
15+
16+
**Repository Size:** ~32MB source code with 13 Maven modules, extensive test suite, and Docker configurations.
17+
18+
## Critical Build Information
19+
20+
### 📦 Handle Server Dependency
21+
The repository has a **dependency on `handle.net` Maven repository** (`https://handle.net/maven`) for the Handle Server library (`net.handle:handle:jar:9.3.0`). This dependency is typically resolved without issues when proper network access is configured.
22+
23+
**Note:** If you encounter DNS resolution errors for `handle.net`, this indicates network connectivity restrictions that may need to be configured in your environment's allowlist.
24+
25+
### Build Commands
26+
27+
**Basic Build (Skip Tests):**
28+
```bash
29+
MAVEN_OPTS="-Xmx1024M" mvn clean install -DskipTests=true --no-transfer-progress -P-assembly
30+
```
31+
32+
**Full Build with Tests:**
33+
```bash
34+
MAVEN_OPTS="-Xmx1024M" mvn clean install -DskipUnitTests=false -DskipIntegrationTests=false -P-assembly
35+
```
36+
37+
**Required Memory Settings:**
38+
- Always use `MAVEN_OPTS="-Xmx1024M"` for sufficient heap memory
39+
- Use `--no-transfer-progress` to reduce log verbosity
40+
41+
## Testing Procedures
42+
43+
### Unit Tests
44+
```bash
45+
mvn test -DskipUnitTests=false -Dtest.argLine=-Xmx1024m -DsurefireJacoco=-XX:MaxPermSize=256m
46+
```
47+
48+
### Integration Tests
49+
```bash
50+
mvn install -DskipIntegrationTests=false -Dtest.argLine=-Xmx1024m -DfailsafeJacoco=-XX:MaxPermSize=256m -Dcheckstyle.skip=true -Dlicense.skip=true
51+
```
52+
53+
### Single Test Execution
54+
```bash
55+
# Single unit test class
56+
mvn test -DskipUnitTests=false -Dtest=[full.package.testClassName] -DfailIfNoTests=false
57+
58+
# Single integration test
59+
mvn install -DskipIntegrationTests=false -Dit.test=[full.package.testClassName] -DfailIfNoTests=false -Dcheckstyle.skip -Dlicense.skip
60+
```
61+
62+
### Test Module Isolation
63+
Before running tests in a specific module, install dependencies:
64+
```bash
65+
mvn clean install -DskipTests=true
66+
cd [module-directory]
67+
# Run module-specific tests
68+
```
69+
70+
## Code Quality and Validation
71+
72+
### Checkstyle (Works Reliably)
73+
```bash
74+
# Check entire project
75+
mvn checkstyle:check --no-transfer-progress
76+
77+
# Check specific module
78+
mvn checkstyle:check -f [module]/pom.xml --no-transfer-progress
79+
```
80+
81+
**Checkstyle Rules:**
82+
- 4-space indents for Java, 2-space for XML (NO TABS)
83+
- K&R style braces on all blocks
84+
- No wildcard imports
85+
- Maximum 120 character line length
86+
- Javadocs required for public classes/methods
87+
- No trailing spaces (except comments)
88+
89+
### License Header Validation
90+
```bash
91+
mvn license:check --no-transfer-progress
92+
```
93+
94+
### Pre-commit Hooks
95+
The repository uses pre-commit hooks with checkstyle validation:
96+
```bash
97+
# Install pre-commit (if available)
98+
pip install pre-commit
99+
pre-commit install
100+
```
101+
102+
## Docker Alternative
103+
104+
Docker provides an alternative build approach and development environment:
105+
106+
```bash
107+
# Dependencies image (pre-caches Maven dependencies)
108+
docker build -t dspace/dspace-dependencies:dspace-7_x -f Dockerfile.dependencies .
109+
110+
# Test image (includes both DSpace 7 REST API and legacy v6 API)
111+
docker build -t dspace/dspace:dspace-7_x-test -f Dockerfile.test .
112+
113+
# Production image
114+
docker build -t dspace/dspace:dspace-7_x -f Dockerfile .
115+
```
116+
117+
**Docker Compose for Development:**
118+
```bash
119+
docker compose -f docker-compose.yml up -d
120+
```
121+
122+
## Project Layout and Architecture
123+
124+
### Module Structure
125+
```
126+
/ # Root with main pom.xml
127+
├── dspace-parent/ # Parent POM configuration
128+
├── dspace-services/ # Core services framework
129+
├── dspace-api/ # Main API and business logic
130+
├── dspace/ # Assembly and configuration
131+
├── dspace-server-webapp/ # Spring Boot REST API webapp
132+
├── dspace-iiif/ # IIIF integration
133+
├── dspace-oai/ # OAI-PMH protocol support
134+
├── dspace-rdf/ # RDF/Linked Data support
135+
├── dspace-sword/ # SWORD protocol v1
136+
├── dspace-swordv2/ # SWORD protocol v2
137+
└── scripts/ # Build and utility scripts
138+
```
139+
140+
### Key Configuration Files
141+
- `pom.xml` - Main Maven configuration with Java 11 target
142+
- `checkstyle.xml` - Code style rules and validation
143+
- `checkstyle-suppressions.xml` - Style rule exceptions
144+
- `.pre-commit-config.yaml` - Pre-commit hook configuration
145+
- `docker-compose.yml` - Development environment setup
146+
147+
### Main Source Directories
148+
- `dspace-server-webapp/src/main/java/org/dspace/app/rest/` - REST API controllers
149+
- `dspace-api/src/main/java/org/dspace/` - Core business logic
150+
- `dspace/config/` - DSpace configuration files
151+
- `dspace/solr/` - Solr search configuration
152+
153+
## CI/CD Pipeline (.github/workflows/)
154+
155+
**Primary Build Workflow:** `.github/workflows/build.yml`
156+
- Runs on Java 11 with matrix strategy for unit and integration tests
157+
- Uses `MAVEN_OPTS="-Xmx1024M"`
158+
- Separate jobs for unit tests and integration tests
159+
- Includes code coverage reporting
160+
- **Triggered on:** pushes to `clarin-v7` and `customer/*` branches, plus all PRs
161+
162+
**Test Execution in CI:**
163+
- Unit Tests: `mvn install -DskipUnitTests=false -Pdspace-rest -Dsurefire.rerunFailingTestsCount=2`
164+
- Integration Tests: `mvn install -DskipIntegrationTests=false -Denforcer.skip=true -Dcheckstyle.skip=true -Dlicense.skip=true -Dxml.skip=true -Dfailsafe.rerunFailingTestsCount=2`
165+
166+
## Essential Commands Reference
167+
168+
**Clean Build (Most Reliable):**
169+
```bash
170+
mvn clean install -DskipTests=true --no-transfer-progress -P-assembly
171+
```
172+
173+
**Code Quality Check:**
174+
```bash
175+
mvn checkstyle:check license:check --no-transfer-progress
176+
```
177+
178+
**Resume Failed Build (After fixing issues):**
179+
```bash
180+
mvn <args> -rf :dspace-api # Resume from dspace-api module
181+
```
182+
183+
**Debug Build Issues:**
184+
```bash
185+
mvn <command> -X # Enable debug logging
186+
mvn <command> -e # Show full stack traces
187+
```
188+
189+
## Development Workflow
190+
191+
1. **Start with code quality checks** - run checkstyle independently: `mvn checkstyle:check`
192+
2. **Use incremental builds** - test changes in specific modules before full builds
193+
3. **Leverage CI/CD pipeline** - view GitHub Actions results for comprehensive validation
194+
4. **Docker development** - use Docker Compose for isolated development environments
195+
5. **Module-specific testing** - run tests in individual modules after dependency installation
196+
197+
## Trust These Instructions
198+
199+
These instructions are comprehensive and current as of DSpace 7.6.1. Only search for additional information if:
200+
- You encounter errors not mentioned here
201+
- You need specific configuration details not covered
202+
- You require advanced configuration or deployment procedures beyond basic development
203+
204+
All build commands and procedures have been validated in the current environment. Maven builds should complete successfully with proper network access to dependency repositories.

.github/dependabot.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#-------------------
2+
# DSpace's dependabot rules. Enables maven updates for all dependencies on a weekly basis
3+
# for main and any maintenance branches. Security updates only apply to main.
4+
#-------------------
5+
version: 2
6+
updates:
7+
- package-ecosystem: "maven"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
# Allow up to 10 open PRs for dependencies
12+
open-pull-requests-limit: 10
13+
# Group together some upgrades in a single PR
14+
groups:
15+
# Group together all Build Tools in a single PR
16+
build-tools:
17+
applies-to: version-updates
18+
patterns:
19+
- "org.apache.maven.plugins:*"
20+
- "*:*-maven-plugin"
21+
- "*:maven-*-plugin"
22+
- "com.github.spotbugs:spotbugs"
23+
- "com.google.code.findbugs:*"
24+
- "com.google.errorprone:*"
25+
- "com.puppycrawl.tools:checkstyle"
26+
- "org.sonatype.plugins:*"
27+
exclude-patterns:
28+
# Exclude anything from Spring, as that is in a separate group
29+
- "org.springframework.*:*"
30+
update-types:
31+
- "minor"
32+
- "patch"
33+
test-tools:
34+
applies-to: version-updates
35+
patterns:
36+
- "junit:*"
37+
- "com.github.stefanbirker:system-rules"
38+
- "com.h2database:*"
39+
- "io.findify:s3mock*"
40+
- "io.netty:*"
41+
- "org.hamcrest:*"
42+
- "org.mock-server:*"
43+
- "org.mockito:*"
44+
update-types:
45+
- "minor"
46+
- "patch"
47+
# Group together all Apache Commons deps in a single PR
48+
apache-commons:
49+
applies-to: version-updates
50+
patterns:
51+
- "org.apache.commons:*"
52+
- "commons-*:commons-*"
53+
update-types:
54+
- "minor"
55+
- "patch"
56+
# Group together all fasterxml deps in a single PR
57+
fasterxml:
58+
applies-to: version-updates
59+
patterns:
60+
- "com.fasterxml:*"
61+
- "com.fasterxml.*:*"
62+
update-types:
63+
- "minor"
64+
- "patch"
65+
# Group together all Hibernate deps in a single PR
66+
hibernate:
67+
applies-to: version-updates
68+
patterns:
69+
- "org.hibernate.*:*"
70+
update-types:
71+
- "minor"
72+
- "patch"
73+
# Group together all Jakarta deps in a single PR
74+
jakarta:
75+
applies-to: version-updates
76+
patterns:
77+
- "jakarta.*:*"
78+
- "org.eclipse.angus:jakarta.mail"
79+
- "org.glassfish.jaxb:jaxb-runtime"
80+
update-types:
81+
- "minor"
82+
- "patch"
83+
# Group together all Google deps in a single PR
84+
google-apis:
85+
applies-to: version-updates
86+
patterns:
87+
- "com.google.apis:*"
88+
- "com.google.api-client:*"
89+
- "com.google.http-client:*"
90+
- "com.google.oauth-client:*"
91+
update-types:
92+
- "minor"
93+
- "patch"
94+
# Group together all Spring deps in a single PR
95+
spring:
96+
applies-to: version-updates
97+
patterns:
98+
- "org.springframework:*"
99+
- "org.springframework.*:*"
100+
update-types:
101+
- "minor"
102+
- "patch"
103+
# Group together all WebJARs deps in a single PR
104+
webjars:
105+
applies-to: version-updates
106+
patterns:
107+
- "org.webjars:*"
108+
- "org.webjars.*:*"
109+
update-types:
110+
- "minor"
111+
- "patch"
112+
ignore:
113+
# Don't try to auto-update any DSpace dependencies
114+
- dependency-name: "org.dspace:*"
115+
- dependency-name: "org.dspace.*:*"
116+
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
117+
- dependency-name: "*"
118+
update-types: ["version-update:semver-major"]

.github/issue_template.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Problem Description
2+
3+
---
4+
5+
6+
## Steps to Reproduce Problem
7+
8+
9+
---
10+
11+
12+
## Additional Info
13+
(Logs, screenshots, configuration, etc.)
14+
15+
---
16+
17+
## Pre-check
18+
- [ ] Confirmed in upstream
19+
- [ ] Verified that it’s not already fixed or being worked on?
20+
21+
---
22+
23+
## Workflow
24+
- [ ] Replicate the issue.
25+
- [ ] Explore possible solutions and estimate the required time.
26+
- [ ] Write a test or include it in manual testing scenarios.
27+
- [ ] Code to pass the tests.
28+
- [ ] Refactor and review.
29+
- [ ] Update documentation.
30+
31+
---
32+

.github/pull_request_template.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
| Phases | MP | MM | MB | MR | JM | Total |
2-
|-----------------|----:|----:|----:|-----:|-----:|-------:|
3-
| ETA | 0 | 0 | 0 | 0 | 0 | 0 |
4-
| Developing | 0 | 0 | 0 | 0 | 0 | 0 |
5-
| Review | 0 | 0 | 0 | 0 | 0 | 0 |
6-
| Total | - | - | - | - | - | 0 |
7-
| ETA est. | | | | | | 0 |
8-
| ETA cust. | - | - | - | - | - | 0 |
91
## Problem description
10-
### Reported issues
11-
### Not-reported issues
2+
123
## Analysis
134
(Write here, if there is needed describe some specific problem. Erase it, when it is not needed.)
145
## Problems
156
(Write here, if some unexpected problems occur during solving issues. Erase it, when it is not needed.)
7+
8+
### Manual Testing (if applicable)
9+
- [ ] Added to [testing scenarios](https://github.com/dataquest-dev/dspace-customers/issues/55)
10+
11+
### Copilot review
12+
- [ ] Requested review from Copilot

0 commit comments

Comments
 (0)