Skip to content

Commit

Permalink
Merge branch 'release-5.x.x' into TASK-6879
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfeSanahuja committed Sep 16, 2024
2 parents afde81c + 864b1d4 commit 1e042b9
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 42 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/pull-request-approved.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: '10'
## This is important to avoid the error in the next step: "fatal: repository 'https://github.com/zetta-genomics/opencga-enterprise.git/' not found"
persist-credentials: false
- id: get_xetabase_branch
name: "Get current branch for Xetabase from target branch"
run: |
chmod +x ./.github/workflows/scripts/get-xetabase-branch.sh
xetabase_branch=$(./.github/workflows/scripts/get-xetabase-branch.sh ${{ github.event.pull_request.base.ref }})
echo "github.event.pull_request.base.ref: ${{ github.event.pull_request.base.ref }}"
echo "github.event.pull_request.head.ref: ${{ github.event.pull_request.head.ref }}"
echo "secrets.ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }}"
xetabase_branch=$(./.github/workflows/scripts/get-xetabase-branch.sh ${{ github.event.pull_request.head.ref }})
echo "__Xetabase ref:__ \"${xetabase_branch}\"" | tee -a ${GITHUB_STEP_SUMMARY}
echo "xetabase_branch=${xetabase_branch}" >> $GITHUB_OUTPUT
env:
ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }}

test:
name: "Run all tests before merging"
needs: calculate-xetabase-branch
uses: opencb/java-common-libs/.github/workflows/test-xetabase-workflow.yml@TASK-6399
uses: opencb/java-common-libs/.github/workflows/test-xetabase-workflow.yml@develop
with:
branch: ${{ needs.calculate-xetabase-branch.outputs.xetabase_branch }}
task: ${{ github.event.pull_request.head.ref }}
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/scripts/get-xetabase-branch.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash

set -e
set -x
# Function to calculate the corresponding branch of Xetabase project
get_xetabase_branch() {
# Input parameter (branch name)
input_branch="$1"

# If the branch begins with 'TASK' and exists in the opencga-enterprise repository, I return it
if [[ $input_branch == TASK* ]]; then
if [ "$(git ls-remote https://github.com/zetta-genomics/opencga-enterprise.git "$input_branch" )" ] ; then
echo "$GIT_BRANCH";
exit 0;
if [ "$(git ls-remote "https://$ZETTA_REPO_ACCESS_TOKEN@github.com/zetta-genomics/opencga-enterprise.git" "$input_branch" )" ] ; then
echo $input_branch;
return 0;
fi
fi

Expand Down Expand Up @@ -40,11 +41,6 @@ get_xetabase_branch() {
return 1
}

# Check if the script receives exactly one argument
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <branch-name>"
exit 1
fi

# Call the function with the input branch name
get_xetabase_branch "$1"
48 changes: 48 additions & 0 deletions .github/workflows/test-pull-request-approved.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Pull request approve workflow
run-name: 'Pull request approve workflow ${{ github.event.pull_request.head.ref }} -> ${{ github.event.pull_request.base.ref }} by @${{ github.actor }}'

on:
push:
branches:
- TASK-*


jobs:
calculate-xetabase-branch:
name: Calculate Xetabase branch
runs-on: ubuntu-22.04
outputs:
xetabase_branch: ${{ steps.get_xetabase_branch.outputs.xetabase_branch }}
steps:
- name: Clone java-common-libs
uses: actions/checkout@v4
with:
fetch-depth: '10'
## This is important to avoid the error in the next step: "fatal: repository 'https://github.com/zetta-genomics/opencga-enterprise.git/' not found"
persist-credentials: false
- id: get_xetabase_branch
name: "Get current branch for Xetabase from target branch"
run: |
if [ "$( git ls-remote https://$ZETTA_REPO_ACCESS_TOKEN@github.com/opencb/opencga.git "TASK-6807" )" ] ; then
echo "OPENCGA TASK-6807 branch";
fi
if [ "$( git ls-remote https://$ZETTA_REPO_ACCESS_TOKEN@github.com/zetta-genomics/opencga-enterprise.git "$input_branch" )" ] ; then
echo "Here it is TASK-6807 branch";
fi
chmod +x ./.github/workflows/scripts/get-xetabase-branch.sh
echo "secrets.ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }}" | tee -a ${GITHUB_STEP_SUMMARY}
xetabase_branch=$(./.github/workflows/scripts/get-xetabase-branch.sh "TASK-6807" )
echo "__Xetabase ref:__ \"${xetabase_branch}\"" | tee -a ${GITHUB_STEP_SUMMARY}
echo "xetabase_branch=${xetabase_branch}" >> $GITHUB_OUTPUT
env:
ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }}

test:
name: "Run all tests before merging"
needs: calculate-xetabase-branch
uses: opencb/java-common-libs/.github/workflows/test-xetabase-workflow.yml@develop
with:
branch: ${{ needs.calculate-xetabase-branch.outputs.xetabase_branch }}
task: TASK-6807
secrets: inherit
38 changes: 13 additions & 25 deletions .github/workflows/test-xetabase-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ on:
description: 'Branch of opencga-enterprise to be tested and built.'
required: true

