Skip to content

Commit

Permalink
Fixed compile error with 5.24 and provisionally fixed docker and uplo…
Browse files Browse the repository at this point in the history
…ad-artifact errors (#4199)

* Fix compile error with 5.24

* update upload-artifact version

* changed neo4j version in ci.yaml as well

* changed neo4j and docker versions

* changed 5.24.0 to 5.24.1

* restore yml and gradle files like non dev branches
  • Loading branch information
vga91 authored Oct 4, 2024
1 parent 0d0bd0e commit 245dc0e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 78 deletions.
6 changes: 3 additions & 3 deletions .github/actions/test-gradle-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ runs:
- uses: ./.github/actions/setup-gradle-cache
- name: Run compile tests
shell: bash
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI :${{inputs.project-name}}:compileJava :${{inputs.project-name}}:compileTestJava
run: ./gradlew :${{inputs.project-name}}:compileJava :${{inputs.project-name}}:compileTestJava
- name: Run tests
shell: bash
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI :${{inputs.project-name}}:check --parallel
run: ./gradlew :${{inputs.project-name}}:check --parallel
- name: Archive test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: ${{inputs.project-name}}-test-results
Expand Down
51 changes: 5 additions & 46 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,23 @@ jobs:
matrix:
language: [ 'java', 'javascript' ]
steps:
- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Configure CodeArtifact Authentication Token
run: |
CODEARTIFACT_TOKEN=`aws codeartifact get-authorization-token --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --query authorizationToken --output text`
echo "::add-mask::$CODEARTIFACT_TOKEN"
echo "CODEARTIFACT_TOKEN=$CODEARTIFACT_TOKEN" >> "$GITHUB_ENV"
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-jdk
- uses: ./.github/actions/setup-gradle-cache

- name: Determine latest neo4j CI version
run: |
neo4j_version_base=$(grep -e "neo4jVersion = .*" build.gradle | cut -d '=' -f 2 | tr -d \'\" | tr -d ' ')
echo "neo4j_version_base=$neo4j_version_base"
NEO4J_VERSION_CI=`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 "NEO4J_VERSION_CI=$NEO4J_VERSION_CI" >> "$GITHUB_ENV"
echo "Found NEO4j_VERSION_CI=$NEO4J_VERSION_CI"

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

- name: Compile
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI compileJava compileTestJava
# Autobuild attempts to build any compiled languages
- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand All @@ -73,19 +53,6 @@ jobs:
project: [ 'extended', 'extended-it' ]
runs-on: ubuntu-latest
steps:
- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Configure CodeArtifact Authentication Token
run: |
CODEARTIFACT_TOKEN=`aws codeartifact get-authorization-token --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --query authorizationToken --output text`
echo "::add-mask::$CODEARTIFACT_TOKEN"
echo "CODEARTIFACT_TOKEN=$CODEARTIFACT_TOKEN" >> "$GITHUB_ENV"
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
Expand All @@ -98,19 +65,11 @@ jobs:
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}

- name: Determine latest neo4j CI version
run: |
neo4j_version_base=$(grep -e "neo4jVersion = .*" build.gradle | cut -d '=' -f 2 | tr -d \'\" | tr -d ' ')
echo "neo4j_version_base=$neo4j_version_base"
NEO4J_VERSION_CI=`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 "NEO4J_VERSION_CI=$NEO4J_VERSION_CI" >> "$GITHUB_ENV"
echo "Found NEO4j_VERSION_CI=$NEO4J_VERSION_CI"

- name: Init gradle
run: |
chmod +x gradlew
./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI --init-script init.gradle
./gradlew --init-script init.gradle
- name: Run ${{ matrix.project }} tests
uses: ./.github/actions/test-gradle-project
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "apoc-core"]
path = apoc-core
url = https://github.com/neo4j/apoc
branch = 5.22
branch = 5.24
32 changes: 6 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ downloadLicenses {

allprojects {
group = 'org.neo4j.procedure'
version = '5.23.0'
version = '5.24.0'
archivesBaseName = 'apoc'
description = """neo4j-apoc-procedures"""
}
Expand All @@ -28,17 +28,7 @@ repositories {
/*maven { // this contains the neo4j 4.0.0-beta jars
url "https://neo4j.bintray.com/community/"
}*/
if (System.getenv("CODEARTIFACT_DOWNLOAD_URL") ?: "" != "") {
maven {
url System.getenv('CODEARTIFACT_DOWNLOAD_URL')
credentials {
username System.getenv('CODEARTIFACT_USERNAME')
password System.getenv('CODEARTIFACT_TOKEN')
}
}
} else {
mavenCentral()
}
mavenCentral()
maven {
url "https://repo.gradle.org/gradle/libs-releases"
}
Expand All @@ -53,17 +43,7 @@ subprojects {
/*maven { // this contains the neo4j 4.0.0-beta jars
url "https://neo4j.bintray.com/community/"
}*/
if (System.getenv("CODEARTIFACT_DOWNLOAD_URL") ?: "" != "") {
maven {
url System.getenv('CODEARTIFACT_DOWNLOAD_URL')
credentials {
username System.getenv('CODEARTIFACT_USERNAME')
password System.getenv('CODEARTIFACT_TOKEN')
}
}
} else {
mavenCentral()
}
mavenCentral()
maven {
url "https://repo.gradle.org/gradle/libs-releases"
}
Expand Down Expand Up @@ -91,8 +71,8 @@ subprojects {
// neo4jDockerImage system property is used in TestContainerUtil
systemProperties 'user.language' : 'en' ,
'user.country' : 'US',
'neo4jDockerImage' : System.getProperty("NEO4JVERSION") ? 'neo4j:' + System.getProperty("NEO4JVERSION") + '-enterprise-debian' : 'neo4j:5.23.0-enterprise',
'neo4jCommunityDockerImage': System.getProperty("NEO4JVERSION") ? 'neo4j:' + System.getProperty("NEO4JVERSION") + '-debian' : 'neo4j:5.23.0',
'neo4jDockerImage' : System.getProperty("NEO4JVERSION") ? 'neo4j:' + System.getProperty("NEO4JVERSION") + '-enterprise-debian' : 'neo4j:5.24.1-enterprise',
'neo4jCommunityDockerImage': System.getProperty("NEO4JVERSION") ? 'neo4j:' + System.getProperty("NEO4JVERSION") + '-debian' : 'neo4j:5.24.1',
'coreDir': 'apoc-core/core',
'testDockerBundle': false

Expand Down Expand Up @@ -151,7 +131,7 @@ subprojects {

ext {
// NB: due to version.json generation by parsing this file, the next line must not have any if/then/else logic
neo4jVersion = "5.23.0"
neo4jVersion = "5.24.1"
// instead we apply the override logic here
neo4jVersionEffective = project.hasProperty("neo4jVersionOverride") ? project.getProperty("neo4jVersionOverride") : neo4jVersion
testContainersVersion = '1.18.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import apoc.SystemPropertyKeys;
import apoc.util.Util;
import org.apache.commons.lang3.tuple.Pair;
import org.neo4j.collection.RawIterator;
import org.neo4j.collection.ResourceRawIterator;
import org.neo4j.graphdb.Entity;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
Expand All @@ -26,6 +26,7 @@
import org.neo4j.kernel.api.ResourceMonitor;
import org.neo4j.kernel.api.procedure.CallableProcedure;
import org.neo4j.kernel.api.procedure.CallableUserFunction;
import org.neo4j.kernel.api.procedure.Context;
import org.neo4j.kernel.api.procedure.GlobalProcedures;
import org.neo4j.kernel.availability.AvailabilityListener;
import org.neo4j.kernel.impl.util.ValueUtils;
Expand Down Expand Up @@ -253,7 +254,7 @@ public boolean registerProcedure(ProcedureSignature signature, String statement)
final boolean isStatementNull = statement == null;
globalProceduresRegistry.register(new CallableProcedure.BasicProcedure(signature) {
@Override
public RawIterator<AnyValue[], ProcedureException> apply(org.neo4j.kernel.api.procedure.Context ctx, AnyValue[] input, ResourceMonitor resourceMonitor) throws ProcedureException {
public ResourceRawIterator<AnyValue[], ProcedureException> apply(Context ctx, AnyValue[] input, ResourceMonitor resourceMonitor) throws ProcedureException {
if (isStatementNull) {
final String error = String.format("There is no procedure with the name `%s` registered for this database instance. " +
"Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.", name);
Expand Down

0 comments on commit 245dc0e

Please sign in to comment.