Skip to content

Commit

Permalink
Change Docker download based on branch name (#4216)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vga91 authored Nov 6, 2024
1 parent 3dabca8 commit 7c6254a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 16 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
CODEARTIFACT_DOWNLOAD_URL: ${{ secrets.CODEARTIFACT_DOWNLOAD_URL }}
CODEARTIFACT_USERNAME: ${{ secrets.CODEARTIFACT_USERNAME }}
ECR_NEO4J_DOCKER_URL: ${{ secrets.ECR_NEO4J_DOCKER_URL }}

BRANCH_NAME: ${{ github.event.pull_request.base.ref }}

jobs:
code-ql:
Expand Down Expand Up @@ -45,19 +45,25 @@ jobs:
- uses: ./.github/actions/setup-jdk
- uses: ./.github/actions/setup-gradle-cache

- name: Determine latest neo4j CI version and docker nightly images
- name: Determine latest neo4j CI version and docker images
run: |
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"
NEO4J_DOCKER_EE_OVERRIDE="$ECR_NEO4J_DOCKER_URL:$neo4j_version_base-enterprise-debian-nightly"
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
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"
fi
echo "NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE" >> "$GITHUB_ENV"
echo "Found NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE"
NEO4J_DOCKER_CE_OVERRIDE="$ECR_NEO4J_DOCKER_URL:$neo4j_version_base-community-debian-nightly"
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"
- name: Compile Java
run: |
Expand Down Expand Up @@ -114,19 +120,25 @@ jobs:
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}

- name: Determine latest neo4j CI version and docker nightly images
- name: Determine latest neo4j CI version and docker images
run: |
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"
NEO4J_DOCKER_EE_OVERRIDE="$ECR_NEO4J_DOCKER_URL/build-service/neo4j:$neo4j_version_base-enterprise-debian-nightly"
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
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"
fi
echo "NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE" >> "$GITHUB_ENV"
echo "Found NEO4J_DOCKER_EE_OVERRIDE=$NEO4J_DOCKER_EE_OVERRIDE"
NEO4J_DOCKER_CE_OVERRIDE="$ECR_NEO4J_DOCKER_URL/build-service/neo4j:$neo4j_version_base-community-debian-nightly"
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"
- name: Init gradle
run: |
Expand All @@ -136,4 +148,4 @@ jobs:
- name: Run ${{ matrix.project }} tests
uses: ./.github/actions/test-gradle-project
with:
project-name: ${{ matrix.project }}
project-name: ${{ matrix.project }}
2 changes: 1 addition & 1 deletion apoc-core
Submodule apoc-core updated 165 files
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ allprojects {
}

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

repositories {
Expand Down
2 changes: 0 additions & 2 deletions extended-it/src/test/java/apoc/neo4j/docker/BoltTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import org.neo4j.driver.Session;
import org.neo4j.graphdb.Entity;
Expand Down Expand Up @@ -46,7 +45,6 @@
* @author AgileLARUS
* @since 29.08.17
*/
@Ignore
public class BoltTest {

public static String BOLT_URL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import apoc.util.Neo4jContainerExtension;
import apoc.util.TestContainerUtil;
import org.junit.Ignore;
import org.junit.Test;
import apoc.util.TestContainerUtil.ApocPackage;
import org.neo4j.driver.Record;
Expand All @@ -25,7 +24,6 @@
into a Neo4j instance without any startup issue.
If you don't have docker installed it will fail, and you can simply ignore it.
*/
@Ignore
public class CoreExtendedTest {
@Test
public void checkForCoreAndExtended() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import apoc.util.TestContainerUtil;
import apoc.util.TestContainerUtil.Neo4jVersion;
import org.apache.commons.io.FileUtils;
import org.junit.Ignore;
import org.junit.Test;
import org.neo4j.driver.Session;

Expand All @@ -30,7 +29,6 @@
/*
This test is just to verify if the APOC procedures and functions are correctly deployed into a Neo4j instance without any startup issue.
*/
@Ignore
public class StartupExtendedTest {
private static final String APOC_HELP_QUERY = "CALL apoc.help('') YIELD core, type, name WHERE core = $core and type = $type RETURN name";
private static final List<String> EXPECTED_EXTENDED_NAMES;
Expand Down
3 changes: 3 additions & 0 deletions extra-dependencies/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ ext {
exclude group: 'io.netty', module: 'netty-transport-native-kqueue'
exclude group: 'io.netty', module: 'netty-transport-native-unix-common'
exclude group: 'io.netty', module: 'netty-tcnative-classes'

// javax
exclude group: 'javax.servlet', module: 'javax.servlet-api'
}
}

Expand Down
3 changes: 3 additions & 0 deletions extra-dependencies/hadoop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ shadowJar {
}

dependencies {
// the hadoop-hdfs-client and hadoop-common use by default the deprecated javax.servlet-api dependency
implementation group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '6.1.0', commonExclusions

implementation group: 'org.apache.hadoop', name: 'hadoop-hdfs-client', version: '3.4.0', commonExclusions
implementation group: 'org.apache.hadoop', name: 'hadoop-common', version: '3.4.0', commonExclusions
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.23.1', commonExclusions
Expand Down

0 comments on commit 7c6254a

Please sign in to comment.