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
17 changes: 12 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v7.0.1

- name: Set up the JDK
uses: actions/setup-java@v6.3.0
with:
java-version: '21'
distribution: 'temurin'
cache: maven

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4.39.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -64,8 +71,8 @@ jobs:
# uses a compiled language

- run: |
mvn -f pom-first.xml clean install
mvn clean install
./mvnw -B -V -f pom-first.xml clean install
./mvnw -B -V clean install

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4.39.5
44 changes: 0 additions & 44 deletions .github/workflows/pull-request-build-openjdk11.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/pull-request-build-openjdk17.yml

This file was deleted.

26 changes: 22 additions & 4 deletions .github/workflows/pull-request-build-openjdk21.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,33 @@ jobs:
pull-requests: read
timeout-minutes: 130
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up the JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Apache Maven
run: mvn -f pom-first.xml -U clean install && mvn clean install
- name: Build the target platform and generate the manifests
run: ./mvnw -B -V -U -f pom-first.xml clean install
# The SWTBot UI tests need a display and a window manager (without one, closed dialogs
# leave no active shell), so the build runs in a virtual X server with metacity.
- name: Install a window manager for the UI tests
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends metacity dbus
- name: Build and run all tests, including the UI tests
run: >-
xvfb-run -a -s "-screen 0 1920x1200x24"
dbus-run-session --
sh -c 'metacity --sm-disable --replace & sleep 2; exec ./mvnw -B -V clean install -Denable-ui-tests'
- name: Upload test reports and UI test screenshots
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-results-openjdk21
path: |
**/target/surefire-reports/
tests/test.integration.ui/screenshots/
if-no-files-found: ignore
env:
MAVEN_OPTS: "-Xmx1024M"

62 changes: 62 additions & 0 deletions .github/workflows/pull-request-build-openjdk25.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Build with OpenJDK 25"

on:
pull_request:
branches: ['master']

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
timeout-minutes: 130
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up the JDK
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
java-version: '25'
distribution: 'temurin'
cache: maven
- name: Build the target platform and generate the manifests
run: ./mvnw -B -V -U -f pom-first.xml clean install
# The SWTBot UI tests need a display and a window manager (without one, closed dialogs
# leave no active shell), so the build runs in a virtual X server with metacity.
- name: Install a window manager for the UI tests
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends metacity dbus
- name: Build and run all tests, including the UI tests
run: >-
xvfb-run -a -s "-screen 0 1920x1200x24"
dbus-run-session --
sh -c 'metacity --sm-disable --replace & sleep 2; exec ./mvnw -B -V clean install -Denable-ui-tests'
- name: Upload test reports and UI test screenshots
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-results-openjdk25
path: |
**/target/surefire-reports/
tests/test.integration.ui/screenshots/
if-no-files-found: ignore
env:
MAVEN_OPTS: "-Xmx1024M"

