Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ci errors 2025.01.0 #4347

Merged
merged 17 commits into from
Feb 17, 2025
Merged
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
2 changes: 1 addition & 1 deletion .github/actions/test-gradle-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
shell: bash
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4JVERSION -Pneo4jDockerEeOverride=$NEO4J_DOCKER_EE_OVERRIDE -Pneo4jDockerCeOverride=$NEO4J_DOCKER_CE_OVERRIDE :${{inputs.project-name}}:check --parallel
- name: Archive test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{inputs.project-name}}-test-results
Expand Down
70 changes: 42 additions & 28 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ "2025.01" ]

env:
CODEARTIFACT_DOWNLOAD_URL: ${{ secrets.CODEARTIFACT_DOWNLOAD_URL }}
CODEARTIFACT_BUILD_SERVICE_LIVE_URL: ${{ secrets.CODEARTIFACT_BUILD_SERVICE_LIVE_URL }}
CODEARTIFACT_USERNAME: ${{ secrets.CODEARTIFACT_USERNAME }}
ECR_NEO4J_DOCKER_URL: ${{ secrets.ECR_NEO4J_DOCKER_URL }}
BRANCH_NAME: ${{ github.event.pull_request.base.ref }}
Expand Down Expand Up @@ -45,41 +45,48 @@ jobs:
- uses: ./.github/actions/setup-jdk
- uses: ./.github/actions/setup-gradle-cache

- name: Determine latest neo4j CI version and docker images
- name: Determine CODEARTIFACT_DOWNLOAD_URL, NEO4JVERSION and Docker Image environment variables
run: |
echo "Current branch BRANCH_NAME=$BRANCH_NAME"
neo4j_version_base=$(grep -e "neo4jVersion = .*" build.gradle | cut -d '=' -f 2 | tr -d \'\" | tr -d ' ')
echo "neo4j_version_base=$neo4j_version_base"
NEO4JVERSION=`aws codeartifact list-package-versions --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --repository ci-live --format maven --namespace org.neo4j --package neo4j --sort-by PUBLISHED_TIME --query "versions[?starts_with(version,'$neo4j_version_base')] | [0].version" | tr -d '" '`
echo "NEO4JVERSION=$NEO4JVERSION" >> "$GITHUB_ENV"
echo "Found NEO4JVERSION=$NEO4JVERSION"
if [[ $BRANCH_NAME =~ ^5.[0-9]+$ ]]; then
NEO4J_DOCKER_EE_OVERRIDE="neo4j:$neo4j_version_base-enterprise"
NEO4J_DOCKER_CE_OVERRIDE="neo4j:$neo4j_version_base"
else
if [[ $BRANCH_NAME == "dev" ]]; then
echo "Running on dev branch and so pointing to ci-live repository in AWS CodeArtifact for CI artifacts"
CODEARTIFACT_DOWNLOAD_URL="$CODEARTIFACT_BUILD_SERVICE_LIVE_URL/maven/ci-live"
NEO4JVERSION=`aws --no-cli-pager codeartifact list-package-versions --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --repository ci-live --format maven --namespace org.neo4j --package neo4j --sort-by PUBLISHED_TIME --status Published --query "versions[?starts_with(version, '$neo4j_version_base')].version | [0]" --output json | sed 's/"//g'`
NEO4J_DOCKER_CE_OVERRIDE="$ECR_NEO4J_DOCKER_URL:$neo4j_version_base-community-debian-nightly"
NEO4J_DOCKER_EE_OVERRIDE="$ECR_NEO4J_DOCKER_URL:$neo4j_version_base-enterprise-debian-nightly"
else
echo "Running on branch $BRANCH_NAME and so pointing to release-live repository in AWS CodeArtifact for release artifacts"
CODEARTIFACT_DOWNLOAD_URL="$CODEARTIFACT_BUILD_SERVICE_LIVE_URL/maven/release-live"
NEO4JVERSION=$neo4j_version_base
NEO4J_DOCKER_CE_OVERRIDE="neo4j:$neo4j_version_base"
NEO4J_DOCKER_EE_OVERRIDE="neo4j:$neo4j_version_base-enterprise"
fi
echo "NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE" >> "$GITHUB_ENV"
echo "CODEARTIFACT_DOWNLOAD_URL=$CODEARTIFACT_DOWNLOAD_URL" >> "$GITHUB_ENV"

echo "Found NEO4JVERSION=$NEO4JVERSION"
echo "Found NEO4J_DOCKER_CE_OVERRIDE=$NEO4J_DOCKER_CE_OVERRIDE"
echo "Found NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE"

echo "NEO4JVERSION=$NEO4JVERSION" >> "$GITHUB_ENV"
echo "NEO4J_DOCKER_CE_OVERRIDE=$NEO4J_DOCKER_CE_OVERRIDE" >> "$GITHUB_ENV"
echo "Found NEO4J_DOCKER_CE_OVERRIDE=$NEO4J_DOCKER_CE_OVERRIDE"
echo "Current branch BRANCH_NAME=$BRANCH_NAME"
echo "NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE" >> "$GITHUB_ENV"

- name: Compile Java
run: |
chmod +x gradlew
./gradlew --no-daemon --info -Pneo4jVersionOverride=$NEO4JVERSION --init-script init.gradle clean
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3.28.8
with:
languages: ${{ matrix.language }}

- name: Compile
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4JVERSION compileJava compileTestJava

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3.28.8
with:
category: "/language:${{matrix.language}}"

Expand Down Expand Up @@ -120,25 +127,32 @@ jobs:
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}