env:
AZCOPY_AUTO_LOGIN_TYPE: "SPN"


jobs:
test:
name: Execute JUnit and Jacoco tests
Expand All @@ -35,16 +31,13 @@ jobs:
with:
keeper-secret-config: ${{ secrets.KEEPER_SM_GH_OPENCB }}
secrets: |
AZCOPY_SPA_CLIENT_SECRET/field/Secret Value > env:AZCOPY_SPA_CLIENT_SECRET
AZCOPY_SPA_APPLICATION_ID/field/Secret Value > env:AZCOPY_SPA_APPLICATION_ID
AZCOPY_TENANT_ID/field/Secret Value > env:AZCOPY_TENANT_ID
AZURE_KUBE_CONFIG/field/Secret Value > env:AZURE_KUBE_CONFIG
DOCKER_HUB_USER/field/Secret Value > env:DOCKER_HUB_USER
DOCKER_HUB_PASSWORD/field/Secret Value > env:DOCKER_HUB_PASSWORD
SSH_TESTING_SERVER_HOST/field/Secret Value > env:SSH_TESTING_SERVER_HOST
SSH_TESTING_SERVER_PORT/field/Secret Value > env:SSH_TESTING_SERVER_PORT
SSH_TESTING_SERVER_USER/field/Secret Value > env:SSH_TESTING_SERVER_USER
SSH_TESTING_SERVER_PASSWORD/field/Secret Value > env:SSH_TESTING_SERVER_PASSWORD
SSH_TESTING_SERVER_HOST/field/Secret Value > env:SSH_HOST
SSH_TESTING_SERVER_PORT/field/Secret Value > env:SSH_PORT
SSH_TESTING_SERVER_USER/field/Secret Value > env:SSH_USER
SSH_TESTING_SERVER_PASSWORD/field/Secret Value > env:SSH_PASS
- name: Log inputs
run: |
echo "__OpenCGA-enterprise branch:__ \"${{ inputs.branch }}\"" | tee -a $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -93,15 +86,20 @@ jobs:
chmod +x ./kubectl
echo "${{ secrets.AZURE_KUBE_CONFIG }}" > admin.conf
./kubectl -n cellbase-db port-forward services/cellbase-rs0-svc 27018:27017 --kubeconfig ./admin.conf &
- name: Install Azure AZCOPY
uses: kheiakiyama/install-azcopy-action@v1
with:
version: 'v10'
- name: DockerHub login
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_HUB_USER }}
password: ${{ env.DOCKER_HUB_PASSWORD }}
- name: Install sshpass
run: sudo apt-get install sshpass
- name: Add SSH Host to known_hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -p ${{ env.SSH_PORT }} ${{ env.SSH_HOST }} >> ~/.ssh/known_hosts
env:
SSH_HOST: ${{ env.SSH_HOST }}
SSH_PORT: ${{ env.SSH_PORT }}
- name: Run all OpenCB Junit tests, ie. java-common-libs, biodata, cellbase, opencga and opencga-enterprise
run: |
cd opencga-enterprise
Expand All @@ -117,16 +115,6 @@ jobs:
with:
name: build-log
path: ./opencga-enterprise/build.log
- name: Upload junit reports to a remote scp server
uses: garygrossgarten/github-action-scp@release
with:
local: opencga-enterprise/reports/test
remote: /var/www/html/reports/xetabase/${{ inputs.task }}/
host: ${{ env.SSH_TESTING_SERVER_HOST}}
port: ${{ env.SSH_TESTING_SERVER_PORT}}
username: ${{ env.SSH_TESTING_SERVER_USER }}
password: ${{ env.SSH_TESTING_SERVER_PASSWORD }}
concurrency: 2
- name: Log summary
run: |
cat ./opencga-enterprise/build.log | tee -a $GITHUB_STEP_SUMMARY
Expand Down
2 changes: 1 addition & 1 deletion commons-datastore/commons-datastore-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.opencb.commons</groupId>
<artifactId>commons-datastore</artifactId>
<version>5.2.1-SNAPSHOT</version>
<version>5.2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion commons-datastore/commons-datastore-mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.opencb.commons</groupId>
<artifactId>commons-datastore</artifactId>
<version>5.2.1-SNAPSHOT</version>
<version>5.2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion commons-datastore/commons-datastore-solr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.opencb.commons</groupId>
<artifactId>commons-datastore</artifactId>
<version>5.2.1-SNAPSHOT</version>
<version>5.2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion commons-datastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.opencb.commons</groupId>
<artifactId>commons</artifactId>
<version>5.2.1-SNAPSHOT</version>
<version>5.2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion commons-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.opencb.commons</groupId>
<artifactId>commons</artifactId>
<version>5.2.1-SNAPSHOT</version>
<version>5.2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.opencb.commons</groupId>
<artifactId>commons</artifactId>
<version>5.2.1-SNAPSHOT</version>
<version>5.2.2-SNAPSHOT</version>
<packaging>pom</packaging>

<name>OpenCB commons project</name>
Expand Down

0 comments on commit 1e042b9

Please sign in to comment.