8 changes: 4 additions & 4 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v3.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 #tag=2.3.1
uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -64,14 +64,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # tag=v4.3.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@cdcdbb579706841c47f7063dda365e292e5cad7a #tag=v2
uses: github/codeql-action/upload-sarif@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
sarif_file: results.sarif
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.settings
.pmd
target/
.tycho-consumer-pom.xml
META-INF/
eclipse-trgt-platform/org.apache.directory.studio.eclipse-trgt-platform.target
plugins/ldapbrowser.core/lib/
Expand Down
22 changes: 22 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# Maven 3.10.x (Resolver 2.0) cannot resolve the dependencies of the Tycho 5.0.4 bundles
# ("Invalid Collect Request: null"), so the build stays on the latest Maven 3.9.x.
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
distributionSha256Sum=5af3b743dd8b876b5c45da33b676251e5f1687712644abb4ee519ca56e1d89ce
55 changes: 24 additions & 31 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pipeline {
}
steps {
script {
inTestLab('jdk-11', { sh 'export DISPLAY=:99; env; ps aux' })
inTestLab({ sh 'env; ps aux' })
}
}
post {
Expand All @@ -48,7 +48,7 @@ pipeline {
}
stage ('Build and Test') {
parallel {
stage ('Linux Java 11') {
stage ('Linux Java 21') {
options {
timeout(time: 4, unit: 'HOURS')
retry(2)
Expand All @@ -58,7 +58,14 @@ pipeline {
}
steps {
script {
inTestLab('jdk-11', { sh 'export DISPLAY=:99; mvn -V -U -f pom-first.xml clean install && mvn -V clean install -Dorg.eclipse.swtbot.search.timeout=20000 -Denable-ui-tests' })
// The Jenkins user has no home directory in the build image, so point HOME and the JVMs'
// user.home to a writable directory. The UI tests need a window manager: run them on a
// private Xvfb display with metacity.
inTestLab({ sh '''
export HOME=/tmp/home JAVA_TOOL_OPTIONS=-Duser.home=/tmp/home
./mvnw -B -V -U -f pom-first.xml clean install
xvfb-run -a -s "-screen 0 1920x1200x24" dbus-run-session -- sh -c 'metacity --sm-disable --replace & sleep 2; exec ./mvnw -B -V clean install -Dorg.eclipse.swtbot.search.timeout=20000 -Denable-ui-tests'
''' })
}
}
post {
Expand All @@ -69,28 +76,7 @@ pipeline {
}
}
}
stage ('Linux Java 17') {
options {
timeout(time: 4, unit: 'HOURS')
retry(2)
}
agent {
label 'ubuntu'
}
steps {
script {
inTestLab('jdk-17', { sh 'export DISPLAY=:99; mvn -V -U -f pom-first.xml clean install && mvn -V clean install -Dorg.eclipse.swtbot.search.timeout=20000 -Denable-ui-tests' })
}
}
post {
always {
junit '**/target/surefire-reports/*.xml'
archiveArtifacts artifacts:'tests/test.integration.ui/screenshots/*', allowEmptyArchive:true
deleteDir()
}
}
}
stage ('Windows Java 11') {
stage ('Windows Java 21') {
options {
timeout(time: 4, unit: 'HOURS')
retry(2)
Expand All @@ -101,10 +87,10 @@ pipeline {
steps {
bat '''
rmdir /S /Q F:\\hudson\\m2_repository\\p2\\osgi\\bundle\\org.apache.directory.api.ldap.model
set JAVA_HOME=F:\\jenkins\\tools\\java\\latest11
set JAVA_HOME=F:\\jenkins\\tools\\java\\latest21
set MAVEN_OPTS="-Xmx512m"
call F:\\jenkins\\tools\\maven\\latest3\\bin\\mvn -V -U -f pom-first.xml clean install
call F:\\jenkins\\tools\\maven\\latest3\\bin\\mvn -V clean install -Dorg.eclipse.swtbot.search.timeout=20000 -Denable-ui-tests
call mvnw.cmd -V -U -f pom-first.xml clean install
call mvnw.cmd -V clean install -Dorg.eclipse.swtbot.search.timeout=20000 -Denable-ui-tests
'''
}
post {
Expand Down Expand Up @@ -132,11 +118,18 @@ pipeline {
}
}

def inTestLab(String dockerImageTag, Closure action){
def inTestLab(Closure action){
def buildImage = docker.build('directory-studio-build', 'tools/testlab/build-image')
docker.image('coheigea/kerby').withRun('-h kerby.example.com -v $(pwd)/tools/testlab/kerby-data:/kerby-data') { kerby ->
docker.image('osixia/openldap:1.5.0').withRun('-h openldap.example.com -v $(pwd)/tools/testlab/ldap.keytab:/etc/krb5.keytab -v $(pwd)/tools/testlab/krb5.conf:/etc/krb5.conf -e LDAP_TLS_VERIFY_CLIENT=never') { openldap ->
docker.image('389ds/dirsrv:2.2').withRun('-h fedora389ds.example.com -v $(pwd)/tools/testlab/ldap.keytab:/etc/krb5.keytab -v $(pwd)/tools/testlab/krb5.conf:/etc/krb5.conf -e DS_DM_PASSWORD=admin', 'bash -c "zypper install -y cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapi; set -m; /usr/lib/dirsrv/dscontainer -r & while ! /usr/lib/dirsrv/dscontainer -H; do sleep 5; done; sleep 5; /usr/sbin/dsconf localhost backend create --suffix dc=example,dc=org --be-name example; fg"') { fedora389ds ->
docker.image("apachedirectory/maven-build:${dockerImageTag}").inside("-v ${env.WORKSPACE}/tools/testlab/krb5.conf:/etc/krb5.conf --link=${kerby.id}:kerby.example.com --link=${openldap.id}:openldap.example.com -e OPENLDAP_HOST=openldap.example.com -e OPENLDAP_PORT=389 -e OPENLDAP_PORT_SSL=636 --link=${fedora389ds.id}:fedora389ds.example.com -e FEDORA_389DS_HOST=fedora389ds.example.com -e FEDORA_389DS_PORT=3389 -e FEDORA_389DS_PORT_SSL=3636") {
// The 389ds image lacks the DIGEST-MD5 and GSSAPI SASL plugins, so they are installed at start.
// openSUSE rotated its signing key in 2026; import the current key first, otherwise zypper skips
// every repository and the SASL tests against 389ds fail. The plugins pull in current glibc and
// OpenSSL 3, whose files conflict with OpenSSL 1.1 in this older image, hence --replacefiles.
// 389ds stays on 2.2: 2.4 and later return noSuchObject instead of a referral for entries below
// a referral entry, which breaks the referral tests.
docker.image('389ds/dirsrv:2.2').withRun('-h fedora389ds.example.com -v $(pwd)/tools/testlab/ldap.keytab:/etc/krb5.keytab -v $(pwd)/tools/testlab/krb5.conf:/etc/krb5.conf -e DS_DM_PASSWORD=admin', 'bash -c "rpm --import https://download.opensuse.org/tumbleweed/repo/oss/repodata/repomd.xml.key; zypper --non-interactive install --no-recommends --replacefiles cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapi; set -m; /usr/lib/dirsrv/dscontainer -r & while ! /usr/lib/dirsrv/dscontainer -H; do sleep 5; done; sleep 5; /usr/sbin/dsconf localhost backend create --suffix dc=example,dc=org --be-name example; fg"') { fedora389ds ->
buildImage.inside("-v ${env.WORKSPACE}/tools/testlab/krb5.conf:/etc/krb5.conf --link=${kerby.id}:kerby.example.com --link=${openldap.id}:openldap.example.com -e OPENLDAP_HOST=openldap.example.com -e OPENLDAP_PORT=389 -e OPENLDAP_PORT_SSL=636 --link=${fedora389ds.id}:fedora389ds.example.com -e FEDORA_389DS_HOST=fedora389ds.example.com -e FEDORA_389DS_PORT=3389 -e FEDORA_389DS_PORT_SSL=3636") {
action()
}
}
Expand Down
Loading