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

Uses dev docker container in the dev branch. No AUTO cherry-pick #2621

Merged
merged 10 commits into from
Mar 14, 2022
39 changes: 27 additions & 12 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,31 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_ENTERPRISE_DEV_URL: ${{ secrets.DOCKER_ENTERPRISE_DEV_URL }}
DOCKER_COMMUNITY_DEV_URL: ${{ secrets.DOCKER_COMMUNITY_DEV_URL }}
TEAMCITY_DEV_URL: ${{ secrets.TEAMCITY_DEV_URL }}
TEAMCITY_USER: ${{ secrets.TEAMCITY_USER }}
TEAMCITY_PASSWORD: ${{ secrets.TEAMCITY_PASSWORD }}
ENTERPRISE_TAR: enterprise-docker.tar
COMMUNITY_TAR: community-docker.tar
steps:
- uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: Download neo4j dev docker container
run: |
curl -s -L0 -u "${TEAMCITY_USER}:${TEAMCITY_PASSWORD}" -X GET ${DOCKER_ENTERPRISE_DEV_URL} -o ${ENTERPRISE_TAR} &
curl -s -L0 -u "${TEAMCITY_USER}:${TEAMCITY_PASSWORD}" -X GET ${DOCKER_COMMUNITY_DEV_URL} -o ${COMMUNITY_TAR} &
ncordon marked this conversation as resolved.
Show resolved Hide resolved
wait
docker load --input ${ENTERPRISE_TAR}
docker load --input ${COMMUNITY_TAR}

- uses: actions/cache@v2
with:
path: |
Expand All @@ -24,19 +42,16 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
env:
TEAMCITY_DEV_URL: ${{ secrets.TEAMCITY_DEV_URL }}
TEAMCITY_USER: ${{ secrets.TEAMCITY_USER }}
TEAMCITY_PASSWORD: ${{ secrets.TEAMCITY_PASSWORD }}
run: ./gradlew build
- name: Clean neo4j from the cache
if: success() || failure() # run this step even if previous step failed
run: (find ~/.gradle/caches -name "*neo4j*" -exec rm -rf {} \;) || echo "All neo4j files cleaned"
- name: Check procedures included in apoc full
run: git diff --exit-code full/src/main/resources/extended.txt || (echo "extended.txt file does not contain all changes" && exit -1)
run: chmod +x gradlew && ./gradlew build
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify these lines and make sure there's no build --continue in other branches.


- name: Clean neo4j artifacts
if: always() # run this step even if previous step failed
run: |
(find ~/.gradle/caches -name "*neo4j*" -exec rm -rf {} \;) || echo "All neo4j files cleaned"
rm -rf ${ENTERPRISE_TAR} ${COMMUNITY_TAR}

- name: Archive test results
uses: actions/upload-artifact@v2
if: always()
Expand Down
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,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' : 'neo4j:5.0-enterprise',
'neo4jCommunityDockerImage': System.getProperty("NEO4JVERSION") ? 'neo4j:' + System.getProperty("NEO4JVERSION") : 'neo4j:5.0'
'neo4jDockerImage' : System.getProperty("NEO4JVERSION") ? 'neo4j:' + System.getProperty("NEO4JVERSION") + '-enterprise' : 'neo4j:5.0.0-dev-enterprise',
'neo4jCommunityDockerImage': System.getProperty("NEO4JVERSION") ? 'neo4j:' + System.getProperty("NEO4JVERSION") : 'neo4j:5.0.0-dev'

maxHeapSize = "8G"
forkEvery = 50
Expand All @@ -100,6 +100,9 @@ subprojects {
filter {
setFailOnNoMatchingTests(false)
}

testLogging.showStandardStreams = true
testLogging.exceptionFormat = 'full'
Comment on lines 100 to +105
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this lines in other branches

}

