From 8723e04a13e2c9fd706fbdf505b876f182145db0 Mon Sep 17 00:00:00 2001 From: Yurii Ozhho Date: Mon, 9 Feb 2026 20:34:55 +0200 Subject: [PATCH 01/83] added needed files --- .github/workflows/action.yaml | 79 +++++++++++++++++++++++++++++++++++ Dockerfile | 8 ++-- 2 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/action.yaml diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml new file mode 100644 index 00000000..f6af2d1c --- /dev/null +++ b/.github/workflows/action.yaml @@ -0,0 +1,79 @@ +name: Backend CI/CD + +env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PAT: ${{ secrets.DOCKER_PAT }} + IMAGE_NAME: eschool-backend + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + + sonar: + name: SonarQube Scan + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '8' + + - name: Sonar scan + env: + SONAR_HOST: ${{ secrets.SONAR_HOST }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + mvn verify sonar:sonar \ + -Dsonar.projectKey=eschool-backend-final-project \ + -Dsonar.host.url=$SONAR_HOST \ + -Dsonar.login=$SONAR_TOKEN + + + docker-build-and-push: + name: Build & Push Docker image + runs-on: ubuntu-latest + needs: sonar + if: github.event_name != 'pull_request' + + steps: + - uses: actions/checkout@v4 + + - name: Docker login + run: echo "$DOCKER_PAT" | docker login -u "$DOCKER_USERNAME" --password-stdin + + - name: Build image + run: | + docker build \ + -t $DOCKER_USERNAME/$IMAGE_NAME:${GITHUB_RUN_NUMBER} \ + -t $DOCKER_USERNAME/$IMAGE_NAME:latest \ + . + + - name: Push image + run: | + docker push $DOCKER_USERNAME/$IMAGE_NAME:${GITHUB_RUN_NUMBER} + docker push $DOCKER_USERNAME/$IMAGE_NAME:latest + + deploy: + name: Deploy + runs-on: ubuntu-latest + needs: docker-build-and-push + + steps: + - uses: appleboy/ssh-action@v1 + with: + host: ${{ secrets.SERVER_IP }} + username: ${{ secrets.SERVER_USER }} + key: ${{ secrets.SERVER_SSH_KEY }} + script: | + cd /path/to/docker-compose + docker pull $DOCKER_USERNAME/$IMAGE_NAME:latest + docker compose restart backend diff --git a/Dockerfile b/Dockerfile index d0af674f..93b29191 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM maven:3.5.2-jdk-8-alpine AS MAVEN_TOOL_CHAIN +FROM maven:3.5.2-jdk-8 AS MAVEN_TOOL_CHAIN COPY pom.xml /tmp/ COPY src /tmp/src/ WORKDIR /tmp/ -RUN mvn package +RUN mvn package -DskipTests -FROM openjdk:8-jdk-alpine +FROM tomcat:9.0-jre8-alpine COPY --from=MAVEN_TOOL_CHAIN /tmp/target/eschool.jar eschool.jar -EXPOSE 8080 +EXPOSE 8081 ENTRYPOINT ["java", "-jar", "eschool.jar"] \ No newline at end of file From 87b3128ccfef08f69b711138d1c9123276a291c2 Mon Sep 17 00:00:00 2001 From: Yurii Ozhho Date: Tue, 10 Feb 2026 08:59:49 +0200 Subject: [PATCH 02/83] added some changes --- .github/workflows/action.yaml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index f6af2d1c..157415b1 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -3,7 +3,7 @@ name: Backend CI/CD env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PAT: ${{ secrets.DOCKER_PAT }} - IMAGE_NAME: eschool-backend + IMAGE_NAME: eschool on: push: @@ -27,6 +27,14 @@ jobs: distribution: 'temurin' java-version: '8' + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2- + - name: Sonar scan env: SONAR_HOST: ${{ secrets.SONAR_HOST }} @@ -41,7 +49,6 @@ jobs: docker-build-and-push: name: Build & Push Docker image runs-on: ubuntu-latest - needs: sonar if: github.event_name != 'pull_request' steps: @@ -53,14 +60,14 @@ jobs: - name: Build image run: | docker build \ - -t $DOCKER_USERNAME/$IMAGE_NAME:${GITHUB_RUN_NUMBER} \ - -t $DOCKER_USERNAME/$IMAGE_NAME:latest \ + -t $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} \ + -t $DOCKER_USERNAME/$IMAGE_NAME:backend-latest \ . - name: Push image run: | - docker push $DOCKER_USERNAME/$IMAGE_NAME:${GITHUB_RUN_NUMBER} - docker push $DOCKER_USERNAME/$IMAGE_NAME:latest + docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} + docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-latest deploy: name: Deploy @@ -74,6 +81,7 @@ jobs: username: ${{ secrets.SERVER_USER }} key: ${{ secrets.SERVER_SSH_KEY }} script: | - cd /path/to/docker-compose - docker pull $DOCKER_USERNAME/$IMAGE_NAME:latest - docker compose restart backend + export DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }} + export IMAGE_NAME=eschool + docker pull $DOCKER_USERNAME/$IMAGE_NAME:backend-latest + docker compose up -d --force-recreate backend From b88d12e03402aa565db56a27ad2aa0a6dcfceab6 Mon Sep 17 00:00:00 2001 From: Yurii Ozhho Date: Tue, 10 Feb 2026 10:26:53 +0200 Subject: [PATCH 03/83] added some changes --- .github/workflows/action.yaml | 36 ++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 157415b1..4aa8d740 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -50,7 +50,6 @@ jobs: name: Build & Push Docker image runs-on: ubuntu-latest if: github.event_name != 'pull_request' - steps: - uses: actions/checkout@v4 @@ -70,18 +69,33 @@ jobs: docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-latest deploy: - name: Deploy + name: Deploy Backend runs-on: ubuntu-latest needs: docker-build-and-push - + if: github.event_name != 'pull_request' steps: - - uses: appleboy/ssh-action@v1 - with: - host: ${{ secrets.SERVER_IP }} - username: ${{ secrets.SERVER_USER }} - key: ${{ secrets.SERVER_SSH_KEY }} - script: | + - name: Checkout + uses: actions/checkout@v4 + + - name: SSH and deploy + env: + PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }} + SERVER_IP: ${{ secrets.SERVER_IP }} + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PAT: ${{ secrets.DOCKER_PAT }} + IMAGE_NAME: eschool + run: | + echo "$PRIVATE_KEY" > private_key.pem + chmod 600 private_key.pem + ssh -o StrictHostKeyChecking=no -i private_key.pem ec2-user@$SERVER_IP << 'EOF' export DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }} + export DOCKER_PAT=${{ secrets.DOCKER_PAT }} export IMAGE_NAME=eschool - docker pull $DOCKER_USERNAME/$IMAGE_NAME:backend-latest - docker compose up -d --force-recreate backend + + echo "$DOCKER_PAT" | sudo docker login -u "$DOCKER_USERNAME" --password-stdin + sudo docker pull $DOCKER_USERNAME/$IMAGE_NAME:backend-latest + + sudo docker compose up -d --force-recreate backend + + EOF + rm -f private_key.pem \ No newline at end of file From d11586ee5d1796ecbc71c984d25b4f1d1a376024 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:53:02 +0200 Subject: [PATCH 04/83] Update action.yaml --- .github/workflows/action.yaml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 4aa8d740..4e80fcd8 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -3,13 +3,13 @@ name: Backend CI/CD env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PAT: ${{ secrets.DOCKER_PAT }} - IMAGE_NAME: eschool + IMAGE_NAME: eschool-backend on: push: - branches: [ main ] + branches: [ master ] pull_request: - branches: [ main ] + branches: [ master ] workflow_dispatch: jobs: @@ -35,16 +35,24 @@ jobs: restore-keys: | ${{ runner.os }}-m2- - - name: Sonar scan - env: - SONAR_HOST: ${{ secrets.SONAR_HOST }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Ensure SonarCloud project exists run: | - mvn verify sonar:sonar \ - -Dsonar.projectKey=eschool-backend-final-project \ - -Dsonar.host.url=$SONAR_HOST \ - -Dsonar.login=$SONAR_TOKEN + curl -s -X POST -u "${{ secrets.SONAR_TOKEN }}:" \ + -d "name=Eschool-Backend-Final&project=eschool-backend-final-project&organization=${{ secrets.SONAR_ORGANIZATION }}&visibility=private" \ + https://sonarcloud.io/api/projects/create || echo "Project already exists" + - name: SonarCloud scan + uses: SonarSource/sonarqube-scan-action@v2 + env: + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: > + -Dsonar.projectKey=eschool-backend-final-project + -Dsonar.projectName=Eschool-Backend-Final + -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} + -Dsonar.sources=src + -Dsonar.branch.name=${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }} docker-build-and-push: name: Build & Push Docker image @@ -98,4 +106,4 @@ jobs: sudo docker compose up -d --force-recreate backend EOF - rm -f private_key.pem \ No newline at end of file + rm -f private_key.pem From 748c0530bcf5638e6bf92582c87d9fe7bc24b0c1 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 16:34:09 +0200 Subject: [PATCH 05/83] Update action.yaml --- .github/workflows/action.yaml | 66 +++++++++++++++-------------------- 1 file changed, 29 insertions(+), 37 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 4e80fcd8..5528aa50 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -35,12 +35,6 @@ jobs: restore-keys: | ${{ runner.os }}-m2- - - name: Ensure SonarCloud project exists - run: | - curl -s -X POST -u "${{ secrets.SONAR_TOKEN }}:" \ - -d "name=Eschool-Backend-Final&project=eschool-backend-final-project&organization=${{ secrets.SONAR_ORGANIZATION }}&visibility=private" \ - https://sonarcloud.io/api/projects/create || echo "Project already exists" - - name: SonarCloud scan uses: SonarSource/sonarqube-scan-action@v2 env: @@ -50,9 +44,7 @@ jobs: args: > -Dsonar.projectKey=eschool-backend-final-project -Dsonar.projectName=Eschool-Backend-Final - -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} -Dsonar.sources=src - -Dsonar.branch.name=${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }} docker-build-and-push: name: Build & Push Docker image @@ -76,34 +68,34 @@ jobs: docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-latest - deploy: - name: Deploy Backend - runs-on: ubuntu-latest - needs: docker-build-and-push - if: github.event_name != 'pull_request' - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: SSH and deploy - env: - PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }} - SERVER_IP: ${{ secrets.SERVER_IP }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PAT: ${{ secrets.DOCKER_PAT }} - IMAGE_NAME: eschool - run: | - echo "$PRIVATE_KEY" > private_key.pem - chmod 600 private_key.pem - ssh -o StrictHostKeyChecking=no -i private_key.pem ec2-user@$SERVER_IP << 'EOF' - export DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }} - export DOCKER_PAT=${{ secrets.DOCKER_PAT }} - export IMAGE_NAME=eschool - - echo "$DOCKER_PAT" | sudo docker login -u "$DOCKER_USERNAME" --password-stdin - sudo docker pull $DOCKER_USERNAME/$IMAGE_NAME:backend-latest + # deploy: + # name: Deploy Backend + # runs-on: ubuntu-latest + # needs: docker-build-and-push + # if: github.event_name != 'pull_request' + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + + # - name: SSH and deploy + # env: + # PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }} + # SERVER_IP: ${{ secrets.SERVER_IP }} + # DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + # DOCKER_PAT: ${{ secrets.DOCKER_PAT }} + # IMAGE_NAME: eschool + # run: | + # echo "$PRIVATE_KEY" > private_key.pem + # chmod 600 private_key.pem + # ssh -o StrictHostKeyChecking=no -i private_key.pem ec2-user@$SERVER_IP << 'EOF' + # export DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }} + # export DOCKER_PAT=${{ secrets.DOCKER_PAT }} + # export IMAGE_NAME=eschool + + # echo "$DOCKER_PAT" | sudo docker login -u "$DOCKER_USERNAME" --password-stdin + # sudo docker pull $DOCKER_USERNAME/$IMAGE_NAME:backend-latest - sudo docker compose up -d --force-recreate backend + # sudo docker compose up -d --force-recreate backend - EOF - rm -f private_key.pem + # EOF + # rm -f private_key.pem From 2c403875882acff6603284f12f6d3aacdd64650c Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 16:38:11 +0200 Subject: [PATCH 06/83] Update action.yaml --- .github/workflows/action.yaml | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 5528aa50..d69a8069 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -46,27 +46,27 @@ jobs: -Dsonar.projectName=Eschool-Backend-Final -Dsonar.sources=src - docker-build-and-push: - name: Build & Push Docker image - runs-on: ubuntu-latest - if: github.event_name != 'pull_request' - steps: - - uses: actions/checkout@v4 + # docker-build-and-push: + # name: Build & Push Docker image + # runs-on: ubuntu-latest + # if: github.event_name != 'pull_request' + # steps: + # - uses: actions/checkout@v4 - - name: Docker login - run: echo "$DOCKER_PAT" | docker login -u "$DOCKER_USERNAME" --password-stdin + # - name: Docker login + # run: echo "$DOCKER_PAT" | docker login -u "$DOCKER_USERNAME" --password-stdin - - name: Build image - run: | - docker build \ - -t $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} \ - -t $DOCKER_USERNAME/$IMAGE_NAME:backend-latest \ - . + # - name: Build image + # run: | + # docker build \ + # -t $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} \ + # -t $DOCKER_USERNAME/$IMAGE_NAME:backend-latest \ + # . - - name: Push image - run: | - docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} - docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-latest + # - name: Push image + # run: | + # docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} + # docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-latest # deploy: # name: Deploy Backend From 8d8c92881dcfd8e254c6c12a9b2582a86aea4127 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 17:00:43 +0200 Subject: [PATCH 07/83] Update action.yaml --- .github/workflows/action.yaml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index d69a8069..19c806f9 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -35,16 +35,12 @@ jobs: restore-keys: | ${{ runner.os }}-m2- - - name: SonarCloud scan - uses: SonarSource/sonarqube-scan-action@v2 - env: - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - args: > - -Dsonar.projectKey=eschool-backend-final-project - -Dsonar.projectName=Eschool-Backend-Final - -Dsonar.sources=src + - name: Build and analyze with Maven + run: mvn clean verify sonar:sonar \ + -Dsonar.projectKey=eschool-backend-final-project \ + -Dsonar.projectName=Eschool-Backend-Final \ + -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ + -Dsonar.login=${{ secrets.SONAR_TOKEN }} # docker-build-and-push: # name: Build & Push Docker image From d3ca78cacea453800db0d8b88e451822b7397523 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 17:09:38 +0200 Subject: [PATCH 08/83] Update action.yaml --- .github/workflows/action.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 19c806f9..8ff1dc7e 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -36,11 +36,12 @@ jobs: ${{ runner.os }}-m2- - name: Build and analyze with Maven - run: mvn clean verify sonar:sonar \ - -Dsonar.projectKey=eschool-backend-final-project \ - -Dsonar.projectName=Eschool-Backend-Final \ - -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ - -Dsonar.login=${{ secrets.SONAR_TOKEN }} + run: | + mvn clean verify sonar:sonar \ + -Dsonar.projectKey=eschool-backend-final-project \ + -Dsonar.projectName=Eschool-Backend-Final \ + -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ + -Dsonar.login=${{ secrets.SONAR_TOKEN }} # docker-build-and-push: # name: Build & Push Docker image From a0485d00839b4c016877221c033e0c3b1edd8c1e Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 18:14:54 +0200 Subject: [PATCH 09/83] Update action.yaml --- .github/workflows/action.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 8ff1dc7e..77193ebd 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -36,12 +36,12 @@ jobs: ${{ runner.os }}-m2- - name: Build and analyze with Maven - run: | - mvn clean verify sonar:sonar \ - -Dsonar.projectKey=eschool-backend-final-project \ - -Dsonar.projectName=Eschool-Backend-Final \ - -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ - -Dsonar.login=${{ secrets.SONAR_TOKEN }} + run: mvn clean compile sonar:sonar \ + -Dsonar.projectKey=eschool-backend-final-project \ + -Dsonar.projectName=Eschool-Backend-Final \ + -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ + -Dsonar.login=${{ secrets.SONAR_TOKEN }} \ + -Dsonar.sources=src/main/java # docker-build-and-push: # name: Build & Push Docker image From 2091f5cfb7648592880938f164c88131723caecf Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 18:17:26 +0200 Subject: [PATCH 10/83] Update action.yaml --- .github/workflows/action.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 77193ebd..10d014fa 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -36,12 +36,13 @@ jobs: ${{ runner.os }}-m2- - name: Build and analyze with Maven - run: mvn clean compile sonar:sonar \ - -Dsonar.projectKey=eschool-backend-final-project \ - -Dsonar.projectName=Eschool-Backend-Final \ - -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ - -Dsonar.login=${{ secrets.SONAR_TOKEN }} \ - -Dsonar.sources=src/main/java + run: | + mvn clean compile sonar:sonar \ + -Dsonar.projectKey=eschool-backend-final-project \ + -Dsonar.projectName=Eschool-Backend-Final \ + -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ + -Dsonar.login=${{ secrets.SONAR_TOKEN }} \ + -Dsonar.sources=src/main/java # docker-build-and-push: # name: Build & Push Docker image From 57c7cee195e1efb9855ee68490a7f5161888ff2b Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 18:20:02 +0200 Subject: [PATCH 11/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 10d014fa..a1da4df6 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -25,7 +25,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '8' + java-version: '17' - name: Cache Maven packages uses: actions/cache@v4 From 6fd318da6ef7d2cd0e7764b9d1ac2b3239b93f09 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 18:33:37 +0200 Subject: [PATCH 12/83] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f86c7b04..35177049 100755 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.11.0 1.8 1.8 From 28d19dd49fd0d7b3d75dfe19c9a08cf702716a34 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 18:36:45 +0200 Subject: [PATCH 13/83] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 35177049..09f75815 100755 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ org.projectlombok lombok - 1.18.0 + 1.18.30 provided From 529a30c544590ca342d52f0df2800bec8079a22b Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 19:10:28 +0200 Subject: [PATCH 14/83] Update action.yaml --- .github/workflows/action.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index a1da4df6..67680286 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -44,6 +44,14 @@ jobs: -Dsonar.login=${{ secrets.SONAR_TOKEN }} \ -Dsonar.sources=src/main/java + - name: SonarQube Quality Gate + uses: sonarsource/sonarqube-quality-gate-report@master + with: + SONAR_HOST: ${{ secrets.SONAR_HOST_URL }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + PROJECT_KEY: eschool-backend-final-project + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # docker-build-and-push: # name: Build & Push Docker image # runs-on: ubuntu-latest From ff50b32d13820369e320ce2ea7968c85c9728428 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 19:23:51 +0200 Subject: [PATCH 15/83] Update action.yaml --- .github/workflows/action.yaml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 67680286..bbb01a88 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -36,21 +36,23 @@ jobs: ${{ runner.os }}-m2- - name: Build and analyze with Maven + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | - mvn clean compile sonar:sonar \ + mvn clean verify sonar:sonar \ -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.projectName=Eschool-Backend-Final \ - -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ - -Dsonar.login=${{ secrets.SONAR_TOKEN }} \ - -Dsonar.sources=src/main/java - + -Dsonar.host.url=$SONAR_HOST_URL \ + -Dsonar.token=$SONAR_TOKEN + - name: SonarQube Quality Gate - uses: sonarsource/sonarqube-quality-gate-report@master + uses: sonarsource/sonarqube-quality-gate-action@v2 with: - SONAR_HOST: ${{ secrets.SONAR_HOST_URL }} + scanMetadataReportFile: target/sonar/report-task.txt + env: + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - PROJECT_KEY: eschool-backend-final-project - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # docker-build-and-push: # name: Build & Push Docker image From a2d4d4da1f7134615c0ee031167c8bad49856999 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 19:26:14 +0200 Subject: [PATCH 16/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index bbb01a88..6e5be171 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -47,7 +47,7 @@ jobs: -Dsonar.token=$SONAR_TOKEN - name: SonarQube Quality Gate - uses: sonarsource/sonarqube-quality-gate-action@v2 + uses: sonarsource/sonarqube-quality-gate-action@v1 with: scanMetadataReportFile: target/sonar/report-task.txt env: From 38c11346aa3611ed3f16d95d3bae84a35b472e17 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 19:31:14 +0200 Subject: [PATCH 17/83] Update action.yaml --- .github/workflows/action.yaml | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 6e5be171..651f0843 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -11,13 +11,11 @@ on: pull_request: branches: [ master ] workflow_dispatch: - + jobs: - sonar: - name: SonarQube Scan + build: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 @@ -25,27 +23,29 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '8' + + - name: Build and test + run: mvn clean verify + + sonar: + runs-on: ubuntu-latest + needs: build + + steps: + - uses: actions/checkout@v4 - - name: Cache Maven packages - uses: actions/cache@v4 + - uses: actions/setup-java@v4 with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-m2- + distribution: 'temurin' + java-version: '17' - - name: Build and analyze with Maven - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + - name: Sonar analysis run: | - mvn clean verify sonar:sonar \ + mvn sonar:sonar \ -Dsonar.projectKey=eschool-backend-final-project \ - -Dsonar.projectName=Eschool-Backend-Final \ - -Dsonar.host.url=$SONAR_HOST_URL \ - -Dsonar.token=$SONAR_TOKEN - + -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ + -Dsonar.login=${{ secrets.SONAR_TOKEN }} - name: SonarQube Quality Gate uses: sonarsource/sonarqube-quality-gate-action@v1 with: From c3def38540f61f50f9d2a23be8cc62933222dc29 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 19:35:57 +0200 Subject: [PATCH 18/83] Update action.yaml --- .github/workflows/action.yaml | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 651f0843..ef63c9ff 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -14,23 +14,8 @@ on: jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '8' - - - name: Build and test - run: mvn clean verify - sonar: runs-on: ubuntu-latest - needs: build steps: - uses: actions/checkout@v4 @@ -40,19 +25,21 @@ jobs: distribution: 'temurin' java-version: '17' + - name: Build (without tests) + run: mvn clean compile + - name: Sonar analysis - run: | - mvn sonar:sonar \ - -Dsonar.projectKey=eschool-backend-final-project \ - -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ - -Dsonar.login=${{ secrets.SONAR_TOKEN }} - - name: SonarQube Quality Gate - uses: sonarsource/sonarqube-quality-gate-action@v1 - with: - scanMetadataReportFile: target/sonar/report-task.txt env: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + mvn sonar:sonar \ + -Dsonar.projectKey=eschool-backend-final-project \ + -Dsonar.host.url=$SONAR_HOST_URL \ + -Dsonar.login=$SONAR_TOKEN \ + -Dsonar.sources=src/main/java \ + -Dsonar.tests=src/test/java \ + -Dsonar.java.binaries=target/classes # docker-build-and-push: # name: Build & Push Docker image From d036347d9287ccad381137bc63fc9f0e4dc4df16 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 19:39:14 +0200 Subject: [PATCH 19/83] Update action.yaml --- .github/workflows/action.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index ef63c9ff..68a57895 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -40,6 +40,14 @@ jobs: -Dsonar.sources=src/main/java \ -Dsonar.tests=src/test/java \ -Dsonar.java.binaries=target/classes + + - name: SonarQube Quality Gate + uses: sonarsource/sonarqube-quality-gate-action@v1 + with: + scanMetadataReportFile: target/sonar/report-task.txt + env: + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # docker-build-and-push: # name: Build & Push Docker image From c4a5b8b26859586fd3881c5cbea222b4ad1d35b5 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:01:52 +0200 Subject: [PATCH 20/83] Update action.yaml --- .github/workflows/action.yaml | 67 +++++------------------------------ 1 file changed, 9 insertions(+), 58 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 68a57895..aaaa3488 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -16,6 +16,7 @@ jobs: sonar: runs-on: ubuntu-latest + if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 @@ -40,65 +41,15 @@ jobs: -Dsonar.sources=src/main/java \ -Dsonar.tests=src/test/java \ -Dsonar.java.binaries=target/classes - + - name: SonarQube Quality Gate + id: quality-gate-check uses: sonarsource/sonarqube-quality-gate-action@v1 with: - scanMetadataReportFile: target/sonar/report-task.txt - env: - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - # docker-build-and-push: - # name: Build & Push Docker image - # runs-on: ubuntu-latest - # if: github.event_name != 'pull_request' - # steps: - # - uses: actions/checkout@v4 - - # - name: Docker login - # run: echo "$DOCKER_PAT" | docker login -u "$DOCKER_USERNAME" --password-stdin - - # - name: Build image - # run: | - # docker build \ - # -t $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} \ - # -t $DOCKER_USERNAME/$IMAGE_NAME:backend-latest \ - # . + sonar_host_url: ${{ secrets.SONAR_HOST_URL }} + sonar_token: ${{ secrets.SONAR_TOKEN }} + project_key: eschool-backend-final-project - # - name: Push image - # run: | - # docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} - # docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-latest - - # deploy: - # name: Deploy Backend - # runs-on: ubuntu-latest - # needs: docker-build-and-push - # if: github.event_name != 'pull_request' - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - - # - name: SSH and deploy - # env: - # PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }} - # SERVER_IP: ${{ secrets.SERVER_IP }} - # DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - # DOCKER_PAT: ${{ secrets.DOCKER_PAT }} - # IMAGE_NAME: eschool - # run: | - # echo "$PRIVATE_KEY" > private_key.pem - # chmod 600 private_key.pem - # ssh -o StrictHostKeyChecking=no -i private_key.pem ec2-user@$SERVER_IP << 'EOF' - # export DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }} - # export DOCKER_PAT=${{ secrets.DOCKER_PAT }} - # export IMAGE_NAME=eschool - - # echo "$DOCKER_PAT" | sudo docker login -u "$DOCKER_USERNAME" --password-stdin - # sudo docker pull $DOCKER_USERNAME/$IMAGE_NAME:backend-latest - - # sudo docker compose up -d --force-recreate backend - - # EOF - # rm -f private_key.pem + - name: Output result + run: | + echo "Quality Gate Status: ${{ steps.quality-gate-check.outputs.project-status }}" From 643bdab93b31ce0bcad38c8fdb5ef847760ed2bf Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:05:08 +0200 Subject: [PATCH 21/83] Update action.yaml --- .github/workflows/action.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index aaaa3488..7fcc14b4 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -43,12 +43,12 @@ jobs: -Dsonar.java.binaries=target/classes - name: SonarQube Quality Gate - id: quality-gate-check + id: quality-gate-check uses: sonarsource/sonarqube-quality-gate-action@v1 with: - sonar_host_url: ${{ secrets.SONAR_HOST_URL }} - sonar_token: ${{ secrets.SONAR_TOKEN }} - project_key: eschool-backend-final-project + scanMetadataReportFile: .scannerwork/report-task.txt + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - name: Output result run: | From 90806ed1fcaf8100d24e6c240aa75c5505c4d6e4 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:14:48 +0200 Subject: [PATCH 22/83] Update action.yaml --- .github/workflows/action.yaml | 78 ++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 19 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 7fcc14b4..57e855b9 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -11,45 +11,85 @@ on: pull_request: branches: [ master ] workflow_dispatch: - -jobs: +jobs: sonar: + name: SonarQube Scan runs-on: ubuntu-latest if: github.event_name == 'pull_request' - + steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 - - uses: actions/setup-java@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' + cache: 'maven' - - name: Build (without tests) - run: mvn clean compile - - - name: Sonar analysis + - name: Build and Sonar Analysis env: - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | - mvn sonar:sonar \ + mvn clean verify sonar:sonar \ -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ - -Dsonar.login=$SONAR_TOKEN \ - -Dsonar.sources=src/main/java \ - -Dsonar.tests=src/test/java \ - -Dsonar.java.binaries=target/classes + -Dsonar.token=$SONAR_TOKEN \ + -DskipTests - name: SonarQube Quality Gate id: quality-gate-check - uses: sonarsource/sonarqube-quality-gate-action@v1 + uses: sonarsource/sonarqube-quality-gate-action@v2 + timeout-minutes: 5 with: - scanMetadataReportFile: .scannerwork/report-task.txt + scanMetadataReportFile: target/sonar/report-task.txt env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - - name: Output result + - name: Output Quality Gate Status run: | - echo "Quality Gate Status: ${{ steps.quality-gate-check.outputs.project-status }}" + echo "The Quality Gate status is ${{ steps.quality-gate-check.outputs.project-status }}" + + + # - name: Push image + # run: | + # docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} + # docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-latest + + # deploy: + # name: Deploy Backend + # runs-on: ubuntu-latest + # needs: docker-build-and-push + # if: github.event_name != 'pull_request' + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + + # - name: SSH and deploy + # env: + # PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }} + # SERVER_IP: ${{ secrets.SERVER_IP }} + # DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + # DOCKER_PAT: ${{ secrets.DOCKER_PAT }} + # IMAGE_NAME: eschool + # run: | + # echo "$PRIVATE_KEY" > private_key.pem + # chmod 600 private_key.pem + # ssh -o StrictHostKeyChecking=no -i private_key.pem ec2-user@$SERVER_IP << 'EOF' + # export DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }} + # export DOCKER_PAT=${{ secrets.DOCKER_PAT }} + # export IMAGE_NAME=eschool + + # echo "$DOCKER_PAT" | sudo docker login -u "$DOCKER_USERNAME" --password-stdin + # sudo docker pull $DOCKER_USERNAME/$IMAGE_NAME:backend-latest + + # sudo docker compose up -d --force-recreate backend + + # EOF + # rm -f private_key.pem From 3dc1351e086132cb889f1e4d585f68e89bac5b2a Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:30:16 +0200 Subject: [PATCH 23/83] Update action.yaml --- .github/workflows/action.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 57e855b9..ad492a7c 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -16,7 +16,6 @@ jobs: sonar: name: SonarQube Scan runs-on: ubuntu-latest - if: github.event_name == 'pull_request' steps: - name: Checkout code From 620d616a370704c0888f2be7762db0f19e3adb3b Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:31:44 +0200 Subject: [PATCH 24/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index ad492a7c..51c882a5 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -43,7 +43,7 @@ jobs: - name: SonarQube Quality Gate id: quality-gate-check - uses: sonarsource/sonarqube-quality-gate-action@v2 + uses: sonarsource/sonarqube-quality-gate-action@v1 timeout-minutes: 5 with: scanMetadataReportFile: target/sonar/report-task.txt From 730d246022d4dd0f69c4fe562a81d42f272a55bc Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:35:18 +0200 Subject: [PATCH 25/83] Update action.yaml --- .github/workflows/action.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 51c882a5..ee9ad7a5 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -41,6 +41,11 @@ jobs: -Dsonar.token=$SONAR_TOKEN \ -DskipTests + - name: Show report-task.txt + run: | + ls -la target/sonar + cat target/sonar/report-task.txt + - name: SonarQube Quality Gate id: quality-gate-check uses: sonarsource/sonarqube-quality-gate-action@v1 From 1317cedb734d7672a74f64fb236345f13a970cae Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:38:22 +0200 Subject: [PATCH 26/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index ee9ad7a5..2dd6e351 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -48,7 +48,7 @@ jobs: - name: SonarQube Quality Gate id: quality-gate-check - uses: sonarsource/sonarqube-quality-gate-action@v1 + uses: sonarsource/sonarqube-quality-gate-action@v2 timeout-minutes: 5 with: scanMetadataReportFile: target/sonar/report-task.txt From 1e6beb9950a08bafbd23ef5eebb2b3ea4e60a1c3 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:40:31 +0200 Subject: [PATCH 27/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 2dd6e351..3df68f09 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -48,7 +48,7 @@ jobs: - name: SonarQube Quality Gate id: quality-gate-check - uses: sonarsource/sonarqube-quality-gate-action@v2 + uses: sonarsource/sonarqube-quality-gate-action@master timeout-minutes: 5 with: scanMetadataReportFile: target/sonar/report-task.txt From c238ac18f81c9f477410f994a3f7173a00be3a2e Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:44:01 +0200 Subject: [PATCH 28/83] Update action.yaml --- .github/workflows/action.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 3df68f09..da92b7dc 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -41,11 +41,6 @@ jobs: -Dsonar.token=$SONAR_TOKEN \ -DskipTests - - name: Show report-task.txt - run: | - ls -la target/sonar - cat target/sonar/report-task.txt - - name: SonarQube Quality Gate id: quality-gate-check uses: sonarsource/sonarqube-quality-gate-action@master @@ -56,10 +51,6 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - - name: Output Quality Gate Status - run: | - echo "The Quality Gate status is ${{ steps.quality-gate-check.outputs.project-status }}" - # - name: Push image # run: | From 8833433719994ba1a5dfe7838c299547507c4baf Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:50:28 +0200 Subject: [PATCH 29/83] Update action.yaml --- .github/workflows/action.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index da92b7dc..eb7eb44f 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -41,15 +41,20 @@ jobs: -Dsonar.token=$SONAR_TOKEN \ -DskipTests - - name: SonarQube Quality Gate - id: quality-gate-check + - name: SonarQube Quality Gate check + id: sonarqube-quality-gate-check uses: sonarsource/sonarqube-quality-gate-action@master - timeout-minutes: 5 with: - scanMetadataReportFile: target/sonar/report-task.txt + pollingTimeoutSec: 600 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} #OPTIONAL + + # Optionally you can use the output from the Quality Gate in another step. + # The possible outputs of the `quality-gate-status` variable are `PASSED`, `WARN` or `FAILED`. + - name: "Example show SonarQube Quality Gate Status value" + run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}" + # - name: Push image From 8518d10badaa76d725d76c34da52a7bcfc62d5eb Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:53:25 +0200 Subject: [PATCH 30/83] Update action.yaml --- .github/workflows/action.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index eb7eb44f..a8c6cbb4 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -45,10 +45,11 @@ jobs: id: sonarqube-quality-gate-check uses: sonarsource/sonarqube-quality-gate-action@master with: + scanMetadataReportFile: target/sonar/report-task.txt # <-- правильный путь pollingTimeoutSec: 600 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} #OPTIONAL + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} # Optionally you can use the output from the Quality Gate in another step. # The possible outputs of the `quality-gate-status` variable are `PASSED`, `WARN` or `FAILED`. From f308b8d3129292f8d56772ee990d9eb1f2986ff9 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:56:18 +0200 Subject: [PATCH 31/83] Update action.yaml --- .github/workflows/action.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index a8c6cbb4..f486b4ca 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -45,14 +45,12 @@ jobs: id: sonarqube-quality-gate-check uses: sonarsource/sonarqube-quality-gate-action@master with: - scanMetadataReportFile: target/sonar/report-task.txt # <-- правильный путь + scanMetadataReportFile: target/sonar/report-task.txt pollingTimeoutSec: 600 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - # Optionally you can use the output from the Quality Gate in another step. - # The possible outputs of the `quality-gate-status` variable are `PASSED`, `WARN` or `FAILED`. - name: "Example show SonarQube Quality Gate Status value" run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}" From 76e908878d2b1daa4c537afcff7431db9f14fe89 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 10:44:26 +0200 Subject: [PATCH 32/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index f486b4ca..4a267928 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -9,13 +9,13 @@ on: push: branches: [ master ] pull_request: - branches: [ master ] workflow_dispatch: jobs: sonar: name: SonarQube Scan runs-on: ubuntu-latest + if: github.event_name == 'pull_request' steps: - name: Checkout code From b65b9101ca4e6275d331c4f63c9b2d982f0eb71b Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 10:46:05 +0200 Subject: [PATCH 33/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 4a267928..014e7395 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -15,7 +15,7 @@ jobs: sonar: name: SonarQube Scan runs-on: ubuntu-latest - if: github.event_name == 'pull_request' + # if: github.event_name == 'pull_request' steps: - name: Checkout code From 58acb1174d624ccc71fb6135620b04ca7d096dad Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 10:48:56 +0200 Subject: [PATCH 34/83] Update action.yaml --- .github/workflows/action.yaml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 014e7395..834e3942 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -56,13 +56,30 @@ jobs: + # docker-build-and-push: + # name: Build & Push Docker image + # runs-on: ubuntu-latest + # if: github.event_name != 'pull_request' + # steps: + # - uses: actions/checkout@v4 + + # - name: Docker login + # run: echo "$DOCKER_PAT" | docker login -u "$DOCKER_USERNAME" --password-stdin + + # - name: Build image + # run: | + # docker build \ + # -t $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} \ + # -t $DOCKER_USERNAME/$IMAGE_NAME:backend-latest \ + # . + # - name: Push image # run: | # docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-${GITHUB_RUN_NUMBER} # docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-latest # deploy: - # name: Deploy Backend + # name: Deploy Frontend # runs-on: ubuntu-latest # needs: docker-build-and-push # if: github.event_name != 'pull_request' From d51d0745e0b13c15fb27a0be08f18dc48983e7d2 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 10:51:32 +0200 Subject: [PATCH 35/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 834e3942..6b81be6f 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -79,7 +79,7 @@ jobs: # docker push $DOCKER_USERNAME/$IMAGE_NAME:backend-latest # deploy: - # name: Deploy Frontend + # name: Deploy Backend # runs-on: ubuntu-latest # needs: docker-build-and-push # if: github.event_name != 'pull_request' From d98a651f755428f2d532b91f8d45e4e10de67b9b Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 11:05:34 +0200 Subject: [PATCH 36/83] Update action.yaml --- .github/workflows/action.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 6b81be6f..3d80db8f 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -9,13 +9,14 @@ on: push: branches: [ master ] pull_request: + branches: [ master ] workflow_dispatch: jobs: sonar: name: SonarQube Scan runs-on: ubuntu-latest - # if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' steps: - name: Checkout code From ebe7c57073c35476c24a6f55d4f22435fe15716c Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 11:14:29 +0200 Subject: [PATCH 37/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 3d80db8f..cc4bd870 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -9,7 +9,7 @@ on: push: branches: [ master ] pull_request: - branches: [ master ] + # branches: [ master ] workflow_dispatch: jobs: From 396b4af2f54d22607755e297528772519fc397a1 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 11:20:14 +0200 Subject: [PATCH 38/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index cc4bd870..3d80db8f 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -9,7 +9,7 @@ on: push: branches: [ master ] pull_request: - # branches: [ master ] + branches: [ master ] workflow_dispatch: jobs: From d50aafc25097193d5ef759b770fb2fa65a19867c Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 11:40:49 +0200 Subject: [PATCH 39/83] Update action.yaml to remove PR branch restriction Remove pull request branch specification for master. --- .github/workflows/action.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 3d80db8f..c24d1c34 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -9,7 +9,6 @@ on: push: branches: [ master ] pull_request: - branches: [ master ] workflow_dispatch: jobs: From fd734be90283a15fc1a37e5c69233235f9cd320c Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 12:51:13 +0200 Subject: [PATCH 40/83] Post SonarQube status to PR Adds a step to post SonarQube status to pull requests. --- .github/workflows/action.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index c24d1c34..f3794901 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -54,7 +54,17 @@ jobs: - name: "Example show SonarQube Quality Gate Status value" run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}" - + - name: Post SonarQube status to PR + if: github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'SonarQube analysis completed!\n View full report: ${{ secrets.SONAR_HOST_URL }}' + }); # docker-build-and-push: # name: Build & Push Docker image From e91ff61d89c0a82b0b4b143fbed46fcb3db6ecd0 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 13:03:37 +0200 Subject: [PATCH 41/83] Update action.yaml --- .github/workflows/action.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index f3794901..ee3197a5 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -59,11 +59,18 @@ jobs: uses: actions/github-script@v7 with: script: | + const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; + const isSuccess = qualityGateStatus === 'PASSED'; + + const body = isSuccess + ? `**SonarQube Analysis: PASSED**\n\nQuality gate check успішно пройдено!\n\n[View full report](${{ secrets.SONAR_HOST_URL }})` + : `**SonarQube Analysis: FAILED**\n\nQuality gate check не пройдено!\n\n[View full report](${{ secrets.SONAR_HOST_URL }})`; + github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'SonarQube analysis completed!\n View full report: ${{ secrets.SONAR_HOST_URL }}' + body: body }); # docker-build-and-push: From 5578b34c33adbeca11f6ff5c747ae2990377f79b Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 13:17:12 +0200 Subject: [PATCH 42/83] Update action.yaml --- .github/workflows/action.yaml | 36 ++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index ee3197a5..d061bad2 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -53,18 +53,44 @@ jobs: - name: "Example show SonarQube Quality Gate Status value" run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}" - - - name: Post SonarQube status to PR + + - name: Get SonarQube Report + id: sonar-report + if: github.event_name == 'pull_request' + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: | + REPORT=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" \ + "${{ secrets.SONAR_HOST_URL }}/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") + echo "report=$REPORT" >> $GITHUB_OUTPUT + + - name: Post SonarQube results to PR if: github.event_name == 'pull_request' uses: actions/github-script@v7 with: script: | const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; + const report = JSON.parse('${{ steps.sonar-report.outputs.report }}'); + + const measures = report.component.measures.reduce((acc, m) => { + acc[m.metric] = m.value || '0'; + return acc; + }, {}); + const isSuccess = qualityGateStatus === 'PASSED'; - const body = isSuccess - ? `**SonarQube Analysis: PASSED**\n\nQuality gate check успішно пройдено!\n\n[View full report](${{ secrets.SONAR_HOST_URL }})` - : `**SonarQube Analysis: FAILED**\n\nQuality gate check не пройдено!\n\n[View full report](${{ secrets.SONAR_HOST_URL }})`; + const body = `${statusEmoji} **SonarQube Analysis Results** + + Bugs: ${measures.bugs || '0'} + Vulnerabilities: ${measures.vulnerabilities || '0'} + Code Smells: ${measures.code_smells || '0'} + Coverage: ${measures.coverage || 'N/A'}% + Lines of Code: ${measures.ncloc || '0'} + + Quality Gate: **${qualityGateStatus}** + + [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; github.rest.issues.createComment({ issue_number: context.issue.number, From 35fa9ad08d1f119f8649217f4e71191db5cfffcf Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 13:20:59 +0200 Subject: [PATCH 43/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index d061bad2..3a686bce 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -80,7 +80,7 @@ jobs: const isSuccess = qualityGateStatus === 'PASSED'; - const body = `${statusEmoji} **SonarQube Analysis Results** + const body = `**SonarQube Analysis Results** Bugs: ${measures.bugs || '0'} Vulnerabilities: ${measures.vulnerabilities || '0'} From 05168708c7988ee7c1361350c69130c970aed92a Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 13:25:02 +0200 Subject: [PATCH 44/83] Update action.yaml --- .github/workflows/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 3a686bce..54df3837 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -61,8 +61,8 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | - REPORT=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" \ - "${{ secrets.SONAR_HOST_URL }}/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") + REPORT=$(curl -s -u "$SONAR_TOKEN":" \ + "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") echo "report=$REPORT" >> $GITHUB_OUTPUT - name: Post SonarQube results to PR From 3e3cbf546830bfd2807d06776406282fa3a895d3 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 13:30:30 +0200 Subject: [PATCH 45/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 54df3837..5902093e 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -61,7 +61,7 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | - REPORT=$(curl -s -u "$SONAR_TOKEN":" \ + REPORT=$(curl -s -u "$SONAR_TOKEN": \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") echo "report=$REPORT" >> $GITHUB_OUTPUT From b1ba2cf2f7c92cfd417bc7d0d002b61faa8b2218 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 13:36:00 +0200 Subject: [PATCH 46/83] Update action.yaml --- .github/workflows/action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 5902093e..00361214 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -61,6 +61,7 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | + curl -v -u "$SONAR_TOKEN:" "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc" REPORT=$(curl -s -u "$SONAR_TOKEN": \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") echo "report=$REPORT" >> $GITHUB_OUTPUT From a302efdfdc27b10cacf271b3e5ed0841edcf35ac Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 13:48:54 +0200 Subject: [PATCH 47/83] Update action.yaml --- .github/workflows/action.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 00361214..9586ab3f 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -72,7 +72,9 @@ jobs: with: script: | const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; - const report = JSON.parse('${{ steps.sonar-report.outputs.report }}'); + const report = JSON.parse(`${ + steps.sonar-report.outputs.report + }`); const measures = report.component.measures.reduce((acc, m) => { acc[m.metric] = m.value || '0'; From 49c4a5d0d1f43f56aee557eec26e0944da2d7aaf Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 13:53:09 +0200 Subject: [PATCH 48/83] Fix JSON parsing in GitHub Actions workflow --- .github/workflows/action.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 9586ab3f..c89588e5 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -72,9 +72,7 @@ jobs: with: script: | const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; - const report = JSON.parse(`${ - steps.sonar-report.outputs.report - }`); + const report = JSON.parse(` ${{ steps.sonar-report.outputs.report }}`); const measures = report.component.measures.reduce((acc, m) => { acc[m.metric] = m.value || '0'; From aaa1f2d7149809188703d5488574b33600a8b1cf Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:01:58 +0200 Subject: [PATCH 49/83] Refactor SonarQube report retrieval and posting Updated SonarQube report handling and output formatting. --- .github/workflows/action.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index c89588e5..a64df106 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -53,7 +53,7 @@ jobs: - name: "Example show SonarQube Quality Gate Status value" run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}" - + - name: Get SonarQube Report id: sonar-report if: github.event_name == 'pull_request' @@ -61,10 +61,10 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | - curl -v -u "$SONAR_TOKEN:" "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc" - REPORT=$(curl -s -u "$SONAR_TOKEN": \ + REPORT=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") - echo "report=$REPORT" >> $GITHUB_OUTPUT + REPORT_ESCAPED=$(echo "$REPORT" | jq -R -s '.') + echo "report=$REPORT_ESCAPED" >> $GITHUB_OUTPUT - name: Post SonarQube results to PR if: github.event_name == 'pull_request' @@ -72,15 +72,14 @@ jobs: with: script: | const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; - const report = JSON.parse(` ${{ steps.sonar-report.outputs.report }}`); + const reportRaw = ${{ steps.sonar-report.outputs.report }}; + const report = JSON.parse(reportRaw); const measures = report.component.measures.reduce((acc, m) => { acc[m.metric] = m.value || '0'; return acc; }, {}); - const isSuccess = qualityGateStatus === 'PASSED'; - const body = `**SonarQube Analysis Results** Bugs: ${measures.bugs || '0'} @@ -88,9 +87,9 @@ jobs: Code Smells: ${measures.code_smells || '0'} Coverage: ${measures.coverage || 'N/A'}% Lines of Code: ${measures.ncloc || '0'} - + Quality Gate: **${qualityGateStatus}** - + [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; github.rest.issues.createComment({ @@ -99,7 +98,7 @@ jobs: repo: context.repo.repo, body: body }); - + # docker-build-and-push: # name: Build & Push Docker image # runs-on: ubuntu-latest From 31f5543abcfa146bcddc55ed4bfefda0c7ce53dc Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:25:12 +0200 Subject: [PATCH 50/83] Refactor SonarQube report handling in workflow Updated SonarQube report retrieval to include new code metrics and overall metrics. Enhanced the comment posted to PR with detailed analysis results. --- .github/workflows/action.yaml | 89 ++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 28 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index a64df106..dc1cbd0a 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -54,17 +54,23 @@ jobs: - name: "Example show SonarQube Quality Gate Status value" run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}" - - name: Get SonarQube Report + - name: Get SonarQube Report (New Code + Overall) id: sonar-report if: github.event_name == 'pull_request' env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | - REPORT=$(curl -s -u "$SONAR_TOKEN:" \ + # цей запит для New Code + NEW_CODE=$(curl -s -u "$SONAR_TOKEN:" \ + "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage&additionalFields=periods") + + # цей запит для Overall Code + OVERALL=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") - REPORT_ESCAPED=$(echo "$REPORT" | jq -R -s '.') - echo "report=$REPORT_ESCAPED" >> $GITHUB_OUTPUT + + echo "new_code=$NEW_CODE" >> $GITHUB_OUTPUT + echo "overall=$OVERALL" >> $GITHUB_OUTPUT - name: Post SonarQube results to PR if: github.event_name == 'pull_request' @@ -72,32 +78,59 @@ jobs: with: script: | const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; - const reportRaw = ${{ steps.sonar-report.outputs.report }}; - const report = JSON.parse(reportRaw); - const measures = report.component.measures.reduce((acc, m) => { - acc[m.metric] = m.value || '0'; - return acc; - }, {}); - - const body = `**SonarQube Analysis Results** + try { + const newCode = JSON.parse(`${{ steps.sonar-report.outputs.new_code }}`); + const overall = JSON.parse(`${{ steps.sonar-report.outputs.overall }}`); + + // Парс New Code метрик + const newCodeMetrics = {}; + newCode.component.measures.forEach(m => { + newCodeMetrics[m.metric] = m.value || '0'; + }); + + // Парс Overall метрик + const overallMetrics = {}; + overall.component.measures.forEach(m => { + overallMetrics[m.metric] = m.value || '0'; + }); + + + const body = **SonarQube Analysis Results** - Bugs: ${measures.bugs || '0'} - Vulnerabilities: ${measures.vulnerabilities || '0'} - Code Smells: ${measures.code_smells || '0'} - Coverage: ${measures.coverage || 'N/A'}% - Lines of Code: ${measures.ncloc || '0'} - - Quality Gate: **${qualityGateStatus}** - - [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body - }); + **New Code (PR Changes):** + Bugs: ${newCodeMetrics.bugs || '0'} + Vulnerabilities: ${newCodeMetrics.vulnerabilities || '0'} + Code Smells: ${newCodeMetrics.code_smells || '0'} + Coverage: ${newCodeMetrics.coverage || 'N/A'}% + + **Overall Code (Full Project):** + Bugs: ${overallMetrics.bugs || '0'} + Vulnerabilities: ${overallMetrics.vulnerabilities || '0'} + Code Smells: ${overallMetrics.code_smells || '0'} + Coverage: ${overallMetrics.coverage || 'N/A'}% + Lines of Code: ${overallMetrics.ncloc || '0'} + + Quality Gate: **${qualityGateStatus}** + + [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: body + }); + } catch (error) { + console.error('Error parsing SonarQube data:', error); + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `Quality Gate: ${qualityGateStatus}\n\n[View Report](${{ secrets.SONAR_HOST_URL }}/dashboard)` + }); + } # docker-build-and-push: # name: Build & Push Docker image From ad80125f0b967ff81cb1cc9a602e78aff7083327 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:28:40 +0200 Subject: [PATCH 51/83] Fix formatting of SonarQube analysis results body --- .github/workflows/action.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index dc1cbd0a..90a24d9a 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -96,7 +96,8 @@ jobs: }); - const body = **SonarQube Analysis Results** + const body =` + **SonarQube Analysis Results** **New Code (PR Changes):** Bugs: ${newCodeMetrics.bugs || '0'} From e1df3f6a75ab95833ce7d9559754b753673ec4f1 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:36:57 +0200 Subject: [PATCH 52/83] Escape new code and overall metrics in action.yaml --- .github/workflows/action.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 90a24d9a..16923f52 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -68,9 +68,12 @@ jobs: # цей запит для Overall Code OVERALL=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") - - echo "new_code=$NEW_CODE" >> $GITHUB_OUTPUT - echo "overall=$OVERALL" >> $GITHUB_OUTPUT + + NEW_CODE_ESCAPED=$(echo "$NEW_CODET" | jq -R -s '.') + echo "new_code_escaped=$NEW_CODE_ESCAPED" >> $GITHUB_OUTPUT + + OVERALL_ESCAPED=$(echo "$OVERALL" | jq -R -s '.') + echo "overall_escaped=$NEW_CODE_ESCAPED" >> $GITHUB_OUTPUT - name: Post SonarQube results to PR if: github.event_name == 'pull_request' @@ -80,8 +83,8 @@ jobs: const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; try { - const newCode = JSON.parse(`${{ steps.sonar-report.outputs.new_code }}`); - const overall = JSON.parse(`${{ steps.sonar-report.outputs.overall }}`); + const newCode = JSON.parse(`${{ steps.sonar-report.outputs.new_code_escaped }}`); + const overall = JSON.parse(`${{ steps.sonar-report.outputs.overall_escaped }}`); // Парс New Code метрик const newCodeMetrics = {}; From 0a215019716d744d281f1c644a3a7e0287766bee Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:42:17 +0200 Subject: [PATCH 53/83] Update action.yaml --- .github/workflows/action.yaml | 110 ++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 53 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 16923f52..4a5efdb3 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -61,19 +61,19 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | - # цей запит для New Code + NEW_CODE=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage&additionalFields=periods") - # цей запит для Overall Code + OVERALL=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") - - NEW_CODE_ESCAPED=$(echo "$NEW_CODET" | jq -R -s '.') - echo "new_code_escaped=$NEW_CODE_ESCAPED" >> $GITHUB_OUTPUT - + + NEW_CODE_ESCAPED=$(echo "$NEW_CODE" | jq -R -s '.') OVERALL_ESCAPED=$(echo "$OVERALL" | jq -R -s '.') - echo "overall_escaped=$NEW_CODE_ESCAPED" >> $GITHUB_OUTPUT + + echo "new_code=$NEW_CODE_ESCAPED" >> $GITHUB_OUTPUT + echo "overall=$OVERALL_ESCAPED" >> $GITHUB_OUTPUT - name: Post SonarQube results to PR if: github.event_name == 'pull_request' @@ -83,59 +83,63 @@ jobs: const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; try { - const newCode = JSON.parse(`${{ steps.sonar-report.outputs.new_code_escaped }}`); - const overall = JSON.parse(`${{ steps.sonar-report.outputs.overall_escaped }}`); + + const newCodeStr = JSON.parse('${{ steps.sonar-report.outputs.new_code }}'); + const overallStr = JSON.parse('${{ steps.sonar-report.outputs.overall }}'); + + const newCode = JSON.parse(newCodeStr); + const overall = JSON.parse(overallStr); - // Парс New Code метрик const newCodeMetrics = {}; - newCode.component.measures.forEach(m => { - newCodeMetrics[m.metric] = m.value || '0'; - }); + if (newCode.component && newCode.component.measures) { + newCode.component.measures.forEach(m => { + newCodeMetrics[m.metric] = m.value || '0'; + }); + } - // Парс Overall метрик const overallMetrics = {}; - overall.component.measures.forEach(m => { - overallMetrics[m.metric] = m.value || '0'; - }); + if (overall.component && overall.component.measures) { + overall.component.measures.forEach(m => { + overallMetrics[m.metric] = m.value || '0'; + }); + } - - const body =` - **SonarQube Analysis Results** + const body = `**SonarQube Analysis Results** - **New Code (PR Changes):** - Bugs: ${newCodeMetrics.bugs || '0'} - Vulnerabilities: ${newCodeMetrics.vulnerabilities || '0'} - Code Smells: ${newCodeMetrics.code_smells || '0'} - Coverage: ${newCodeMetrics.coverage || 'N/A'}% - - **Overall Code (Full Project):** - Bugs: ${overallMetrics.bugs || '0'} - Vulnerabilities: ${overallMetrics.vulnerabilities || '0'} - Code Smells: ${overallMetrics.code_smells || '0'} - Coverage: ${overallMetrics.coverage || 'N/A'}% - Lines of Code: ${overallMetrics.ncloc || '0'} - - Quality Gate: **${qualityGateStatus}** - - [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body - }); - } catch (error) { - console.error('Error parsing SonarQube data:', error); - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `Quality Gate: ${qualityGateStatus}\n\n[View Report](${{ secrets.SONAR_HOST_URL }}/dashboard)` - }); - } + **New Code (PR Changes):** + Bugs: ${newCodeMetrics.bugs || '0'} + Vulnerabilities: ${newCodeMetrics.vulnerabilities || '0'} + Code Smells: ${newCodeMetrics.code_smells || '0'} + Coverage: ${newCodeMetrics.coverage || 'N/A'}% + + **Overall Code (Full Project):** + Bugs: ${overallMetrics.bugs || '0'} + Vulnerabilities: ${overallMetrics.vulnerabilities || '0'} + Code Smells: ${overallMetrics.code_smells || '0'} + Coverage: ${overallMetrics.coverage || 'N/A'}% + Lines of Code: ${overallMetrics.ncloc || '0'} + Quality Gate: **${qualityGateStatus}** + + [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: body + }); + } catch (error) { + console.error('Error parsing SonarQube data:', error); + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `Quality Gate: **${qualityGateStatus}**\n\n[View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)` + }); + } + # docker-build-and-push: # name: Build & Push Docker image # runs-on: ubuntu-latest From b8e11613d393e37e95f7c3258e2c549aecbdd13f Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:44:50 +0200 Subject: [PATCH 54/83] Update SonarQube API call in action.yaml Fix the API endpoint to include 'period' instead of 'periods' for metrics retrieval. --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 4a5efdb3..b29c03ac 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -63,7 +63,7 @@ jobs: run: | NEW_CODE=$(curl -s -u "$SONAR_TOKEN:" \ - "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage&additionalFields=periods") + "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage&additionalFields=period") OVERALL=$(curl -s -u "$SONAR_TOKEN:" \ From 55328b3cd11d79897725f959ff2139f5419dcd4d Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:49:50 +0200 Subject: [PATCH 55/83] Update action.yaml --- .github/workflows/action.yaml | 102 +++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 46 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index b29c03ac..462ca035 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -61,19 +61,21 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | - + # Запит для New Code NEW_CODE=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage&additionalFields=period") - + # Запит для Overall Code OVERALL=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") - - NEW_CODE_ESCAPED=$(echo "$NEW_CODE" | jq -R -s '.') - OVERALL_ESCAPED=$(echo "$OVERALL" | jq -R -s '.') - echo "new_code=$NEW_CODE_ESCAPED" >> $GITHUB_OUTPUT - echo "overall=$OVERALL_ESCAPED" >> $GITHUB_OUTPUT + echo "new_code<> $GITHUB_OUTPUT + echo "$NEW_CODE" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + echo "overall<> $GITHUB_OUTPUT + echo "$OVERALL" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - name: Post SonarQube results to PR if: github.event_name == 'pull_request' @@ -83,17 +85,25 @@ jobs: const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; try { - - const newCodeStr = JSON.parse('${{ steps.sonar-report.outputs.new_code }}'); - const overallStr = JSON.parse('${{ steps.sonar-report.outputs.overall }}'); + const newCode = JSON.parse(`${{ steps.sonar-report.outputs.new_code }}`); + const overall = JSON.parse(`${{ steps.sonar-report.outputs.overall }}`); - const newCode = JSON.parse(newCodeStr); - const overall = JSON.parse(overallStr); + console.log('New Code:', JSON.stringify(newCode).substring(0, 200)); + console.log('Overall:', JSON.stringify(overall).substring(0, 200)); + + if (newCode.errors) { + console.error('New Code API Error:', newCode.errors); + throw new Error('New Code API error'); + } const newCodeMetrics = {}; if (newCode.component && newCode.component.measures) { newCode.component.measures.forEach(m => { - newCodeMetrics[m.metric] = m.value || '0'; + if (m.periods && m.periods.length > 0) { + newCodeMetrics[m.metric] = m.periods[0].value || '0'; + } else { + newCodeMetrics[m.metric] = m.value || '0'; + } }); } @@ -105,40 +115,40 @@ jobs: } const body = `**SonarQube Analysis Results** - - **New Code (PR Changes):** - Bugs: ${newCodeMetrics.bugs || '0'} - Vulnerabilities: ${newCodeMetrics.vulnerabilities || '0'} - Code Smells: ${newCodeMetrics.code_smells || '0'} - Coverage: ${newCodeMetrics.coverage || 'N/A'}% - - **Overall Code (Full Project):** - Bugs: ${overallMetrics.bugs || '0'} - Vulnerabilities: ${overallMetrics.vulnerabilities || '0'} - Code Smells: ${overallMetrics.code_smells || '0'} - Coverage: ${overallMetrics.coverage || 'N/A'}% - Lines of Code: ${overallMetrics.ncloc || '0'} - Quality Gate: **${qualityGateStatus}** - - [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body - }); - } catch (error) { - console.error('Error parsing SonarQube data:', error); - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `Quality Gate: **${qualityGateStatus}**\n\n[View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)` - }); - } + **New Code (PR Changes):** + Bugs: ${newCodeMetrics.bugs || '0'} + Vulnerabilities: ${newCodeMetrics.vulnerabilities || '0'} + Code Smells: ${newCodeMetrics.code_smells || '0'} + Coverage: ${newCodeMetrics.coverage || 'N/A'}% + + **Overall Code (Full Project):** + Bugs: ${overallMetrics.bugs || '0'} + Vulnerabilities: ${overallMetrics.vulnerabilities || '0'} + Code Smells: ${overallMetrics.code_smells || '0'} + Coverage: ${overallMetrics.coverage || 'N/A'}% + Lines of Code: ${overallMetrics.ncloc || '0'} + + Quality Gate: **${qualityGateStatus}** + + [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: body + }); + } catch (error) { + console.error('Error parsing SonarQube data:', error); + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `Quality Gate: **${qualityGateStatus}**\n\n[View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)` + }); + } # docker-build-and-push: # name: Build & Push Docker image From c2ae7f6c6dad9c7e3c27043e3199eea5aa944fba Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:56:43 +0200 Subject: [PATCH 56/83] Update action.yaml --- .github/workflows/action.yaml | 47 +++++++++++------------------------ 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 462ca035..26bfaf2c 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -53,7 +53,7 @@ jobs: - name: "Example show SonarQube Quality Gate Status value" run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}" - + - name: Get SonarQube Report (New Code + Overall) id: sonar-report if: github.event_name == 'pull_request' @@ -61,21 +61,17 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | - # Запит для New Code NEW_CODE=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage&additionalFields=period") - # Запит для Overall Code OVERALL=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") - echo "new_code<> $GITHUB_OUTPUT - echo "$NEW_CODE" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + NEW_CODE_ESCAPED=$(echo "$NEW_CODE" | jq -Rs .) + OVERALL_ESCAPED=$(echo "$OVERALL" | jq -Rs .) - echo "overall<> $GITHUB_OUTPUT - echo "$OVERALL" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + echo "new_code=$NEW_CODE_ESCAPED" >> $GITHUB_OUTPUT + echo "overall=$OVERALL_ESCAPED" >> $GITHUB_OUTPUT - name: Post SonarQube results to PR if: github.event_name == 'pull_request' @@ -85,17 +81,17 @@ jobs: const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; try { - const newCode = JSON.parse(`${{ steps.sonar-report.outputs.new_code }}`); - const overall = JSON.parse(`${{ steps.sonar-report.outputs.overall }}`); - - console.log('New Code:', JSON.stringify(newCode).substring(0, 200)); - console.log('Overall:', JSON.stringify(overall).substring(0, 200)); + const newCodeStr = JSON.parse('${{ steps.sonar-report.outputs.new_code }}'); + const overallStr = JSON.parse('${{ steps.sonar-report.outputs.overall }}'); + const newCode = JSON.parse(newCodeStr); + const overall = JSON.parse(overallStr); + if (newCode.errors) { console.error('New Code API Error:', newCode.errors); - throw new Error('New Code API error'); + throw new Error('New Code API error: ' + newCode.errors[0].msg); } - + const newCodeMetrics = {}; if (newCode.component && newCode.component.measures) { newCode.component.measures.forEach(m => { @@ -106,7 +102,7 @@ jobs: } }); } - + const overallMetrics = {}; if (overall.component && overall.component.measures) { overall.component.measures.forEach(m => { @@ -115,22 +111,7 @@ jobs: } const body = `**SonarQube Analysis Results** - - **New Code (PR Changes):** - Bugs: ${newCodeMetrics.bugs || '0'} - Vulnerabilities: ${newCodeMetrics.vulnerabilities || '0'} - Code Smells: ${newCodeMetrics.code_smells || '0'} - Coverage: ${newCodeMetrics.coverage || 'N/A'}% - - **Overall Code (Full Project):** - Bugs: ${overallMetrics.bugs || '0'} - Vulnerabilities: ${overallMetrics.vulnerabilities || '0'} - Code Smells: ${overallMetrics.code_smells || '0'} - Coverage: ${overallMetrics.coverage || 'N/A'}% - Lines of Code: ${overallMetrics.ncloc || '0'} - - Quality Gate: **${qualityGateStatus}** - + [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; github.rest.issues.createComment({ From 379b8975021baaf9022bd484617abb30d4641666 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:06:40 +0200 Subject: [PATCH 57/83] Update action.yaml --- .github/workflows/action.yaml | 58 ++++++++++++----------------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 26bfaf2c..57c7c10c 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -63,15 +63,12 @@ jobs: run: | NEW_CODE=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage&additionalFields=period") - + OVERALL=$(curl -s -u "$SONAR_TOKEN:" \ "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") - NEW_CODE_ESCAPED=$(echo "$NEW_CODE" | jq -Rs .) - OVERALL_ESCAPED=$(echo "$OVERALL" | jq -Rs .) - - echo "new_code=$NEW_CODE_ESCAPED" >> $GITHUB_OUTPUT - echo "overall=$OVERALL_ESCAPED" >> $GITHUB_OUTPUT + echo "new_code_b64=$(echo "$NEW_CODE" | base64 -w 0)" >> $GITHUB_OUTPUT + echo "overall_b64=$(echo "$OVERALL" | base64 -w 0)" >> $GITHUB_OUTPUT - name: Post SonarQube results to PR if: github.event_name == 'pull_request' @@ -79,40 +76,23 @@ jobs: with: script: | const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; - - try { - const newCodeStr = JSON.parse('${{ steps.sonar-report.outputs.new_code }}'); - const overallStr = JSON.parse('${{ steps.sonar-report.outputs.overall }}'); - - const newCode = JSON.parse(newCodeStr); - const overall = JSON.parse(overallStr); - - if (newCode.errors) { - console.error('New Code API Error:', newCode.errors); - throw new Error('New Code API error: ' + newCode.errors[0].msg); - } - - const newCodeMetrics = {}; - if (newCode.component && newCode.component.measures) { - newCode.component.measures.forEach(m => { - if (m.periods && m.periods.length > 0) { - newCodeMetrics[m.metric] = m.periods[0].value || '0'; - } else { - newCodeMetrics[m.metric] = m.value || '0'; - } - }); - } - - const overallMetrics = {}; - if (overall.component && overall.component.measures) { - overall.component.measures.forEach(m => { - overallMetrics[m.metric] = m.value || '0'; - }); - } - - const body = `**SonarQube Analysis Results** + + const newCodeJson = Buffer + .from('${{ steps.sonar-report.outputs.new_code_b64 }}', 'base64') + .toString(); + + const overallJson = Buffer + .from('${{ steps.sonar-report.outputs.overall_b64 }}', 'base64') + .toString(); + + const newCode = JSON.parse(newCodeJson); + const overall = JSON.parse(overallJson); + + const body = `SonarQube Analysis + + Quality Gate: **${qualityGateStatus}** - [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; + [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; github.rest.issues.createComment({ issue_number: context.issue.number, From 88e4517585376cc1948bcb093b5d82f6c3a44bc4 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:11:40 +0200 Subject: [PATCH 58/83] Update action.yaml --- .github/workflows/action.yaml | 65 +++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 57c7c10c..fc6c0c4b 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -77,39 +77,46 @@ jobs: script: | const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; - const newCodeJson = Buffer - .from('${{ steps.sonar-report.outputs.new_code_b64 }}', 'base64') - .toString(); + try { + const newCodeJson = Buffer + .from('${{ steps.sonar-report.outputs.new_code_b64 }}', 'base64') + .toString(); - const overallJson = Buffer - .from('${{ steps.sonar-report.outputs.overall_b64 }}', 'base64') - .toString(); + const overallJson = Buffer + .from('${{ steps.sonar-report.outputs.overall_b64 }}', 'base64') + .toString(); - const newCode = JSON.parse(newCodeJson); - const overall = JSON.parse(overallJson); + const newCode = JSON.parse(newCodeJson); + const overall = JSON.parse(overallJson); - const body = `SonarQube Analysis + const body = `SonarQube Analysis - Quality Gate: **${qualityGateStatus}** - - [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body - }); - } catch (error) { - console.error('Error parsing SonarQube data:', error); - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `Quality Gate: **${qualityGateStatus}**\n\n[View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)` - }); - } + Quality Gate: **${qualityGateStatus}** + + [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard) + `; + + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body + }); + + } catch (error) { + console.error(error); + + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: ` SonarQube parsing error + + Quality Gate: **${qualityGateStatus}** + + [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)` + }); + } # docker-build-and-push: # name: Build & Push Docker image From d56b1b4f4d3fd8607f5c7ec1034368b4182f659e Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:17:12 +0200 Subject: [PATCH 59/83] Update action.yaml --- .github/workflows/action.yaml | 84 ++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index fc6c0c4b..b2080161 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -76,47 +76,67 @@ jobs: with: script: | const qualityGateStatus = '${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}'; - + try { const newCodeJson = Buffer .from('${{ steps.sonar-report.outputs.new_code_b64 }}', 'base64') .toString(); - + const overallJson = Buffer .from('${{ steps.sonar-report.outputs.overall_b64 }}', 'base64') .toString(); - + const newCode = JSON.parse(newCodeJson); const overall = JSON.parse(overallJson); - - const body = `SonarQube Analysis - - Quality Gate: **${qualityGateStatus}** - - [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard) - `; - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body - }); - - } catch (error) { - console.error(error); - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: ` SonarQube parsing error - - Quality Gate: **${qualityGateStatus}** - - [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard)` - }); - } + + function extractMeasures(data) { + const result = {}; + data.component.measures.forEach(m => { + result[m.metric] = { + overall: m.value ?? '0', + new: m.period?.value ?? '0' + }; + }); + return result; + } + + const newMetrics = extractMeasures(newCode); + const overallMetrics = extractMeasures(overall); + + const body = ` + ## SonarQube Analysis + + ### Quality Gate: **${qualityGateStatus}** + + ### New Code + - Bugs: ${newMetrics.bugs?.new} + - Vulnerabilities: ${newMetrics.vulnerabilities?.new} + - Code Smells: ${newMetrics.code_smells?.new} + - Coverage: ${newMetrics.coverage?.new}% + + --- + + ### Overall Code + - Bugs: ${overallMetrics.bugs?.overall} + - Vulnerabilities: ${overallMetrics.vulnerabilities?.overall} + - Code Smells: ${overallMetrics.code_smells?.overall} + - Coverage: ${overallMetrics.coverage?.overall}% + - Lines: ${overallMetrics.lines?.overall} + - ncloc: ${overallMetrics.ncloc?.overall} + + [View Full Report](${{ secrets.SONAR_HOST_URL }}/dashboard) + `; + + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body + }); + + } catch (error) { + console.error(error); + } # docker-build-and-push: # name: Build & Push Docker image From 9ab5cb3919c8cea2e2f499df43435468d167afa1 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 16:11:32 +0200 Subject: [PATCH 60/83] Update action.yaml --- .github/workflows/action.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index b2080161..7706ff8f 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -62,10 +62,10 @@ jobs: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | NEW_CODE=$(curl -s -u "$SONAR_TOKEN:" \ - "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage&additionalFields=period") + "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=software_quality_security_rating,software_quality_reliability_rating,duplicated_lines_density,bugs,vulnerabilities,code_smells,coverage&additionalFields=period") OVERALL=$(curl -s -u "$SONAR_TOKEN:" \ - "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=bugs,vulnerabilities,code_smells,coverage,lines,ncloc") + "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=software_quality_security_rating,software_quality_reliability_rating,duplicated_lines_density,bugs,vulnerabilities,code_smells,coverage,lines,ncloc") echo "new_code_b64=$(echo "$NEW_CODE" | base64 -w 0)" >> $GITHUB_OUTPUT echo "overall_b64=$(echo "$OVERALL" | base64 -w 0)" >> $GITHUB_OUTPUT @@ -109,6 +109,9 @@ jobs: ### Quality Gate: **${qualityGateStatus}** ### New Code + - Security rating on new code: ${newMetrics.software_quality_security_rating?.new} + - Reliability rating on new code: ${newMetrics.software_quality_reliability_rating?.new} + - Duplicated lines density (%) on new code: ${newMetrics.duplicated_lines_density?.new} - Bugs: ${newMetrics.bugs?.new} - Vulnerabilities: ${newMetrics.vulnerabilities?.new} - Code Smells: ${newMetrics.code_smells?.new} @@ -117,6 +120,9 @@ jobs: --- ### Overall Code + - Security Rating: ${overallMetrics.software_quality_security_rating?.overall} + - Reliability rating: ${overallMetrics.software_quality_reliability_rating?.overall} + - Duplicated lines density (%): ${overallMetrics.duplicated_lines_density?.overall} - Bugs: ${overallMetrics.bugs?.overall} - Vulnerabilities: ${overallMetrics.vulnerabilities?.overall} - Code Smells: ${overallMetrics.code_smells?.overall} From 789d2d96e19aa3eb701dea96013b4640f944f317 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 17:25:59 +0200 Subject: [PATCH 61/83] Update action.yaml --- .github/workflows/action.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 7706ff8f..26f3c6ba 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -62,10 +62,10 @@ jobs: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | NEW_CODE=$(curl -s -u "$SONAR_TOKEN:" \ - "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=software_quality_security_rating,software_quality_reliability_rating,duplicated_lines_density,bugs,vulnerabilities,code_smells,coverage&additionalFields=period") + "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=software_quality_security_rating,software_quality_reliability_rating,duplicated_lines_density,software_quality_reliability_issues,vulnerabilities,code_smells,coverage,security_hotspots&additionalFields=period") OVERALL=$(curl -s -u "$SONAR_TOKEN:" \ - "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=software_quality_security_rating,software_quality_reliability_rating,duplicated_lines_density,bugs,vulnerabilities,code_smells,coverage,lines,ncloc") + "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=software_quality_security_rating,software_quality_reliability_rating,duplicated_lines_density,software_quality_reliability_issues,vulnerabilities,code_smells,coverage,security_hotspots, potslines,ncloc") echo "new_code_b64=$(echo "$NEW_CODE" | base64 -w 0)" >> $GITHUB_OUTPUT echo "overall_b64=$(echo "$OVERALL" | base64 -w 0)" >> $GITHUB_OUTPUT @@ -112,10 +112,11 @@ jobs: - Security rating on new code: ${newMetrics.software_quality_security_rating?.new} - Reliability rating on new code: ${newMetrics.software_quality_reliability_rating?.new} - Duplicated lines density (%) on new code: ${newMetrics.duplicated_lines_density?.new} - - Bugs: ${newMetrics.bugs?.new} + - Bugs: ${newMetrics.software_quality_reliability_issues?.new} - Vulnerabilities: ${newMetrics.vulnerabilities?.new} - Code Smells: ${newMetrics.code_smells?.new} - Coverage: ${newMetrics.coverage?.new}% + - Security hotspots on new code ${newMetrics.security_hotspots?.new} --- @@ -123,10 +124,11 @@ jobs: - Security Rating: ${overallMetrics.software_quality_security_rating?.overall} - Reliability rating: ${overallMetrics.software_quality_reliability_rating?.overall} - Duplicated lines density (%): ${overallMetrics.duplicated_lines_density?.overall} - - Bugs: ${overallMetrics.bugs?.overall} + - Bugs: ${overallMetrics.software_quality_reliability_issues?.overall} - Vulnerabilities: ${overallMetrics.vulnerabilities?.overall} - Code Smells: ${overallMetrics.code_smells?.overall} - Coverage: ${overallMetrics.coverage?.overall}% + - Security hotspots ${overallMetrics.security_hotspots?.overall} - Lines: ${overallMetrics.lines?.overall} - ncloc: ${overallMetrics.ncloc?.overall} From 0ed8190fe0631d817188963cf691b5896a80ccae Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 17:30:31 +0200 Subject: [PATCH 62/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 26f3c6ba..133c9ca8 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -65,7 +65,7 @@ jobs: "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=software_quality_security_rating,software_quality_reliability_rating,duplicated_lines_density,software_quality_reliability_issues,vulnerabilities,code_smells,coverage,security_hotspots&additionalFields=period") OVERALL=$(curl -s -u "$SONAR_TOKEN:" \ - "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=software_quality_security_rating,software_quality_reliability_rating,duplicated_lines_density,software_quality_reliability_issues,vulnerabilities,code_smells,coverage,security_hotspots, potslines,ncloc") + "$SONAR_HOST_URL/api/measures/component?component=eschool-backend-final-project&metricKeys=software_quality_security_rating,software_quality_reliability_rating,duplicated_lines_density,software_quality_reliability_issues,vulnerabilities,code_smells,coverage,security_hotspots,lines,ncloc") echo "new_code_b64=$(echo "$NEW_CODE" | base64 -w 0)" >> $GITHUB_OUTPUT echo "overall_b64=$(echo "$OVERALL" | base64 -w 0)" >> $GITHUB_OUTPUT From bf5ac0c980cf9ac545b239a380b0c3eaa0395c75 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 18:31:58 +0200 Subject: [PATCH 63/83] Update action.yaml --- .github/workflows/action.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 133c9ca8..ec543fe3 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -40,6 +40,9 @@ jobs: -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ -DskipTests + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} - name: SonarQube Quality Gate check id: sonarqube-quality-gate-check From e24b0339a60adfb53a0a1f45331d6cb0b46d5996 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:57:52 +0200 Subject: [PATCH 64/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index ec543fe3..2b72e139 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -42,7 +42,7 @@ jobs: -DskipTests -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} + -Dsonar.pullrequest.base=master - name: SonarQube Quality Gate check id: sonarqube-quality-gate-check From b7c7848316e732c0eb98f96493b1f5bcd47865a0 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:06:06 +0200 Subject: [PATCH 65/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 2b72e139..dd309dc5 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -39,7 +39,7 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ - -DskipTests + -DskipTests \ -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ -Dsonar.pullrequest.branch=${{ github.head_ref }} \ -Dsonar.pullrequest.base=master From 7ee6c7ed805687da31ad2321c91c39365c18a263 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:08:46 +0200 Subject: [PATCH 66/83] Update action.yaml --- .github/workflows/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index dd309dc5..789e84b3 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -40,9 +40,9 @@ jobs: -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ -DskipTests \ - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - -Dsonar.pullrequest.base=master + # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + # -Dsonar.pullrequest.base=master - name: SonarQube Quality Gate check id: sonarqube-quality-gate-check From b8187ce9518ae14ed64d478e247b0bb3fd1bbfe1 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:11:08 +0200 Subject: [PATCH 67/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 789e84b3..5b9170e0 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -39,7 +39,7 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ - -DskipTests \ + -DskipTests # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ # -Dsonar.pullrequest.base=master From c65ca49ede76b9795ed4ca39b339c7b52d7ff7a4 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:14:56 +0200 Subject: [PATCH 68/83] Update action.yaml --- .github/workflows/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 5b9170e0..f6eab7cf 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -39,10 +39,10 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + -Dsonar.pullrequest.base=master \ -DskipTests - # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - # -Dsonar.pullrequest.base=master - name: SonarQube Quality Gate check id: sonarqube-quality-gate-check From 3089144b1df9a55c2ad09802a0d0658bcb97c2d7 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:25:08 +0200 Subject: [PATCH 69/83] Update action.yaml --- .github/workflows/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index f6eab7cf..39c52d6c 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -39,9 +39,9 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - -Dsonar.pullrequest.base=master \ + # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + # -Dsonar.pullrequest.base=master \ -DskipTests - name: SonarQube Quality Gate check From 36407093d4479a33498e8013dfe860c366d49e2a Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:34:15 +0200 Subject: [PATCH 70/83] Update action.yaml --- .github/workflows/action.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 39c52d6c..e828d3a5 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -39,10 +39,11 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ + -DskipTests # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ # -Dsonar.pullrequest.base=master \ - -DskipTests + - name: SonarQube Quality Gate check id: sonarqube-quality-gate-check From fb77a3590f2508b445be8f0fb43621fd8f4e07f3 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:38:51 +0200 Subject: [PATCH 71/83] Update action.yaml --- .github/workflows/action.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index e828d3a5..f6eab7cf 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -39,11 +39,10 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + -Dsonar.pullrequest.base=master \ -DskipTests - # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - # -Dsonar.pullrequest.base=master \ - - name: SonarQube Quality Gate check id: sonarqube-quality-gate-check From acd1288a281de834c043fbbe5b5917b5c3fa6524 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:54:50 +0200 Subject: [PATCH 72/83] Update action.yaml --- .github/workflows/action.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index f6eab7cf..d7315498 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -7,7 +7,7 @@ env: on: push: - branches: [ master ] + branches: [ master ] pull_request: workflow_dispatch: @@ -16,7 +16,7 @@ jobs: name: SonarQube Scan runs-on: ubuntu-latest if: github.event_name == 'pull_request' - + steps: - name: Checkout code uses: actions/checkout@v4 @@ -35,14 +35,19 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | + + BASE_BRANCH=master + mvn clean verify sonar:sonar \ -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - -Dsonar.pullrequest.base=master \ - -DskipTests + -Dsonar.pullrequest.base=$BASE_BRANCH \ + -DskipTests \ + -Dmaven.project.sourceRoots.warningsDisabled=true + - name: SonarQube Quality Gate check id: sonarqube-quality-gate-check From 61d8a5a3cda76a9c2098dbb850b29cd1e1ceb783 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Thu, 12 Feb 2026 21:05:23 +0200 Subject: [PATCH 73/83] Update action.yaml --- .github/workflows/action.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index d7315498..8cdea477 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -42,11 +42,11 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - -Dsonar.pullrequest.base=$BASE_BRANCH \ - -DskipTests \ - -Dmaven.project.sourceRoots.warningsDisabled=true + -DskipTests + # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + # -Dsonar.pullrequest.base=$BASE_BRANCH \ + - name: SonarQube Quality Gate check From 4953d820a87e374847129a0c01e928e67c9d9b6b Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Sat, 14 Feb 2026 11:03:43 +0200 Subject: [PATCH 74/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 8cdea477..f602a6b2 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -15,7 +15,7 @@ jobs: sonar: name: SonarQube Scan runs-on: ubuntu-latest - if: github.event_name == 'pull_request' + # if: github.event_name == 'pull_request' steps: - name: Checkout code From 505bb42fff93c4c49fb7b4e361a29017a3e3fa66 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Sat, 14 Feb 2026 11:16:58 +0200 Subject: [PATCH 75/83] Update action.yaml --- .github/workflows/action.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index f602a6b2..3dcec6f4 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -42,10 +42,11 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ + -Dsonar.pullrequest.base=master \ -DskipTests # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - # -Dsonar.pullrequest.base=$BASE_BRANCH \ + From d5ca6ff7aa7372f235d38eaf6cd037622ec5de49 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Sat, 14 Feb 2026 11:20:36 +0200 Subject: [PATCH 76/83] Update action.yaml --- .github/workflows/action.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 3dcec6f4..be3d7ab0 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -35,18 +35,14 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | - - BASE_BRANCH=master - mvn clean verify sonar:sonar \ -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ - -Dsonar.pullrequest.base=master \ + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + -Dsonar.pullrequest.base=master -DskipTests - # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - From 9e00f025a8b18e3d69e71e2b21b453072efbb751 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Sat, 14 Feb 2026 11:23:27 +0200 Subject: [PATCH 77/83] Update action.yaml --- .github/workflows/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index be3d7ab0..b5c5c2bb 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -41,7 +41,7 @@ jobs: -Dsonar.token=$SONAR_TOKEN \ -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - -Dsonar.pullrequest.base=master + -Dsonar.pullrequest.base=master \ -DskipTests From 59491f6e2101ec9e4779c83adfbc408513bd1d75 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Sat, 14 Feb 2026 11:35:09 +0200 Subject: [PATCH 78/83] Update action.yaml --- .github/workflows/action.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index b5c5c2bb..0a8bdef6 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -39,10 +39,11 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - -Dsonar.pullrequest.base=master \ -DskipTests + # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + # -Dsonar.pullrequest.base=master \ + From c83ddadc607e411b461363e83e13bf9b99010c1b Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Sat, 14 Feb 2026 11:37:52 +0200 Subject: [PATCH 79/83] Update action.yaml --- .github/workflows/action.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 0a8bdef6..6e67fde7 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -15,7 +15,7 @@ jobs: sonar: name: SonarQube Scan runs-on: ubuntu-latest - # if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' steps: - name: Checkout code @@ -39,13 +39,10 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + -Dsonar.pullrequest.base=master \ -DskipTests - # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - # -Dsonar.pullrequest.base=master \ - - - - name: SonarQube Quality Gate check id: sonarqube-quality-gate-check From 7623dd15974d38eca5d2cb635dc9ba2efa02889d Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Mon, 16 Feb 2026 10:09:57 +0200 Subject: [PATCH 80/83] Update action.yaml --- .github/workflows/action.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 6e67fde7..af2a717c 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -15,7 +15,7 @@ jobs: sonar: name: SonarQube Scan runs-on: ubuntu-latest - if: github.event_name == 'pull_request' + # if: github.event_name == 'pull_request' steps: - name: Checkout code @@ -39,10 +39,11 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - -Dsonar.pullrequest.base=master \ -DskipTests + # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + # -Dsonar.pullrequest.base=master \ + - name: SonarQube Quality Gate check id: sonarqube-quality-gate-check From e79bad0d7409d189e340d7c64d571ea1e0f24110 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Mon, 16 Feb 2026 10:16:22 +0200 Subject: [PATCH 81/83] Update action.yaml --- .github/workflows/action.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index af2a717c..24e344f3 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -15,7 +15,7 @@ jobs: sonar: name: SonarQube Scan runs-on: ubuntu-latest - # if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' steps: - name: Checkout code @@ -39,10 +39,11 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + -Dsonar.pullrequest.base=master \ -DskipTests - # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - # -Dsonar.pullrequest.base=master \ + - name: SonarQube Quality Gate check From ecc8f30b99c9d77cb3297fbf015098ac080f136e Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Mon, 16 Feb 2026 10:29:57 +0200 Subject: [PATCH 82/83] Update action.yaml --- .github/workflows/action.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 24e344f3..7f2a6916 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -15,7 +15,7 @@ jobs: sonar: name: SonarQube Scan runs-on: ubuntu-latest - if: github.event_name == 'pull_request' + # if: github.event_name == 'pull_request' steps: - name: Checkout code @@ -39,11 +39,12 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - -Dsonar.pullrequest.base=master \ -DskipTests + # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + # -Dsonar.pullrequest.base=master \ + - name: SonarQube Quality Gate check From 17a98dcd88a66d03bcae37c805f671d5628912e7 Mon Sep 17 00:00:00 2001 From: Yurii <144650492+YURIIOZHHO@users.noreply.github.com> Date: Mon, 16 Feb 2026 10:32:13 +0200 Subject: [PATCH 83/83] Update action.yaml --- .github/workflows/action.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index 7f2a6916..6e67fde7 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -15,7 +15,7 @@ jobs: sonar: name: SonarQube Scan runs-on: ubuntu-latest - # if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' steps: - name: Checkout code @@ -39,14 +39,11 @@ jobs: -Dsonar.projectKey=eschool-backend-final-project \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.token=$SONAR_TOKEN \ + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ + -Dsonar.pullrequest.branch=${{ github.head_ref }} \ + -Dsonar.pullrequest.base=master \ -DskipTests - # -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - # -Dsonar.pullrequest.branch=${{ github.head_ref }} \ - # -Dsonar.pullrequest.base=master \ - - - - name: SonarQube Quality Gate check id: sonarqube-quality-gate-check uses: sonarsource/sonarqube-quality-gate-action@master