diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 9e31981..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @splitio/sdk diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 20ebc25..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,7 +0,0 @@ -# Flutter plugin - -## What did you accomplish? - -## How do we test the changes introduced in this PR? - -## Extra Notes diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 0b1846b..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Build example app -on: - pull_request: - branches: - - main - - development - - '**_baseline' - -jobs: - build-android: - name: Build Android - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - - name: Build example app APK - run: cd splitio/example; flutter build apk - - test-android: - name: Test Android - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - - name: Run Pub Get - run: cd splitio/; flutter pub get - - name: Build Android - run: cd splitio/example/android/; flutter build apk - - name: Run Android test - run: cd splitio/example/android/; ./gradlew :splitio:testReleaseUnitTest; - - build-ios: - name: Build iOS - runs-on: [ macos-14 ] - - steps: - - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - - name: Run Build iOS - run: cd splitio/example/ios; flutter build ios --no-codesign; - - test-ios: - name: Test iOS - runs-on: [ macos-14 ] - - steps: - - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - - name: Run Build iOS - run: cd splitio_ios/example/; flutter build ios --no-codesign; - - - name: Select Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: 15.1.0 - - - name: ios - run: cd splitio_ios/example/ios; xcodebuild test -workspace "Runner.xcworkspace" -scheme "Runner" -destination "platform=iOS Simulator,name=iPhone 15,OS=17.4" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO ONLY_ACTIVE_ARCH=NO; - - build-web: - name: Build Web - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - - name: Build Web - run: cd splitio/example; flutter build web - - test-web: - name: Test Web - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - - name: Build Web - run: cd splitio/example; flutter build web - - name: Run Web test - run: cd splitio/example; flutter test --platform=chrome diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 3a4a238..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: dart test -on: - push: - branches: - - '*' - -jobs: - test-dart: - name: Test dart - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - - name: Run Pub Get - run: cd splitio/; flutter pub get - - name: Run flutter test - run: cd splitio/; flutter test - - name: Run flutter splitio_android test - run: cd splitio_android/; flutter test - - name: Run flutter splitio_ios test - run: cd splitio_ios/; flutter test - - name: Run flutter splitio_web test - run: cd splitio_web/; flutter test --platform=chrome diff --git a/.github/workflows/update-notice-year.yml b/.github/workflows/update-notice-year.yml deleted file mode 100644 index 440dacb..0000000 --- a/.github/workflows/update-notice-year.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Update Notice 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 NOTICE - uses: jacobtomlinson/gha-find-replace@v3 - with: - find: ${{ env.PREVIOUS }} - replace: ${{ env.CURRENT }} - include: "NOTICE" - 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 Notice Year" -a - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: Update Notice Year - branch: update-notice diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/fluttersdkplugin/input_sets/fluttersdkplugininputset.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/fluttersdkplugin/input_sets/fluttersdkplugininputset.yaml new file mode 100644 index 0000000..2285838 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/fluttersdkplugin/input_sets/fluttersdkplugininputset.yaml @@ -0,0 +1,14 @@ +inputSet: + name: flutter-sdk-plugin-inputset + identifier: fluttersdkplugininputset + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: fluttersdkplugin + properties: + ci: + codebase: + build: + type: branch + spec: + branch: <+trigger.sourceBranch> diff --git a/.harness/pipeline.yaml b/.harness/pipeline.yaml new file mode 100644 index 0000000..2c1934a --- /dev/null +++ b/.harness/pipeline.yaml @@ -0,0 +1,170 @@ +pipeline: + name: flutter-sdk-plugin-repo + identifier: fluttersdkplugin + projectIdentifier: Harness_Split + orgIdentifier: PROD + tags: {} + properties: + ci: + codebase: + connectorRef: fmegithubharnessgitops + repoName: flutter-sdk-plugin + build: + type: branch + spec: + branch: <+input> + stages: + - stage: + name: Build and Test + identifier: Build_and_Test + description: "" + type: CI + spec: + cloneCodebase: true + caching: + enabled: true + override: true + platform: + os: Linux + arch: Amd64 + runtime: + type: Cloud + spec: + size: flex + execution: + steps: + - step: + type: Run + name: Install Java + identifier: Install_Java + spec: + shell: Sh + command: |- + apt-get install -y openjdk-17-jdk -qq + java -version + - step: + type: Run + name: Install Flutter + identifier: Install_Flutter + spec: + shell: Bash + command: |- + git clone https://github.com/flutter/flutter.git -b stable --depth 1 $HOME/flutter + export PATH="$HOME/flutter/bin:$PATH" + flutter --version + flutter config --no-analytics + flutter precache + - step: + type: Run + name: Test splitio + identifier: Test_splitio + spec: + shell: Bash + command: |- + export PATH="$HOME/flutter/bin:$PATH" + cd splitio + flutter pub get + flutter test + - step: + type: Run + name: Test splitio_android + identifier: Test_splitio_android + spec: + shell: Bash + command: |- + export PATH="$HOME/flutter/bin:$PATH" + cd splitio_android + flutter pub get + flutter test + - step: + type: Run + name: Test splitio_ios + identifier: Test_splitio_ios + spec: + shell: Bash + command: |- + export PATH="$HOME/flutter/bin:$PATH" + cd splitio_ios + flutter pub get + flutter test + - step: + type: Run + name: Test splitio_web + identifier: Test_splitio_web + spec: + shell: Bash + command: |- + export PATH="$HOME/flutter/bin:$PATH" + cd splitio_web + flutter pub get + flutter test --platform=chrome + - step: + type: Run + name: SonarQube Scan + identifier: SonarQube_Scan + when: + stageStatus: Success + condition: <+matrix.sdkVersion> == "stable" + spec: + shell: Sh + command: |- + export SONAR_SCANNER_VERSION=5.0.1.3006 + curl -sSLo sonar-scanner.zip \ + "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip" + unzip -q sonar-scanner.zip + export PATH="$PWD/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin:$PATH" + apt-get install -y openjdk-17-jdk -qq + sonar-scanner \ + -Dsonar.projectKey=flutter-sdk-plugin \ + -Dsonar.sources=splitio/lib,splitio_android/lib,splitio_ios/lib,splitio_web/lib,splitio_platform_interface/lib \ + -Dsonar.tests=splitio/test,splitio_android/test,splitio_ios/test,splitio_web/test,splitio_platform_interface/test \ + -Dsonar.host.url=https://sonar.harness.io \ + -Dsonar.token=<+secrets.getValue("sonarqube-token")> \ + -Dsonar.exclusions="**/example/**,**/.dart_tool/**,**/build/**" + - step: + type: Run + name: Post Quality Gate + identifier: Post_Quality_Gate + when: + stageStatus: Success + condition: <+matrix.sdkVersion> == "stable" + spec: + shell: Bash + command: |- + #!/bin/bash + set -e + + SONAR_TOKEN="<+secrets.getValue("sonarqube-token")>" + SONAR_URL="https://sonar.harness.io" + SONAR_PROJECT_KEY="flutter-sdk-plugin" + GITHUB_TOKEN="<+secrets.getValue("github-devops-token")>" + GITHUB_REPO="flutter-sdk-plugin" + COMMIT_SHA="<+codebase.commitSha>" + + STATUS_JSON=$(curl -sf \ + -H "Authorization: Bearer ${SONAR_TOKEN}" \ + "${SONAR_URL}/api/qualitygates/project_status?projectKey=${SONAR_PROJECT_KEY}") + + QG_STATUS=$(echo "$STATUS_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['projectStatus']['status'])") + + case "$QG_STATUS" in + OK) GH_STATE="success"; DESCRIPTION="Quality gate passed" ;; + ERROR) GH_STATE="failure"; DESCRIPTION="Quality gate failed" ;; + WARN) GH_STATE="success"; DESCRIPTION="Quality gate passed with warnings" ;; + *) GH_STATE="pending"; DESCRIPTION="Quality gate status unknown" ;; + esac + + TARGET_URL="${SONAR_URL}/dashboard?id=${SONAR_PROJECT_KEY}" + + curl -sf -X POST \ + -H "Authorization: token ${GITHUB_TOKEN}" \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Content-Type: application/json" \ + -d "{\"state\":\"${GH_STATE}\",\"description\":\"${DESCRIPTION}\",\"context\":\"sonarqube/quality-gate\",\"target_url\":\"${TARGET_URL}\"}" \ + "https://api.github.com/repos/splitio/${GITHUB_REPO}/statuses/${COMMIT_SHA}" + + echo "Posted SonarQube quality gate status: ${GH_STATE}" + strategy: + matrix: + sdkVersion: + - "stable"