configurations {
Expand Down
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ dependencies {

configurations.all {
exclude group: 'org.slf4j', module: 'slf4j-nop'
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/apoc/StartupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class StartupTest {
public void test() {
try {
Neo4jContainerExtension neo4jContainer = createEnterpriseDB(!TestUtil.isRunningInCI())
.withNeo4jConfig("dbms.transaction.timeout", "5s");
.withNeo4jConfig("dbms.transaction.timeout", "60s");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Port this to other branches



neo4jContainer.start();
Expand Down
2 changes: 1 addition & 1 deletion docs/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
4 changes: 2 additions & 2 deletions extra-dependencies/couchbase/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

archivesBaseName = 'apoc-couchbase-dependencies'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
4 changes: 2 additions & 2 deletions extra-dependencies/email/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
4 changes: 2 additions & 2 deletions extra-dependencies/mongodb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

archivesBaseName = 'apoc-mongodb-dependencies'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
4 changes: 2 additions & 2 deletions extra-dependencies/nlp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
4 changes: 2 additions & 2 deletions extra-dependencies/redis/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

archivesBaseName = 'apoc-redis-dependencies'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
4 changes: 2 additions & 2 deletions extra-dependencies/xls/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update this in the other maintained branches

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I don't think so, as Neo 4.x is supposed to be run with Java 11?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes yes, I only left this comment as a self-reminder to review these settings in other branches

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
Copy link
Contributor Author

@ncordon ncordon Mar 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update this in the other maintained builds

13 changes: 8 additions & 5 deletions full/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ plugins {
id 'maven-publish'
id 'antlr'
id "org.sonarqube"
id "org.jetbrains.kotlin.jvm" version "1.5.31"
id "org.jetbrains.kotlin.jvm" version "1.6.0"
Copy link
Contributor Author

@ncordon ncordon Mar 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update this in the other maintained builds

}

archivesBaseName = "apoc"


jar {
manifest {
attributes 'Implementation-Version': version
Expand All @@ -20,7 +19,7 @@ jar {
}

compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "17"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this in the other branches

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but in the other branches 4.2, 4.3 and 4.4, I guess you should update it to 11 rather than 17.

}

generateGrammarSource {
Expand Down Expand Up @@ -48,7 +47,7 @@ dependencies {
// implementation group: 'commons-codec', name: 'commons-codec', version: '1.14'
implementation group: 'com.jayway.jsonpath', name: 'json-path', version: '2.4.0'
implementation group: 'org.hdrhistogram', name: 'HdrHistogram', version: '2.1.9'
implementation group: 'org.neo4j.driver', name: 'neo4j-java-driver', version: '4.0.0'
compileOnly group: 'org.neo4j.driver', name: 'neo4j-java-driver-slim', version: '4.4.3'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the driver compile only in other branches to avoid overwriting the one in the database when we plug in apoc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean with 'only in other branches'? I'm not sure I follow...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'll word it in other way: I want the version of java driver to be a compileOnly dependency as well in other branches (since it is included in the database already). Not doing this causes the database to evict its own java version and use the one included in the apoc jar.

implementation group: 'com.novell.ldap', name: 'jldap', version: '2009-10-07'

antlr "org.antlr:antlr4:4.7.2", {
Expand Down Expand Up @@ -153,10 +152,14 @@ dependencies {

configurations.all {
exclude group: 'org.slf4j', module: 'slf4j-nop'
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
Comment on lines 153 to 156
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this in the other branches

}


java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

// tweaks for CI
if (System.env.CI == 'true') {
Expand Down
2 changes: 2 additions & 0 deletions full/src/main/kotlin/apoc/nlp/azure/AzureProcedures.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package apoc.nlp.azure


import apoc.Extended
import apoc.nlp.NLPHelperFunctions
import apoc.nlp.NLPHelperFunctions.convert
import apoc.nlp.NLPHelperFunctions.getNodeProperty
Expand All @@ -14,6 +15,7 @@ import org.neo4j.logging.Log
import org.neo4j.procedure.*
import java.util.stream.Stream

@Extended
class AzureProcedures {
@Context
@JvmField
Expand Down
6 changes: 6 additions & 0 deletions full/src/main/resources/extended.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ apoc.nlp.aws.keyPhrases.graph
apoc.nlp.aws.keyPhrases.stream
apoc.nlp.aws.sentiment.graph
apoc.nlp.aws.sentiment.stream
apoc.nlp.azure.entities.graph
apoc.nlp.azure.entities.stream
apoc.nlp.azure.keyPhrases.graph
apoc.nlp.azure.keyPhrases.stream
apoc.nlp.azure.sentiment.graph
apoc.nlp.azure.sentiment.stream
apoc.nlp.gcp.classify.graph
apoc.nlp.gcp.classify.stream
apoc.nlp.gcp.entities.graph
Expand Down
2 changes: 1 addition & 1 deletion full/src/test/java/apoc/CoreExtendedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void checkForCoreAndExtended() {
public void matchesSpreadsheet() {
try {
Neo4jContainerExtension neo4jContainer = createEnterpriseDB(!TestUtil.isRunningInCI())
.withNeo4jConfig("dbms.transaction.timeout", "5s");
.withNeo4jConfig("dbms.transaction.timeout", "60s");

neo4jContainer.start();

Expand Down
2 changes: 1 addition & 1 deletion full/src/test/java/apoc/cypher/CypherEnterpriseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static void beforeAll() {
TestUtil.ignoreException(() -> {
// We build the project, the artifact will be placed into ./build/libs
neo4jContainer = createEnterpriseDB(!TestUtil.isRunningInCI())
.withNeo4jConfig("dbms.transaction.timeout", "5s");
.withNeo4jConfig("dbms.transaction.timeout", "60s");
neo4jContainer.start();
}, Exception.class);
assumeNotNull(neo4jContainer);
Expand Down
3 changes: 2 additions & 1 deletion processor/src/main/java/apoc/processor/ApocProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.element.TypeElement;
import javax.annotation.processing.SupportedSourceVersion;import javax.lang.model.SourceVersion;import javax.lang.model.element.TypeElement;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

@SupportedSourceVersion(SourceVersion.RELEASE_17)
public class ApocProcessor extends AbstractProcessor {

private List<String> procedureSignatures;
Expand Down
5 changes: 5 additions & 0 deletions test-startup/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ description = 'APOC :: Test Startup Module'
dependencies {
testImplementation project(':core')
testImplementation project(':test-utils')

configurations.all {
exclude group: 'org.slf4j', module: 'slf4j-nop'
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
}
Loading