diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 9e3198100..000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @splitio/sdk diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index b43f4a5dc..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: ci - -on: - push: - branches: - - '**' - pull_request: - branches: - - master - - development - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - test: - name: Test - runs-on: ubuntu-latest - services: - redis: - image: redis - ports: - - 6379:6379 - strategy: - fail-fast: false - matrix: - jdk: - - '8' - - '11' - - '19' - env: - SONARQUBE_HOST_URL: ${{ vars.SONARQUBE_HOST }} - ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} - ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} - MAVEN_OPTS: "-XX:InitialHeapSize=2G -XX:MaxHeapSize=2G -XX:+PrintCommandLineFlags -XX:ThreadStackSize=65536 -XX:-TieredCompilation -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" - muteProps: "true" - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup JDK ${{ matrix.jdk }} - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: ${{ matrix.jdk }} - - - name: Setup Maven - run: cp .ci.settings.xml ${HOME}/.m2/settings.xml - - - name: Test - if: matrix.jdk == '8' && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' - run: mvn --batch-mode clean install - - - name: Linter - if: matrix.jdk == '8' && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' - run: mvn checkstyle::check - -# - name: Deploy -# if: matrix.jdk == '8' && github.event_name == 'push' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' -# run: mvn --batch-mode deploy -P test - - - name: SonarQube Scan (Push) - if: matrix.jdk == '11' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development') - run: | - mvn --batch-mode clean verify sonar:sonar \ - -Dsonar.branch.name=${{ github.ref_name }} - - - name: SonarQube Scan (Pull Request) - if: matrix.jdk == '11' && github.event_name == 'pull_request' - run: | - mvn --batch-mode clean verify sonar:sonar \ - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ - -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} \ - -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} diff --git a/.github/workflows/update-license-year.yml b/.github/workflows/update-license-year.yml deleted file mode 100644 index 7e0a945f9..000000000 --- a/.github/workflows/update-license-year.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Update License Year - -on: - schedule: - - cron: "0 3 1 1 *" # 03:00 AM on January 1 - -permissions: - contents: write - pull-requests: write - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set Current year - run: "echo CURRENT=$(date +%Y) >> $GITHUB_ENV" - - - name: Set Previous Year - run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV" - - - name: Update LICENSE - uses: jacobtomlinson/gha-find-replace@v3 - with: - find: ${{ env.PREVIOUS }} - replace: ${{ env.CURRENT }} - include: "LICENSE" - regex: false - - - name: Commit files - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git commit -m "Updated License Year" -a - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: Update License Year - branch: update-license diff --git a/.github/linter/checkstyle-suppressions.xml b/.harness/linter/checkstyle-suppressions.xml similarity index 100% rename from .github/linter/checkstyle-suppressions.xml rename to .harness/linter/checkstyle-suppressions.xml diff --git a/.github/linter/google-java-style.xml b/.harness/linter/google-java-style.xml similarity index 100% rename from .github/linter/google-java-style.xml rename to .harness/linter/google-java-style.xml diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/java_client_ci.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/java_client_ci.yaml new file mode 100644 index 000000000..208567715 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/java_client_ci.yaml @@ -0,0 +1,109 @@ +pipeline: + name: java-client-ci + identifier: java_client_ci + projectIdentifier: Harness_Split + orgIdentifier: PROD + tags: {} + properties: + ci: + codebase: + connectorRef: fmegithubrunnersci + repoName: java-client + build: <+input> + depth: 0 + stages: + - stage: + name: test + identifier: test + type: CI + spec: + cloneCodebase: true + caching: + enabled: true + override: true + platform: + os: Linux + arch: Amd64 + runtime: + type: Cloud + spec: {} + execution: + steps: + # JDK 8: build + test + checkstyle (PR only) + - step: + type: Run + name: test jdk8 + identifier: test_jdk8 + spec: + connectorRef: dockerhub + image: maven:3.9-eclipse-temurin-8 + shell: Bash + envVariables: + MAVEN_OPTS: "-XX:InitialHeapSize=2G -XX:MaxHeapSize=2G -XX:+PrintCommandLineFlags -XX:ThreadStackSize=65536 -XX:-TieredCompilation -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" + command: |- + apt-get update -qq && apt-get install -y --no-install-recommends redis-server + redis-server --daemonize yes + for i in $(seq 1 30); do + redis-cli ping 2>/dev/null | grep -q PONG && { echo "Redis is up"; break; } + echo "Waiting for Redis... ($i/30)"; sleep 1 + done + mkdir -p ${HOME}/.m2 && cp .ci.settings.xml ${HOME}/.m2/settings.xml + mvn --batch-mode clean install + when: + stageStatus: Success + condition: <+codebase.build.type> == "PR" + # JDK 8: checkstyle (PR only) + - step: + type: Run + name: checkstyle jdk8 + identifier: checkstyle_jdk8 + spec: + connectorRef: dockerhub + image: maven:3.9-eclipse-temurin-8 + shell: Bash + envVariables: + MAVEN_OPTS: "-XX:InitialHeapSize=2G -XX:MaxHeapSize=2G -XX:+PrintCommandLineFlags -XX:ThreadStackSize=65536 -XX:-TieredCompilation -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" + command: mvn --batch-mode checkstyle:check + when: + stageStatus: Success + condition: <+codebase.build.type> == "PR" + # JDK 11: Sonar (PR and push to master/development) + - step: + type: Run + name: sonar analysis + identifier: sonar_analysis + spec: + connectorRef: dockerhub + image: maven:3.9-eclipse-temurin-11 + shell: Bash + envVariables: + MAVEN_OPTS: "-XX:InitialHeapSize=2G -XX:MaxHeapSize=2G -XX:+PrintCommandLineFlags -XX:ThreadStackSize=65536 -XX:-TieredCompilation -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" + SONAR_HOST_URL: https://sonar.harness.io + SONAR_TOKEN: <+secrets.getValue("sonarqube-token")> + PR_NUMBER: <+trigger.prNumber> + PR_BRANCH: <+trigger.sourceBranch> + PR_BASE_BRANCH: <+trigger.targetBranch> + BRANCH_NAME: <+trigger.branch> + command: |- + apt-get update -qq && apt-get install -y --no-install-recommends redis-server + redis-server --daemonize yes + for i in $(seq 1 30); do + redis-cli ping 2>/dev/null | grep -q PONG && { echo "Redis is up"; break; } + echo "Waiting for Redis... ($i/30)"; sleep 1 + done + mkdir -p ${HOME}/.m2 && cp .ci.settings.xml ${HOME}/.m2/settings.xml + if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "null" ]; then + mvn --batch-mode clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -Dsonar.host.url="$SONAR_HOST_URL" \ + -Dsonar.token="$SONAR_TOKEN" \ + -Dsonar.pullrequest.key="$PR_NUMBER" \ + -Dsonar.pullrequest.branch="$PR_BRANCH" \ + -Dsonar.pullrequest.base="$PR_BASE_BRANCH" + else + mvn --batch-mode clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -Dsonar.host.url="$SONAR_HOST_URL" \ + -Dsonar.token="$SONAR_TOKEN" \ + -Dsonar.branch.name="$BRANCH_NAME" + fi + when: + stageStatus: Success diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/java_client_ci/input_sets/pr.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/java_client_ci/input_sets/pr.yaml new file mode 100644 index 000000000..799b2126a --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/java_client_ci/input_sets/pr.yaml @@ -0,0 +1,14 @@ +inputSet: + name: pr + identifier: pr + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: java_client_ci + properties: + ci: + codebase: + build: + type: PR + spec: + number: <+trigger.prNumber> diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/java_client_ci/input_sets/push.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/java_client_ci/input_sets/push.yaml new file mode 100644 index 000000000..58e96c1e4 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/java_client_ci/input_sets/push.yaml @@ -0,0 +1,14 @@ +inputSet: + name: push + identifier: push + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: java_client_ci + properties: + ci: + codebase: + build: + type: branch + spec: + branch: <+trigger.branch> diff --git a/pom.xml b/pom.xml index b388caf0e..271ba1717 100644 --- a/pom.xml +++ b/pom.xml @@ -127,7 +127,7 @@ - .github/linter/google-java-style.xml + .harness/linter/google-java-style.xml warning true