Skip to content

Commit 7c6254a

Browse files
authored
Change Docker download based on branch name (#4216)
* Change Docker download based on branch name * change BRANCH_NAME var * rechange BRANCH_NAME var * added fi statement * added CODEARTIFACT_DOWNLOAD_URL if-else * added if CODEARTIFACT_DOWNLOAD_URL then teamcity-repository.gradle * Revert "Provisionally ignored failing docker tests in 5.20 (#4085)" This reverts commit 05bb7ff. * try resetting ci.yaml * try with if-else * decommented BRANCH_NAME * code clean ci.yaml * changed extra deps to remove AbstractMethodError with hadoop deps * removed -community suffix from ci.yaml * Update CI.yaml * Update CI.yaml * Update build.gradle
1 parent 3dabca8 commit 7c6254a

File tree

8 files changed

+28
-16
lines changed

8 files changed

+28
-16
lines changed

.github/workflows/CI.yaml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
CODEARTIFACT_DOWNLOAD_URL: ${{ secrets.CODEARTIFACT_DOWNLOAD_URL }}
1111
CODEARTIFACT_USERNAME: ${{ secrets.CODEARTIFACT_USERNAME }}
1212
ECR_NEO4J_DOCKER_URL: ${{ secrets.ECR_NEO4J_DOCKER_URL }}
13-
13+
BRANCH_NAME: ${{ github.event.pull_request.base.ref }}
1414

1515
jobs:
1616
code-ql:
@@ -45,19 +45,25 @@ jobs:
4545
- uses: ./.github/actions/setup-jdk
4646
- uses: ./.github/actions/setup-gradle-cache
4747

48-
- name: Determine latest neo4j CI version and docker nightly images
48+
- name: Determine latest neo4j CI version and docker images
4949
run: |
5050
neo4j_version_base=$(grep -e "neo4jVersion = .*" build.gradle | cut -d '=' -f 2 | tr -d \'\" | tr -d ' ')
5151
echo "neo4j_version_base=$neo4j_version_base"
5252
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 '" '`
5353
echo "NEO4JVERSION=$NEO4JVERSION" >> "$GITHUB_ENV"
5454
echo "Found NEO4JVERSION=$NEO4JVERSION"
55-
NEO4J_DOCKER_EE_OVERRIDE="$ECR_NEO4J_DOCKER_URL:$neo4j_version_base-enterprise-debian-nightly"
55+
if [[ $BRANCH_NAME =~ ^5.[0-9]+$ ]]; then
56+
NEO4J_DOCKER_EE_OVERRIDE="neo4j:$neo4j_version_base-enterprise"
57+
NEO4J_DOCKER_CE_OVERRIDE="neo4j:$neo4j_version_base"
58+
else
59+
NEO4J_DOCKER_CE_OVERRIDE="$ECR_NEO4J_DOCKER_URL:$neo4j_version_base-community-debian-nightly"
60+
NEO4J_DOCKER_EE_OVERRIDE="$ECR_NEO4J_DOCKER_URL:$neo4j_version_base-enterprise-debian-nightly"
61+
fi
5662
echo "NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE" >> "$GITHUB_ENV"
5763
echo "Found NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE"
58-
NEO4J_DOCKER_CE_OVERRIDE="$ECR_NEO4J_DOCKER_URL:$neo4j_version_base-community-debian-nightly"
5964
echo "NEO4J_DOCKER_CE_OVERRIDE=$NEO4J_DOCKER_CE_OVERRIDE" >> "$GITHUB_ENV"
6065
echo "Found NEO4J_DOCKER_CE_OVERRIDE=$NEO4J_DOCKER_CE_OVERRIDE"
66+
echo "Current branch BRANCH_NAME=$BRANCH_NAME"
6167
6268
- name: Compile Java
6369
run: |
@@ -114,19 +120,25 @@ jobs:
114120
~/.gradle/wrapper
115121
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
116122

117-
- name: Determine latest neo4j CI version and docker nightly images
123+
- name: Determine latest neo4j CI version and docker images
118124
run: |
119125
neo4j_version_base=$(grep -e "neo4jVersion = .*" build.gradle | cut -d '=' -f 2 | tr -d \'\" | tr -d ' ')
120126
echo "neo4j_version_base=$neo4j_version_base"
121127
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 '" '`
122128
echo "NEO4JVERSION=$NEO4JVERSION" >> "$GITHUB_ENV"
123129
echo "Found NEO4JVERSION=$NEO4JVERSION"
124-
NEO4J_DOCKER_EE_OVERRIDE="$ECR_NEO4J_DOCKER_URL/build-service/neo4j:$neo4j_version_base-enterprise-debian-nightly"
130+
if [[ $BRANCH_NAME =~ ^5.[0-9]+$ ]]; then
131+
NEO4J_DOCKER_EE_OVERRIDE="neo4j:$neo4j_version_base-enterprise"
132+
NEO4J_DOCKER_CE_OVERRIDE="neo4j:$neo4j_version_base"
133+
else
134+
NEO4J_DOCKER_CE_OVERRIDE="$ECR_NEO4J_DOCKER_URL/build-service/neo4j:$neo4j_version_base-community-debian-nightly"
135+
NEO4J_DOCKER_EE_OVERRIDE="$ECR_NEO4J_DOCKER_URL/build-service/neo4j:$neo4j_version_base-enterprise-debian-nightly"
136+
fi
125137
echo "NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE" >> "$GITHUB_ENV"
126138
echo "Found NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE"
127-
NEO4J_DOCKER_CE_OVERRIDE="$ECR_NEO4J_DOCKER_URL/build-service/neo4j:$neo4j_version_base-community-debian-nightly"
128139
echo "NEO4J_DOCKER_CE_OVERRIDE=$NEO4J_DOCKER_CE_OVERRIDE" >> "$GITHUB_ENV"
129140
echo "Found NEO4J_DOCKER_CE_OVERRIDE=$NEO4J_DOCKER_CE_OVERRIDE"
141+
echo "Current branch BRANCH_NAME=$BRANCH_NAME"
130142
131143
- name: Init gradle
132144
run: |
@@ -136,4 +148,4 @@ jobs:
136148
- name: Run ${{ matrix.project }} tests
137149
uses: ./.github/actions/test-gradle-project
138150
with:
139-
project-name: ${{ matrix.project }}
151+
project-name: ${{ matrix.project }}

apoc-core

Submodule apoc-core updated 165 files

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ allprojects {
2121
}
2222

2323
apply plugin: 'java-library'
24-
if (System.env.CI != null)
24+
if (System.env.CI != null && System.getenv("CODEARTIFACT_DOWNLOAD_URL") ?: "" != "")
2525
apply from: 'teamcity-repository.gradle'
2626

2727
repositories {

extended-it/src/test/java/apoc/neo4j/docker/BoltTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.junit.Assume;
1616
import org.junit.BeforeClass;
1717
import org.junit.ClassRule;
18-
import org.junit.Ignore;
1918
import org.junit.Test;
2019
import org.neo4j.driver.Session;
2120
import org.neo4j.graphdb.Entity;
@@ -46,7 +45,6 @@
4645
* @author AgileLARUS
4746
* @since 29.08.17
4847
*/
49-
@Ignore
5048
public class BoltTest {
5149

5250
public static String BOLT_URL;

extended-it/src/test/java/apoc/neo4j/docker/CoreExtendedTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import apoc.util.Neo4jContainerExtension;
44
import apoc.util.TestContainerUtil;
5-
import org.junit.Ignore;
65
import org.junit.Test;
76
import apoc.util.TestContainerUtil.ApocPackage;
87
import org.neo4j.driver.Record;
@@ -25,7 +24,6 @@
2524
into a Neo4j instance without any startup issue.
2625
If you don't have docker installed it will fail, and you can simply ignore it.
2726
*/
28-
@Ignore
2927
public class CoreExtendedTest {
3028
@Test
3129
public void checkForCoreAndExtended() {

extended-it/src/test/java/apoc/neo4j/docker/StartupExtendedTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import apoc.util.TestContainerUtil;
77
import apoc.util.TestContainerUtil.Neo4jVersion;
88
import org.apache.commons.io.FileUtils;
9-
import org.junit.Ignore;
109
import org.junit.Test;
1110
import org.neo4j.driver.Session;
1211

@@ -30,7 +29,6 @@
3029
/*
3130
This test is just to verify if the APOC procedures and functions are correctly deployed into a Neo4j instance without any startup issue.
3231
*/
33-
@Ignore
3432
public class StartupExtendedTest {
3533
private static final String APOC_HELP_QUERY = "CALL apoc.help('') YIELD core, type, name WHERE core = $core and type = $type RETURN name";
3634
private static final List<String> EXPECTED_EXTENDED_NAMES;

extra-dependencies/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ ext {
6767
exclude group: 'io.netty', module: 'netty-transport-native-kqueue'
6868
exclude group: 'io.netty', module: 'netty-transport-native-unix-common'
6969
exclude group: 'io.netty', module: 'netty-tcnative-classes'
70+
71+
// javax
72+
exclude group: 'javax.servlet', module: 'javax.servlet-api'
7073
}
7174
}
7275

extra-dependencies/hadoop/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ shadowJar {
2828
}
2929

3030
dependencies {
31+
// the hadoop-hdfs-client and hadoop-common use by default the deprecated javax.servlet-api dependency
32+
implementation group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '6.1.0', commonExclusions
33+
3134
implementation group: 'org.apache.hadoop', name: 'hadoop-hdfs-client', version: '3.4.0', commonExclusions
3235
implementation group: 'org.apache.hadoop', name: 'hadoop-common', version: '3.4.0', commonExclusions
3336
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.23.1', commonExclusions

0 commit comments

Comments
 (0)