diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4eb174092ded9c020038e6a21c69031d3447a588..3954f4d67d501539d1d5bc66f9d9915a94d55ff3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,105 +8,105 @@ cache: &global_cache policy: pull-push stages: - - lint - - build - - test + # - lint + # - build + # - test - release - deploy - - e2e + # - e2e before_script: - export NG_CLI_ANALYTICS="false" - export MAVEN_USER_HOME=`pwd`/.maven -pmdCheckstylePrettierLint: - stage: lint - cache: [] - when: always - script: - - 'export VERSION="6.40.0"' - - 'wget "https://github.com/pmd/pmd/releases/download/pmd_releases%2F$VERSION/pmd-bin-$VERSION.zip"' - - 'jar -xf "pmd-bin-$VERSION.zip"' - - 'chmod u+x "pmd-bin-$VERSION/bin/run.sh"' - - SUCCESS=true - - echo "Running PMD" - - '"pmd-bin-$VERSION/bin/run.sh" pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log || SUCCESS=false' - - echo "Running checkstyle" - - ./mvnw -ntp checkstyle:check -Dmaven.repo.local=$MAVEN_USER_HOME || SUCCESS=false - - echo "Running prettier" - - npm install - - npm run prettier:check - - echo "Running eslint" - - 'npm run lint | tee lint.log' - - "! grep -qE '✖ [0-9]+ problem' lint.log || SUCCESS=false" - - $SUCCESS - needs: [] - artifacts: - when: on_failure - expire_in: 30 days - paths: - - pmd.log +# pmdCheckstylePrettierLint: +# stage: lint +# cache: [] +# when: always +# script: +# - 'export VERSION="6.40.0"' +# - 'wget "https://github.com/pmd/pmd/releases/download/pmd_releases%2F$VERSION/pmd-bin-$VERSION.zip"' +# - 'jar -xf "pmd-bin-$VERSION.zip"' +# - 'chmod u+x "pmd-bin-$VERSION/bin/run.sh"' +# - SUCCESS=true +# - echo "Running PMD" +# - '"pmd-bin-$VERSION/bin/run.sh" pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log || SUCCESS=false' +# - echo "Running checkstyle" +# - ./mvnw -ntp checkstyle:check -Dmaven.repo.local=$MAVEN_USER_HOME || SUCCESS=false +# - echo "Running prettier" +# - npm install +# - npm run prettier:check +# - echo "Running eslint" +# - 'npm run lint | tee lint.log' +# - "! grep -qE '✖ [0-9]+ problem' lint.log || SUCCESS=false" +# - $SUCCESS +# needs: [] +# artifacts: +# when: on_failure +# expire_in: 30 days +# paths: +# - pmd.log -maven-compile: - stage: build - script: - - ./mvnw -ntp compile -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME - artifacts: - paths: - - target/classes/ - - target/generated-sources/ - expire_in: 15 days - needs: [] - cache: [] +# maven-compile: +# stage: build +# script: +# - ./mvnw -ntp compile -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME +# artifacts: +# paths: +# - target/classes/ +# - target/generated-sources/ +# expire_in: 15 days +# needs: [] +# cache: [] -maven-test: - services: - - docker:20-dind - variables: - DOCKER_HOST: 'tcp://docker:2375' - DOCKER_TLS_CERTDIR: '' - stage: test - cache: - # inherit all global cache settings - <<: *global_cache - # override the policy - policy: pull - script: - - ./mvnw -ntp verify -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME -Dspring.profiles.active=testcontainers - allow_failure: true - artifacts: - reports: - junit: - - target/surefire-reports/TEST-*.xml - - target/failsafe-reports/TEST-*.xml - paths: - - target/surefire-reports - - target/failsafe-reports - - target/site - when: always - expire_in: 15 days - needs: [] +# maven-test: +# services: +# - docker:20-dind +# variables: +# DOCKER_HOST: 'tcp://docker:2375' +# DOCKER_TLS_CERTDIR: '' +# stage: test +# cache: +# # inherit all global cache settings +# <<: *global_cache +# # override the policy +# policy: pull +# script: +# - ./mvnw -ntp verify -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME -Dspring.profiles.active=testcontainers +# allow_failure: true +# artifacts: +# reports: +# junit: +# - target/surefire-reports/TEST-*.xml +# - target/failsafe-reports/TEST-*.xml +# paths: +# - target/surefire-reports +# - target/failsafe-reports +# - target/site +# when: always +# expire_in: 15 days +# needs: [] -frontend-test: - stage: test - cache: - <<: *global_cache - policy: pull - script: - - npm test - artifacts: - reports: - junit: target/test-results/TESTS-results-jest.xml - paths: - - target/test-results - - target/jacoco - when: always - expire_in: 15 days - needs: [] - before_script: - - export NG_CLI_ANALYTICS="false" - - export MAVEN_USER_HOME=`pwd`/.maven - - npm ci --cache .npm --prefer-offline +# frontend-test: +# stage: test +# cache: +# <<: *global_cache +# policy: pull +# script: +# - npm test +# artifacts: +# reports: +# junit: target/test-results/TESTS-results-jest.xml +# paths: +# - target/test-results +# - target/jacoco +# when: always +# expire_in: 15 days +# needs: [] +# before_script: +# - export NG_CLI_ANALYTICS="false" +# - export MAVEN_USER_HOME=`pwd`/.maven +# - npm ci --cache .npm --prefer-offline docker-build: stage: release @@ -114,9 +114,9 @@ docker-build: # only: # refs: # - development - dependencies: - - maven-test - - frontend-test + # dependencies: + # - maven-test + # - frontend-test before_script: - mkdir -p ~/.ssh - echo "${SSH_BKY_DEPLOY}" > ~/.ssh/id_rsa @@ -149,45 +149,44 @@ deploy: script: - ssh contDeploy@codeability-austria -p 1022 "cd gitsearch2/gitsearch && git pull && cd src/main/docker/ && docker pull sharing-codeability.uibk.ac.at:5051/sharing/codeability-sharing-platform/gitsearch && GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` COMMIT_ID=`git rev-parse HEAD` SPRING_PROFILES_ACTIVE=staging,swagger docker-compose -f gitsearch.yml up -d --no-deps --build --force-recreate gitsearch-app && exit" when: on_success +# e2e-test: +# stage: e2e +# cache: +# # inherit all global cache settings +# <<: *global_cache +# # override the policy +# policy: pull +# # only: +# # refs: +# # - development +# services: +# - selenium/standalone-chrome +# dependencies: +# - deploy +# script: +# - npm install +# - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb +# - dpkg -i google-chrome*.deb +# - export JHI_E2E_HEADLESS=true +# - export E2E_PASSWORD=$E2E_PASSWORD +# - npm run e2e --host=selenium__standalone-chrome +# when: on_success -e2e-test: - stage: e2e - cache: - # inherit all global cache settings - <<: *global_cache - # override the policy - policy: pull - # only: - # refs: - # - development - services: - - selenium/standalone-chrome - dependencies: - - deploy - script: - - npm install - - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - - dpkg -i google-chrome*.deb - - export JHI_E2E_HEADLESS=true - - export E2E_PASSWORD=$E2E_PASSWORD - - npm run e2e --host=selenium__standalone-chrome - when: on_success - -sonar-analyze: - stage: test - cache: - # inherit all global cache settings - <<: *global_cache - # override the policy - policy: pull - dependencies: - - maven-test - - frontend-test - script: - - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://qe-sonarqube.uibk.ac.at/ -Dsonar.login=${SONAR_TOKEN_QE} -Dmaven.repo.local=$MAVEN_USER_HOME - # - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://server.arctis.at/sonar/ -Dsonar.login=${SONAR_TOKEN} -Dmaven.repo.local=$MAVEN_USER_HOME - allow_failure: true - before_script: - - export NG_CLI_ANALYTICS="false" - - export MAVEN_USER_HOME=`pwd`/.maven - - npm ci --cache .npm --prefer-offline +# sonar-analyze: +# stage: test +# cache: +# # inherit all global cache settings +# <<: *global_cache +# # override the policy +# policy: pull +# dependencies: +# - maven-test +# - frontend-test +# script: +# - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://qe-sonarqube.uibk.ac.at/ -Dsonar.login=${SONAR_TOKEN_QE} -Dmaven.repo.local=$MAVEN_USER_HOME +# # - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://server.arctis.at/sonar/ -Dsonar.login=${SONAR_TOKEN} -Dmaven.repo.local=$MAVEN_USER_HOME +# allow_failure: true +# before_script: +# - export NG_CLI_ANALYTICS="false" +# - export MAVEN_USER_HOME=`pwd`/.maven +# - npm ci --cache .npm --prefer-offline diff --git a/src/main/docker/gitsearch.yml b/src/main/docker/gitsearch.yml index 1ab5f2eae1016f0d6c4d52901fce9db50d09967d..ba27c990e2d5e218435239d6831a7263f1a64f76 100644 --- a/src/main/docker/gitsearch.yml +++ b/src/main/docker/gitsearch.yml @@ -46,34 +46,34 @@ services: restart: always networks: - backend - keycloak: - image: jboss/keycloak:16.1.0 - command: - [ - '-b', - '0.0.0.0', - '-Dkeycloak.migration.action=import', - '-Dkeycloak.migration.provider=dir', - '-Dkeycloak.migration.dir=/opt/jboss/keycloak/realm-config', - '-Dkeycloak.migration.strategy=OVERWRITE_EXISTING', - '-Djboss.socket.binding.port-offset=1000', - '-Dkeycloak.profile.feature.upload_scripts=enabled', - ] - volumes: - - ./realm-config:/opt/jboss/keycloak/realm-config - environment: - - KEYCLOAK_USER=admin - - KEYCLOAK_PASSWORD=admin - - DB_VENDOR=h2 - # If you want to expose these ports outside your dev PC, - # remove the "127.0.0.1:" prefix - ports: - - 127.0.0.1:9080:9080 - - 127.0.0.1:9443:9443 - - 127.0.0.1:10990:10990 - networks: - - backend - - frontend + # keycloak: + # image: jboss/keycloak:16.1.0 + # command: + # [ + # '-b', + # '0.0.0.0', + # '-Dkeycloak.migration.action=import', + # '-Dkeycloak.migration.provider=dir', + # '-Dkeycloak.migration.dir=/opt/jboss/keycloak/realm-config', + # '-Dkeycloak.migration.strategy=OVERWRITE_EXISTING', + # '-Djboss.socket.binding.port-offset=1000', + # '-Dkeycloak.profile.feature.upload_scripts=enabled', + # ] + # volumes: + # - ./realm-config:/opt/jboss/keycloak/realm-config + # environment: + # - KEYCLOAK_USER=admin + # - KEYCLOAK_PASSWORD=admin + # - DB_VENDOR=h2 + # # If you want to expose these ports outside your dev PC, + # # remove the "127.0.0.1:" prefix + # ports: + # - 127.0.0.1:9080:9080 + # - 127.0.0.1:9443:9443 + # - 127.0.0.1:10990:10990 + # networks: + # - backend + # - frontend networks: frontend: name: sharing_frontend diff --git a/src/main/java/at/ac/uibk/gitsearch/repository/SavedSearchesRepository.java b/src/main/java/at/ac/uibk/gitsearch/repository/SavedSearchesRepository.java index 19269d52758f8d3766530486c7c2bfec4ec0f0d0..bdba9f25260d930793c5513f07a70b9f272b7587 100644 --- a/src/main/java/at/ac/uibk/gitsearch/repository/SavedSearchesRepository.java +++ b/src/main/java/at/ac/uibk/gitsearch/repository/SavedSearchesRepository.java @@ -8,7 +8,6 @@ import org.springframework.stereotype.Repository; /** * Spring Data SQL repository for the SavedSearches entity. */ -@SuppressWarnings("unused") @Repository public interface SavedSearchesRepository extends JpaRepository<SavedSearches, Long> { @Query("select savedSearches from SavedSearches savedSearches where savedSearches.user.login = ?#{principal.username}") diff --git a/src/main/java/at/ac/uibk/gitsearch/repository/UserRepository.java b/src/main/java/at/ac/uibk/gitsearch/repository/UserRepository.java index bf9d17f358aa8e1c6ab5b271a62d407d1ea48867..c009a984579b6863b032e99082a7dd1a9dba31da 100644 --- a/src/main/java/at/ac/uibk/gitsearch/repository/UserRepository.java +++ b/src/main/java/at/ac/uibk/gitsearch/repository/UserRepository.java @@ -15,7 +15,6 @@ import org.springframework.stereotype.Repository; * Spring Data JPA repository for the {@link User} entity. */ @Repository -@SuppressWarnings("PMD") public interface UserRepository extends JpaRepository<User, Long> { String USERS_BY_LOGIN_CACHE = "usersByLogin";