- name: Determine latest neo4j CI version and docker images
- name: Determine CODEARTIFACT_DOWNLOAD_URL, NEO4JVERSION and Docker Image environment variables
run: |
echo "Current branch BRANCH_NAME=$BRANCH_NAME"
neo4j_version_base=$(grep -e "neo4jVersion = .*" build.gradle | cut -d '=' -f 2 | tr -d \'\" | tr -d ' ')
echo "neo4j_version_base=$neo4j_version_base"
NEO4JVERSION=`aws codeartifact list-package-versions --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --repository ci-live --format maven --namespace org.neo4j --package neo4j --sort-by PUBLISHED_TIME --query "versions[?starts_with(version,'$neo4j_version_base')] | [0].version" | tr -d '" '`
echo "NEO4JVERSION=$NEO4JVERSION" >> "$GITHUB_ENV"
echo "Found NEO4JVERSION=$NEO4JVERSION"
if [[ $BRANCH_NAME =~ ^5.[0-9]+$ ]]; then
NEO4J_DOCKER_EE_OVERRIDE="neo4j:$neo4j_version_base-enterprise"
NEO4J_DOCKER_CE_OVERRIDE="neo4j:$neo4j_version_base"
if [[ $BRANCH_NAME == "dev" ]]; then
echo "Running on dev branch and so pointing to ci-live repository in AWS CodeArtifact for CI artifacts"
CODEARTIFACT_DOWNLOAD_URL="$CODEARTIFACT_BUILD_SERVICE_LIVE_URL/maven/ci-live"
NEO4JVERSION=`aws --no-cli-pager codeartifact list-package-versions --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --repository ci-live --format maven --namespace org.neo4j --package neo4j --sort-by PUBLISHED_TIME --status Published --query "versions[?starts_with(version, '$neo4j_version_base')].version | [0]" --output json | sed 's/"//g'`
NEO4J_DOCKER_CE_OVERRIDE="$ECR_NEO4J_DOCKER_URL:$neo4j_version_base-community-debian-nightly"
NEO4J_DOCKER_EE_OVERRIDE="$ECR_NEO4J_DOCKER_URL:$neo4j_version_base-enterprise-debian-nightly"
else
NEO4J_DOCKER_CE_OVERRIDE="$ECR_NEO4J_DOCKER_URL/build-service/neo4j:$neo4j_version_base-community-debian-nightly"
NEO4J_DOCKER_EE_OVERRIDE="$ECR_NEO4J_DOCKER_URL/build-service/neo4j:$neo4j_version_base-enterprise-debian-nightly"
echo "Running on branch $BRANCH_NAME and so pointing to release-live repository in AWS CodeArtifact for release artifacts"
CODEARTIFACT_DOWNLOAD_URL="$CODEARTIFACT_BUILD_SERVICE_LIVE_URL/maven/release-live"
NEO4JVERSION=$neo4j_version_base
NEO4J_DOCKER_CE_OVERRIDE="neo4j:$neo4j_version_base"
NEO4J_DOCKER_EE_OVERRIDE="neo4j:$neo4j_version_base-enterprise"
fi
echo "NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE" >> "$GITHUB_ENV"
echo "CODEARTIFACT_DOWNLOAD_URL=$CODEARTIFACT_DOWNLOAD_URL" >> "$GITHUB_ENV"

echo "Found NEO4JVERSION=$NEO4JVERSION"
echo "Found NEO4J_DOCKER_CE_OVERRIDE=$NEO4J_DOCKER_CE_OVERRIDE"
echo "Found NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE"

echo "NEO4JVERSION=$NEO4JVERSION" >> "$GITHUB_ENV"
echo "NEO4J_DOCKER_CE_OVERRIDE=$NEO4J_DOCKER_CE_OVERRIDE" >> "$GITHUB_ENV"
echo "Found NEO4J_DOCKER_CE_OVERRIDE=$NEO4J_DOCKER_CE_OVERRIDE"
echo "Current branch BRANCH_NAME=$BRANCH_NAME"
echo "NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE" >> "$GITHUB_ENV"

- name: Init gradle
run: |
Expand Down
1 change: 0 additions & 1 deletion extended-it/src/test/java/apoc/couchbase/CouchbaseIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import static org.junit.Assert.fail;
import static org.neo4j.test.assertion.Assert.assertEventually;

@Ignore
public class CouchbaseIT {

private static int numberConnections = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import static org.neo4j.configuration.GraphDatabaseSettings.SYSTEM_DATABASE_NAME;
import static org.neo4j.test.assertion.Assert.assertEventually;

@Ignore
public class CypherProceduresClusterRoutingTest {
private static final long TIMEOUT = 30L;
private static final int NUM_CORES = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* @since 13.02.19
*/
// TODO Investigate why this test is not working. Possibly increase timeout for container
@Ignore
public class MetricsTest {

private static Neo4jContainerExtension neo4jContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import static org.junit.Assert.*;
import static org.neo4j.configuration.GraphDatabaseSettings.SYSTEM_DATABASE_NAME;

@Ignore
public class UUIDClusterRoutingTest {
private static final int NUM_CORES = 4;
private static TestcontainersCausalCluster cluster;
Expand Down
29 changes: 26 additions & 3 deletions extended/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,32 @@ dependencies {

testImplementation group: 'org.apache.arrow', name: 'arrow-vector', version: '13.0.0'
testImplementation group: 'org.apache.arrow', name: 'arrow-memory-netty', version: '13.0.0'

def withoutServerEE8 = {
exclude group: 'org.eclipse.jetty'
exclude group: 'org.eclipse.jetty.aggregate'
exclude group: 'org.apache.hive', module: 'hive-service'
exclude group: 'org.eclipse.jetty.ee8'
exclude group: 'org.eclipse.jetty.http2'
}

testImplementation group: 'org.neo4j.community', name: 'it-test-support', version: neo4jVersionEffective, withoutServerEE8
testImplementation group: 'org.neo4j', name: 'log-test-utils', version: neo4jVersionEffective, withoutServerEE8
testImplementation group: 'org.neo4j', name: 'neo4j-common', version: neo4jVersionEffective, classifier: "tests", withoutServerEE8
testImplementation group: 'org.neo4j', name: 'neo4j-kernel', version: neo4jVersionEffective, classifier: "tests", withoutServerEE8
testImplementation group: 'org.neo4j', name: 'neo4j-io', version: neo4jVersionEffective, classifier: "tests", withoutServerEE8

def hadoopVersion = '3.4.0'
testImplementation group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: hadoopVersion
testImplementation group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion
testImplementation group: 'org.apache.hadoop', name: 'hadoop-minicluster', version: hadoopVersion

// These dependencies affect the tests only, they will not be packaged in the resulting .jar
testImplementation project(':test-utils')
testImplementation project(':test-utils'), {
exclude group: 'org.apache.hadoop'
exclude group: 'org.neo4j'
exclude group: 'org.neo4j.community'
}
testImplementation project(':core')
testImplementation group: 'org.apache.poi', name: 'poi', version: '5.1.0', {
exclude group: 'org.apache.commons', module: 'commons-collections4'
Expand Down Expand Up @@ -164,8 +187,8 @@ dependencies {
testImplementation group: 'com.opencsv', name: 'opencsv', version: '5.7.1', {
exclude group: 'org.apache.commons', module: 'commons-collections4'
}

configurations.all {
configurations.configureEach {
exclude group: 'org.slf4j', module: 'slf4j-nop'
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
Expand Down
4 changes: 2 additions & 2 deletions extended/src/main/java/apoc/ml/OpenAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import apoc.ApocConfig;
import apoc.Extended;
import apoc.result.MapResult;
import apoc.util.ExtendedMapUtils;
import apoc.util.ExtendedUtil;
import apoc.util.JsonUtil;
import apoc.util.Util;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.neo4j.graphdb.security.URLAccessChecker;
import org.neo4j.procedure.Context;
Expand Down Expand Up @@ -225,7 +225,7 @@ public Stream<MapResult> completion(@Name("prompt") String prompt, @Name("api_ke
public Stream<MapResult> chatCompletion(@Name("messages") List<Map<String, Object>> messages, @Name("api_key") String apiKey, @Name(value = "configuration", defaultValue = "{}") Map<String, Object> configuration) throws Exception {
boolean failOnError = isFailOnError(configuration);
if (checkNullInput(messages, failOnError)) return Stream.empty();
messages = messages.stream().filter(MapUtils::isNotEmpty).toList();
messages = messages.stream().filter(ExtendedMapUtils::isNotEmpty).toList();
if (checkEmptyInput(messages, failOnError)) return Stream.empty();
configuration.putIfAbsent("model", GPT_4O_MODEL);
return executeRequest(apiKey, configuration, "chat/completions", (String) configuration.get("model"), "messages", messages, "$", apocConfig, urlAccessChecker)
Expand Down
4 changes: 4 additions & 0 deletions extended/src/main/java/apoc/util/ExtendedMapUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ public static int size(final Map<?, ?> map) {
public static boolean isEmpty(final Map<?,?> map) {
return map == null || map.isEmpty();
}

public static boolean isNotEmpty(final Map<?,?> map) {
return !isEmpty(map);
}
}
2 changes: 0 additions & 2 deletions extended/src/test/java/apoc/export/csv/ExportCsvTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.neo4j.configuration.GraphDatabaseSettings;
Expand All @@ -37,7 +36,6 @@
* @author mh
* @since 22.05.16
*/
@Ignore("It fails due to `java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet`")
public class ExportCsvTest {
private static final String EXPECTED = String.format("\"_id\",\"_labels\",\"age\",\"city\",\"kids\",\"male\",\"name\",\"street\",\"_start\",\"_end\",\"_type\"%n" +
"\"0\",\":User:User1\",\"42\",\"\",\"[\"\"a\"\",\"\"b\"\",\"\"c\"\"]\",\"true\",\"foo\",\"\",,,%n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.neo4j.configuration.GraphDatabaseSettings;
Expand All @@ -23,7 +22,6 @@
import static apoc.util.TestUtil.testResult;
import static org.junit.Assert.assertEquals;

@Ignore("It fails due to `java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet`")
public class ParquetHdfsTest {

private static final File directory = new File("target/hdfs-parquet-import");
Expand Down
2 changes: 0 additions & 2 deletions extended/src/test/java/apoc/load/LoadHdfsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.AfterAll;
Expand All @@ -29,7 +28,6 @@
import static apoc.util.TestUtil.testResult;
import static org.junit.Assert.assertEquals;

@Ignore("It fails due to `java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet`")
public class LoadHdfsTest {

@ClassRule
Expand Down
Loading