Skip to content

Commit 02483c4

Browse files
authored
Merge branch 'master' into download-group-show-button
2 parents 79abd10 + 111af79 commit 02483c4

File tree

1,280 files changed

+111981
-77569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,280 files changed

+111981
-77569
lines changed

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ jobs:
283283
name: Run end-2-end tests with studies in local database
284284
environment:
285285
CBIOPORTAL_URL: http://localhost:8080
286-
JUNIT_REPORT_PATH: ./local/junit
286+
JUNIT_REPORT_PATH: ./local/junit/
287287
SCREENSHOT_DIRECTORY: ./local/screenshots
288288
PORTAL_SOURCE_DIR: /tmp/repos/cbioportal-frontend
289289
TEST_HOME: /tmp/repos/cbioportal-frontend/end-to-end-test/local
@@ -297,7 +297,8 @@ jobs:
297297
environment:
298298
TEST_HOME: /tmp/repos/cbioportal-frontend/end-to-end-test/local
299299
command: |
300-
for f in $TEST_HOME/screenshots/reference/*.png; do
300+
cd cbioportal-frontend
301+
for f in end-to-end-test/local/screenshots/reference/*.png; do
301302
git ls-files --error-unmatch $f > /dev/null 2> /dev/null ||
302303
(echo -e "\033[0;31m $f not tracked \033[0m" && touch screenshots_not_tracked);
303304
done;
@@ -321,8 +322,8 @@ jobs:
321322
path: /tmp/repos/cbioportal-frontend/end-to-end-test/shared/imageCompare.html
322323
destination: /imageCompare.html
323324
- store_artifacts:
324-
path: /tmp/repos/cbioportal-frontend/end-to-end-test/local/junit/customReport.json
325-
destination: /customReport.json
325+
path: /tmp/repos/cbioportal-frontend/end-to-end-test/local/junit/completeResults.json
326+
destination: /completeResults.json
326327
- store_artifacts:
327328
path: /tmp/repos/cbioportal-frontend/end-to-end-test/local/junit/errors/
328329
destination: /errors
@@ -466,7 +467,6 @@ jobs:
466467
SUCCESS_COLOR: 'brightgreen'
467468
FAILURE_MESSAGE: 'Failing'
468469
FAILURE_COLOR: 'FF0A0A'
469-
SEVERITY_THRESHOLD: 'CRITICAL'
470470
TEST_REPO_URL: '[email protected]:cBioPortal/cbioportal-test.git'
471471
steps:
472472
- attach_workspace:
@@ -487,7 +487,7 @@ jobs:
487487
- run:
488488
name: Count vulnerabilities and update status badge
489489
command: |
490-
COUNT=$(jq '[.[] | select(.severity == "$SEVERITY_THRESHOLD")] | length' master_report.sbom)
490+
COUNT=$(jq '[.[] | select(.severity == "CRITICAL" or .severity == "HIGH")] | length' master_report.sbom)
491491
cd cbioportal-test
492492
if [ $COUNT -eq 0 ]; then
493493
jq --arg msg "$SUCCESS_MESSAGE" --arg col "$SUCCESS_COLOR" '.message = $msg | .color = $col' security-status.json > temp.json
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
HOOK_FILE=".git/hooks/pre-commit"
3+
4+
# Ensure hooks directory exists
5+
mkdir -p .git/hooks
6+
7+
# If the pre-commit hook doesn't exist, create it with a shebang line
8+
if [[ ! -f "$HOOK_FILE" ]]; then
9+
echo "#!/bin/bash" > "$HOOK_FILE"
10+
echo "set -e" >> "$HOOK_FILE"
11+
fi
12+
13+
# Check if Spotless is already in the pre-commit hook, and add it if missing
14+
if ! grep -qxF "mvn spotless:apply" "$HOOK_FILE"; then
15+
echo "echo 'Running Spotless on staged files...'" >> "$HOOK_FILE"
16+
echo "mvn spotless:apply" >> "$HOOK_FILE"
17+
fi
18+
19+
# Check if `git add -u` is already in the pre-commit hook, and add it if missing
20+
if ! grep -qxF "git add -u" "$HOOK_FILE"; then
21+
echo "echo 'Adding formatted files back to commit...'" >> "$HOOK_FILE"
22+
echo "git add -u" >> "$HOOK_FILE"
23+
fi
24+
25+
# Make sure the pre-commit hook is executable
26+
chmod +x "$HOOK_FILE"
27+
28+
echo "✅ Spotless pre-commit hook installed successfully!"

.github/workflows/core-test.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
name: Core tests
2-
on: [push, pull_request]
2+
3+
on:
4+
push:
5+
pull_request_target:
6+
workflow_dispatch:
7+
inputs:
8+
ref:
9+
description: 'Branch or PR to test (default: main)'
10+
required: false
11+
default: 'master'
12+
13+
permissions:
14+
id-token: write # This is required for requesting the JWT
15+
contents: read # This is required for actions/checkout
16+
317
jobs:
418
build:
519
name: Setup and Test
@@ -12,6 +26,9 @@ jobs:
1226
ports:
1327
- 3306
1428
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10
29+
env:
30+
TEST_DB_CLICKHOUSE_PASSWORD: ${{ secrets.TEST_DB_CLICKHOUSE_PASSWORD }}
31+
TEST_DB_MYSQL_PASSWORD: ${{ secrets.TEST_DB_MYSQL_PASSWORD }}
1532
steps:
1633
- name: 'Checkout cbioportal repo'
1734
uses: actions/checkout@v2
@@ -64,4 +81,8 @@ jobs:
6481
- name: 'Run integration tests separately'
6582
working-directory: ./cbioportal
6683
run: |
67-
mvn -U -Ppublic integration-test -Ddb.test.username=cbio_user -Ddb.test.password=somepassword
84+
mvn verify -Pintegration-test
85+
- name: 'Run e2e tests separately'
86+
working-directory: ./cbioportal
87+
run: |
88+
mvn verify -Pe2e-test

.github/workflows/dockerimage.yml

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ on:
33
push:
44
branches:
55
- master
6-
- release-*
7-
- rc
8-
- rfc*
9-
- demo-*
10-
- fusion-sv-migration
11-
- redis-branch-up-to-date
126
tags: '*'
137

148
jobs:
@@ -128,3 +122,81 @@ jobs:
128122
image: ${{ steps.meta.outputs.tags }}
129123
dependency-snapshot: 'true'
130124
github-token: '${{ secrets.GITHUB_TOKEN }}'
125+
126+
update_master_k8s_deployment:
127+
needs: build_and_publish_web
128+
if: github.repository == 'cBioPortal/cbioportal' && github.ref == 'refs/heads/master'
129+
runs-on: ubuntu-latest
130+
env:
131+
DEPLOYMENT_FILE_PATH: "argocd/aws/203403084713/clusters/cbioportal-prod/apps/cbioportal"
132+
DEPLOYMENT_FILE_NAMES: "cbioportal_backend_master_blue.yaml cbioportal_backend_master_green.yaml"
133+
K8S_REPO: 'knowledgesystems/knowledgesystems-k8s-deployment'
134+
ARGOCD_CLI_VER: '2.13.3'
135+
ARGOCD_SERVER: 'argocd.cbioportal.org'
136+
ARGOCD_APP: 'cbioportal'
137+
ARGOCD_RESOURCE_OPTIONS: '--resource apps:Deployment:default/cbioportal-backend-master-blue --resource apps:Deployment:default/cbioportal-backend-master-green'
138+
steps:
139+
- name: Extract metadata
140+
id: meta
141+
uses: docker/metadata-action@v4
142+
with:
143+
images: |
144+
cbioportal/cbioportal
145+
# Do not generate latest tag
146+
flavor: |
147+
latest=false
148+
suffix=-web-shenandoah
149+
tags: |
150+
type=ref,event=branch
151+
type=semver,pattern={{version}}
152+
153+
- name: Extract Image Tag
154+
run: |
155+
DOCKER_TAG=${{ steps.meta.outputs.tags }}
156+
docker pull $DOCKER_TAG
157+
DOCKER_SHA=$(docker inspect --format="{{index .RepoDigests 0}}" $DOCKER_TAG)
158+
echo "DOCKER_SHA=$DOCKER_SHA" >> $GITHUB_ENV
159+
160+
- name: Checkout K8s Repo
161+
uses: actions/checkout@v4
162+
with:
163+
repository: ${{ env.K8S_REPO }}
164+
token: ${{ secrets.K8S_REPO_TOKEN }}
165+
166+
- name: Update Master Deployment File
167+
run: |
168+
for FILE in $DEPLOYMENT_FILE_NAMES; do
169+
sed -i "s|image:.*|image: $DOCKER_SHA|" $DEPLOYMENT_FILE_PATH/$FILE
170+
done
171+
172+
- name: Add and commit changes to deployment file
173+
run: |
174+
git config --global user.email "[email protected]"
175+
git config --global user.name "cBioPortal Backend Github Action"
176+
if ! git diff --quiet; then
177+
git add -A
178+
git commit -m "Update master deployment"
179+
else
180+
echo "No changes to commit."
181+
fi
182+
183+
- name: Push changes to K8s repo
184+
uses: ad-m/github-push-action@master
185+
with:
186+
github_token: '${{ secrets.K8S_REPO_TOKEN }}'
187+
repository: ${{ env.K8S_REPO }}
188+
branch: master
189+
190+
- name: Setup ArgoCD
191+
uses: clowdhaus/argo-cd-action/@main
192+
with:
193+
version: ${{ env.ARGOCD_CLI_VER }}
194+
command: login ${{ env.ARGOCD_SERVER }}
195+
options: --username ${{ secrets.ARGOCD_2034_USERNAME }} --password ${{ secrets.ARGOCD_2034_PASSWORD }}
196+
197+
- name: Sync master deployment
198+
uses: clowdhaus/argo-cd-action/@main
199+
with:
200+
version: ${{ env.ARGOCD_CLI_VER }}
201+
command: app sync ${{ env.ARGOCD_APP }}
202+
options: ${{ env.ARGOCD_RESOURCE_OPTIONS }}

.github/workflows/integration-test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Integration tests
2-
on: [push, pull_request]
2+
on: [push, pull_request_target]
33
jobs:
44
build:
55
name: Integration tests
@@ -45,10 +45,10 @@ jobs:
4545
cat $PORTAL_SOURCE_DIR/src/main/resources/application.properties | \
4646
sed 's|spring.datasource.url=.*|spring.datasource.url=jdbc:mysql://cbioportal-database:3306/cbioportal?useSSL=false|' | \
4747
sed 's|spring.datasource.username=.*|spring.datasource.username=cbio_user|' | \
48-
sed 's|spring.datasource.password=.*|spring.datasource.password=somepassword|' \
48+
sed 's|spring.datasource.password=.*|spring.datasource.password=somepassword|' | \
49+
sed 's|session.service.url=.*|session.service.url=http://cbioportal-session:5001/api/sessions/my_portal/|' | \
50+
sed 's|feature.study.export=.*|feature.study.export=true|' \
4951
> application.properties
50-
- name: 'Copy cgds.sql file into Docker Compose'
51-
run: cp ./cbioportal/src/main/resources/db-scripts/cgds.sql ./cbioportal-docker-compose/data/.
5252
- name: 'Dump Properties'
5353
working-directory: ./cbioportal-docker-compose
5454
run: cat config/application.properties
@@ -73,6 +73,11 @@ jobs:
7373
working-directory: ./cbioportal-docker-compose
7474
run: |
7575
$PORTAL_SOURCE_DIR/test/integration/test_load_study.sh
76+
- name: 'TEST - Import and Export of study_es_0_import_export'
77+
if: steps.startup.conclusion == 'success'
78+
working-directory: ./cbioportal-docker-compose
79+
run: |
80+
$PORTAL_SOURCE_DIR/test/integration/test_import_export.sh
7681
- name: 'TEST - Add OncoKB annotations to study'
7782
if: steps.startup.conclusion == 'success'
7883
working-directory: ./cbioportal-docker-compose

.github/workflows/label-check.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,27 @@ jobs:
3232
id: check_labels
3333
run: |
3434
PR_NUMBER=$(jq -r ".number" $GITHUB_EVENT_PATH)
35-
PR_LABELS=$(curl -s "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" | \
35+
PR_LABELS_STRING=$(curl -s "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" | \
3636
jq -r '.labels[].name')
37+
mapfile -t PR_LABELS <<< "$PR_LABELS_STRING"
3738
mapfile -t AVAILABLE_LABELS < labels.txt
38-
for LABEL in ${PR_LABELS[@]}; do
39-
if [[ "$LABEL" == "skip-changelog" ]]; then
39+
pr_label_index=0
40+
while [ $pr_label_index -lt ${#PR_LABELS[@]} ] ; do
41+
pr_label="${PR_LABELS[$pr_label_index]}"
42+
if [[ "$pr_label" == "skip-changelog" ]] ; then
4043
echo "PR contains a valid label: skip-changelog"
4144
exit 0 # Valid label found, exit successfully
4245
fi
43-
for AVAILABLE_LABEL in "${AVAILABLE_LABELS[@]}"; do
44-
if [[ "$AVAILABLE_LABEL" == "$LABEL" ]]; then
45-
echo "PR contains a valid label: $LABEL"
46+
available_label_index=0
47+
while [ $available_label_index -lt ${#AVAILABLE_LABELS[@]} ] ; do
48+
available_label="${AVAILABLE_LABELS[$available_label_index]}"
49+
if [[ "$available_label" == "$pr_label" ]] ; then
50+
echo "PR contains a valid label: $pr_label"
4651
exit 0 # Valid label found, exit successfully
4752
fi
53+
available_label_index=$(($available_label_index+1))
4854
done
55+
pr_label_index=$(($pr_label_index+1))
4956
done
5057
echo "No valid label found on PR."
5158
echo "Available label options from release-drafter.yml:"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Markdown links check
2+
on: [pull_request]
3+
jobs:
4+
build:
5+
name: Markdown links check
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
# Docs here https://github.com/tcort/github-action-markdown-link-check
10+
- uses: tcort/github-action-markdown-link-check@v1
11+
continue-on-error: true
12+
with:
13+
use-quiet-mode: 'yes'
14+
use-verbose-mode: 'no'
15+
config-file: markdown_links_check_config.json

.github/workflows/maven-package-build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,34 @@ jobs:
7373
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
7474
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_CENTRAL_GPG_PASSPHRASE }}
7575
ref: ${{ inputs.source_ref }}
76+
77+
- name: Check publish status
78+
env:
79+
ARTIFACT_ID: "cbioportal"
80+
GROUP_ID_PATH: "io/github/cbioportal"
81+
MAX_RETRIES: 30
82+
INTERVAL_SECONDS: 60
83+
run: |
84+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
85+
VERSION=${{ inputs.source_ref }}
86+
elif [ "${{ github.event_name }}" == "release" ]; then
87+
VERSION=${{ github.event.release.tag_name }}
88+
else
89+
echo "Action triggered through a invalid event!";
90+
exit 1
91+
fi
92+
93+
URL="https://repo1.maven.org/maven2/${GROUP_ID_PATH}/${ARTIFACT_ID}/${VERSION}"
94+
95+
for ((i=1; i<=$MAX_RETRIES; i++)); do
96+
if curl --silent --head --fail "$URL" > /dev/null; then
97+
echo "Package successfully published!"
98+
exit 0
99+
else
100+
echo "Package not yet published! Retrying check in $INTERVAL_SECONDS seconds..."
101+
sleep "$INTERVAL_SECONDS"
102+
fi
103+
done
104+
105+
echo "Successful publish status NOT FOUND after $MAX_RETRIES attempts."
106+
exit 1

.github/workflows/retype-action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
dotnet-version: 7.0.x
2121

22-
- uses: retypeapp/action-build@latest
22+
- uses: retypeapp/action-build@ddc4449f15ae65b75e13198b88200bfd64aef168 # before v3.10.0, which breaks the news on homepage
2323

2424
- uses: retypeapp/action-github-pages@latest
2525
with:

.github/workflows/security-integration-test.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)