From 5e478c7a6ee1aac7ce7e43505221afa74914f264 Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Fri, 31 Jul 2026 11:34:33 -0300 Subject: [PATCH 1/9] Add harness ci --- .../Harness_Split/pipelines/reactclient.yaml | 173 ++++++++++++++++++ .../input_sets/reactclient_push.yaml | 14 ++ .../input_sets/reactclientinputset.yaml | 14 ++ .../pipelines/reactclient_cd_s3.yaml | 115 ++++++++++++ .../input_sets/reactclient_cd_s3_push.yaml | 14 ++ 5 files changed, 330 insertions(+) create mode 100644 .harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml create mode 100644 .harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclient_push.yaml create mode 100644 .harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclientinputset.yaml create mode 100644 .harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3.yaml create mode 100644 .harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3/input_sets/reactclient_cd_s3_push.yaml diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml new file mode 100644 index 0000000..64634e7 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml @@ -0,0 +1,173 @@ +pipeline: + name: react-client-repo + identifier: reactclient + projectIdentifier: Harness_Split + orgIdentifier: PROD + tags: {} + properties: + ci: + codebase: + connectorRef: fmegithubharnessgitops + repoName: react-client + build: <+input> + depth: 0 + 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 Node + identifier: Install_Node + spec: + shell: Bash + command: |- + curl https://mise.run | sh + export PATH="$HOME/.local/bin:$PATH" + mise use --global node@<+matrix.nodeVersion> + node --version + npm --version + - step: + type: Run + name: Install Dependencies + identifier: Install_Dependencies + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + npm ci + - step: + type: Run + name: Run Checks + identifier: Run_Checks + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + npm run check + - step: + type: Run + name: Run Tests + identifier: Run_Tests + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + npm run test + - step: + type: Run + name: Run Build + identifier: Run_Build + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + BUILD_BRANCH=<+codebase.branch> npm run build + - step: + type: Run + name: SonarQube Scan + identifier: SonarQube_Scan + when: + stageStatus: Success + condition: <+matrix.nodeVersion> == "lts" + spec: + connectorRef: account.harnessImage + image: sonarsource/sonar-scanner-cli + shell: Bash + command: | + set -euo pipefail + + COMMON_ARGS=" + -Dsonar.host.url=https://sonar.harness.io + -Dsonar.token=$SONAR_TOKEN + -Dsonar.projectKey=react-client + -Dsonar.sources=src + -Dsonar.tests=src/__tests__ + -Dsonar.exclusions=**/node_modules/**,**/umd/**,**/es/**,**/lib/**,src/__tests__/** + -Dsonar.scanner.skipJreProvisioning=true + -Dsonar.scanner.skipSystemTruststore=true + " + + if [ "<+codebase.prNumber>" != "" ] && [ "<+codebase.prNumber>" != "null" ]; then + echo "Pull Request Analysis" + sonar-scanner \ + $COMMON_ARGS \ + -Dsonar.pullrequest.key=<+codebase.prNumber> \ + -Dsonar.pullrequest.branch=<+codebase.sourceBranch> \ + -Dsonar.pullrequest.base=<+codebase.targetBranch> + else + echo "Branch Analysis" + sonar-scanner \ + $COMMON_ARGS \ + -Dsonar.branch.name=<+codebase.branch> + fi + envVariables: + SONAR_TOKEN: <+secrets.getValue("sonarqube-token")> + timeout: 10m + - step: + type: Run + name: Post Quality Gate + identifier: Post_Quality_Gate + when: + stageStatus: Success + condition: <+matrix.nodeVersion> == "lts" + spec: + shell: Bash + command: |- + #!/bin/bash + set -e + + SONAR_TOKEN="<+secrets.getValue("sonarqube-token")>" + SONAR_URL="https://sonar.harness.io" + SONAR_PROJECT_KEY="react-client" + GITHUB_TOKEN="<+secrets.getValue("github-devops-token")>" + GITHUB_REPO="react-client" + 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: + nodeVersion: + - "lts" diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclient_push.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclient_push.yaml new file mode 100644 index 0000000..d768ae6 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclient_push.yaml @@ -0,0 +1,14 @@ +inputSet: + name: reactclient_push + identifier: reactclient_push + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: reactclient + properties: + ci: + codebase: + build: + type: branch + spec: + branch: <+trigger.branch> diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclientinputset.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclientinputset.yaml new file mode 100644 index 0000000..34a0290 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclientinputset.yaml @@ -0,0 +1,14 @@ +inputSet: + name: reactclientinputset + identifier: reactclientinputset + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: reactclient + properties: + ci: + codebase: + build: + type: PR + spec: + number: <+trigger.prNumber> diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3.yaml new file mode 100644 index 0000000..1f56797 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3.yaml @@ -0,0 +1,115 @@ +pipeline: + name: reactclient_cd_s3 + identifier: reactclient_cd_s3 + projectIdentifier: Harness_Split + orgIdentifier: PROD + tags: {} + properties: + ci: + codebase: + connectorRef: fmegithubharnessgitops + repoName: react-client + build: <+input> + stages: + - stage: + name: Deploy to Stage + identifier: Deploy_to_Stage + type: CI + when: + pipelineStatus: Success + condition: <+codebase.branch> == "development" + spec: + cloneCodebase: true + buildIntelligence: + enabled: false + execution: + steps: + - step: + type: Run + name: Build Release Assets + identifier: Build_Release_Assets + spec: + connectorRef: account.harnessImage + image: node:lts + shell: Bash + command: |- + npm ci + npm run build + - step: + type: Run + name: Deploy to S3 + identifier: Deploy_to_S3 + when: + stageStatus: Success + condition: <+trigger.event> == "PUSH" + spec: + connectorRef: account.harnessImage + image: amazon/aws-cli:2.31.5 + shell: Bash + command: |- + aws s3 sync ./umd s3://split-public-stage/sdk \ + --acl public-read --follow-symlinks --cache-control max-age=31536000,public + envVariables: + AWS_DEFAULT_REGION: us-east-1 + infrastructure: + type: KubernetesDirect + spec: + connectorRef: use1prod1cd + namespace: harness-delegate + serviceAccountName: use1-prod-1-reactclient-stage + automountServiceAccountToken: false + nodeSelector: {} + os: Linux + delegateSelectors: + - use1-prod-1-cd + - stage: + name: Deploy to Prod + identifier: Deploy_to_Prod + type: CI + when: + pipelineStatus: Success + condition: <+codebase.branch> == "main" + spec: + cloneCodebase: true + buildIntelligence: + enabled: false + execution: + steps: + - step: + type: Run + name: Build Release Assets + identifier: Build_Release_Assets + spec: + connectorRef: account.harnessImage + image: node:lts + shell: Bash + command: |- + npm ci + npm run build + - step: + type: Run + name: Deploy to S3 + identifier: Deploy_to_S3 + when: + stageStatus: Success + condition: <+trigger.event> == "PUSH" + spec: + connectorRef: account.harnessImage + image: amazon/aws-cli:2.31.5 + shell: Bash + command: |- + aws s3 sync ./umd s3://split-public/sdk \ + --acl public-read --follow-symlinks --cache-control max-age=31536000,public + envVariables: + AWS_DEFAULT_REGION: us-east-1 + infrastructure: + type: KubernetesDirect + spec: + connectorRef: use1prod1cd + namespace: harness-delegate + serviceAccountName: use1-prod-1-reactclient-prod + automountServiceAccountToken: false + nodeSelector: {} + os: Linux + delegateSelectors: + - use1-prod-1-cd diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3/input_sets/reactclient_cd_s3_push.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3/input_sets/reactclient_cd_s3_push.yaml new file mode 100644 index 0000000..afc8d83 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3/input_sets/reactclient_cd_s3_push.yaml @@ -0,0 +1,14 @@ +inputSet: + name: reactclient_cd_s3_push + identifier: reactclient_cd_s3_push + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: reactclient_cd_s3 + properties: + ci: + codebase: + build: + type: branch + spec: + branch: <+trigger.branch> From da49ea0d5cd075304767e45bec39f71f6c55ef0e Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Fri, 31 Jul 2026 11:47:23 -0300 Subject: [PATCH 2/9] Updated ci --- .../Harness_Split/pipelines/reactclient.yaml | 96 +++++++++++++++ .../pipelines/reactclient_cd_s3.yaml | 115 ------------------ .../input_sets/reactclient_cd_s3_push.yaml | 14 --- 3 files changed, 96 insertions(+), 129 deletions(-) delete mode 100644 .harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3.yaml delete mode 100644 .harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3/input_sets/reactclient_cd_s3_push.yaml diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml index 64634e7..e40c215 100644 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml @@ -171,3 +171,99 @@ pipeline: matrix: nodeVersion: - "lts" + - stage: + name: Deploy to Stage + identifier: Deploy_to_Stage + type: CI + when: + pipelineStatus: Success + condition: <+codebase.branch> == "development" && <+trigger.event> == "PUSH" + spec: + cloneCodebase: true + buildIntelligence: + enabled: false + execution: + steps: + - step: + type: Run + name: Build Release Assets + identifier: Build_Release_Assets + spec: + connectorRef: account.harnessImage + image: node:lts + shell: Bash + command: |- + npm ci + npm run build + - step: + type: Run + name: Deploy to S3 + identifier: Deploy_to_S3 + spec: + connectorRef: account.harnessImage + image: amazon/aws-cli:2.31.5 + shell: Bash + command: |- + aws s3 sync ./umd s3://split-public-stage/sdk \ + --acl public-read --follow-symlinks --cache-control max-age=31536000,public + envVariables: + AWS_DEFAULT_REGION: us-east-1 + infrastructure: + type: KubernetesDirect + spec: + connectorRef: use1prod1cd + namespace: harness-delegate + serviceAccountName: use1-prod-1-reactclient-stage + automountServiceAccountToken: false + nodeSelector: {} + os: Linux + delegateSelectors: + - use1-prod-1-cd + - stage: + name: Deploy to Prod + identifier: Deploy_to_Prod + type: CI + when: + pipelineStatus: Success + condition: <+codebase.branch> == "main" && <+trigger.event> == "PUSH" + spec: + cloneCodebase: true + buildIntelligence: + enabled: false + execution: + steps: + - step: + type: Run + name: Build Release Assets + identifier: Build_Release_Assets + spec: + connectorRef: account.harnessImage + image: node:lts + shell: Bash + command: |- + npm ci + npm run build + - step: + type: Run + name: Deploy to S3 + identifier: Deploy_to_S3 + spec: + connectorRef: account.harnessImage + image: amazon/aws-cli:2.31.5 + shell: Bash + command: |- + aws s3 sync ./umd s3://split-public/sdk \ + --acl public-read --follow-symlinks --cache-control max-age=31536000,public + envVariables: + AWS_DEFAULT_REGION: us-east-1 + infrastructure: + type: KubernetesDirect + spec: + connectorRef: use1prod1cd + namespace: harness-delegate + serviceAccountName: use1-prod-1-reactclient-prod + automountServiceAccountToken: false + nodeSelector: {} + os: Linux + delegateSelectors: + - use1-prod-1-cd diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3.yaml deleted file mode 100644 index 1f56797..0000000 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3.yaml +++ /dev/null @@ -1,115 +0,0 @@ -pipeline: - name: reactclient_cd_s3 - identifier: reactclient_cd_s3 - projectIdentifier: Harness_Split - orgIdentifier: PROD - tags: {} - properties: - ci: - codebase: - connectorRef: fmegithubharnessgitops - repoName: react-client - build: <+input> - stages: - - stage: - name: Deploy to Stage - identifier: Deploy_to_Stage - type: CI - when: - pipelineStatus: Success - condition: <+codebase.branch> == "development" - spec: - cloneCodebase: true - buildIntelligence: - enabled: false - execution: - steps: - - step: - type: Run - name: Build Release Assets - identifier: Build_Release_Assets - spec: - connectorRef: account.harnessImage - image: node:lts - shell: Bash - command: |- - npm ci - npm run build - - step: - type: Run - name: Deploy to S3 - identifier: Deploy_to_S3 - when: - stageStatus: Success - condition: <+trigger.event> == "PUSH" - spec: - connectorRef: account.harnessImage - image: amazon/aws-cli:2.31.5 - shell: Bash - command: |- - aws s3 sync ./umd s3://split-public-stage/sdk \ - --acl public-read --follow-symlinks --cache-control max-age=31536000,public - envVariables: - AWS_DEFAULT_REGION: us-east-1 - infrastructure: - type: KubernetesDirect - spec: - connectorRef: use1prod1cd - namespace: harness-delegate - serviceAccountName: use1-prod-1-reactclient-stage - automountServiceAccountToken: false - nodeSelector: {} - os: Linux - delegateSelectors: - - use1-prod-1-cd - - stage: - name: Deploy to Prod - identifier: Deploy_to_Prod - type: CI - when: - pipelineStatus: Success - condition: <+codebase.branch> == "main" - spec: - cloneCodebase: true - buildIntelligence: - enabled: false - execution: - steps: - - step: - type: Run - name: Build Release Assets - identifier: Build_Release_Assets - spec: - connectorRef: account.harnessImage - image: node:lts - shell: Bash - command: |- - npm ci - npm run build - - step: - type: Run - name: Deploy to S3 - identifier: Deploy_to_S3 - when: - stageStatus: Success - condition: <+trigger.event> == "PUSH" - spec: - connectorRef: account.harnessImage - image: amazon/aws-cli:2.31.5 - shell: Bash - command: |- - aws s3 sync ./umd s3://split-public/sdk \ - --acl public-read --follow-symlinks --cache-control max-age=31536000,public - envVariables: - AWS_DEFAULT_REGION: us-east-1 - infrastructure: - type: KubernetesDirect - spec: - connectorRef: use1prod1cd - namespace: harness-delegate - serviceAccountName: use1-prod-1-reactclient-prod - automountServiceAccountToken: false - nodeSelector: {} - os: Linux - delegateSelectors: - - use1-prod-1-cd diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3/input_sets/reactclient_cd_s3_push.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3/input_sets/reactclient_cd_s3_push.yaml deleted file mode 100644 index afc8d83..0000000 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient_cd_s3/input_sets/reactclient_cd_s3_push.yaml +++ /dev/null @@ -1,14 +0,0 @@ -inputSet: - name: reactclient_cd_s3_push - identifier: reactclient_cd_s3_push - orgIdentifier: PROD - projectIdentifier: Harness_Split - pipeline: - identifier: reactclient_cd_s3 - properties: - ci: - codebase: - build: - type: branch - spec: - branch: <+trigger.branch> From 2f03a2949404658947e3452da1fab065b9691c84 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 31 Jul 2026 12:09:21 -0300 Subject: [PATCH 3/9] Simplify CI --- .../Harness_Split/pipelines/reactclient.yaml | 129 +++++------------- 1 file changed, 33 insertions(+), 96 deletions(-) diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml index e40c215..231dd25 100644 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml @@ -167,103 +167,40 @@ pipeline: "https://api.github.com/repos/splitio/${GITHUB_REPO}/statuses/${COMMIT_SHA}" echo "Posted SonarQube quality gate status: ${GH_STATE}" + - parallel: + - step: + type: Run + name: Deploy to Stage S3 + identifier: Deploy_to_Stage_S3 + when: + stageStatus: Success + condition: <+matrix.nodeVersion> == "lts" && <+codebase.branch> == "development" && <+trigger.event> == "PUSH" + spec: + connectorRef: account.harnessImage + image: amazon/aws-cli:2.31.5 + shell: Bash + command: |- + aws s3 sync ./umd s3://split-public-stage/sdk \ + --acl public-read --follow-symlinks --cache-control max-age=31536000,public + envVariables: + AWS_DEFAULT_REGION: us-east-1 + - step: + type: Run + name: Deploy to Prod S3 + identifier: Deploy_to_Prod_S3 + when: + stageStatus: Success + condition: <+matrix.nodeVersion> == "lts" && <+codebase.branch> == "main" && <+trigger.event> == "PUSH" + spec: + connectorRef: account.harnessImage + image: amazon/aws-cli:2.31.5 + shell: Bash + command: |- + aws s3 sync ./umd s3://split-public/sdk \ + --acl public-read --follow-symlinks --cache-control max-age=31536000,public + envVariables: + AWS_DEFAULT_REGION: us-east-1 strategy: matrix: nodeVersion: - "lts" - - stage: - name: Deploy to Stage - identifier: Deploy_to_Stage - type: CI - when: - pipelineStatus: Success - condition: <+codebase.branch> == "development" && <+trigger.event> == "PUSH" - spec: - cloneCodebase: true - buildIntelligence: - enabled: false - execution: - steps: - - step: - type: Run - name: Build Release Assets - identifier: Build_Release_Assets - spec: - connectorRef: account.harnessImage - image: node:lts - shell: Bash - command: |- - npm ci - npm run build - - step: - type: Run - name: Deploy to S3 - identifier: Deploy_to_S3 - spec: - connectorRef: account.harnessImage - image: amazon/aws-cli:2.31.5 - shell: Bash - command: |- - aws s3 sync ./umd s3://split-public-stage/sdk \ - --acl public-read --follow-symlinks --cache-control max-age=31536000,public - envVariables: - AWS_DEFAULT_REGION: us-east-1 - infrastructure: - type: KubernetesDirect - spec: - connectorRef: use1prod1cd - namespace: harness-delegate - serviceAccountName: use1-prod-1-reactclient-stage - automountServiceAccountToken: false - nodeSelector: {} - os: Linux - delegateSelectors: - - use1-prod-1-cd - - stage: - name: Deploy to Prod - identifier: Deploy_to_Prod - type: CI - when: - pipelineStatus: Success - condition: <+codebase.branch> == "main" && <+trigger.event> == "PUSH" - spec: - cloneCodebase: true - buildIntelligence: - enabled: false - execution: - steps: - - step: - type: Run - name: Build Release Assets - identifier: Build_Release_Assets - spec: - connectorRef: account.harnessImage - image: node:lts - shell: Bash - command: |- - npm ci - npm run build - - step: - type: Run - name: Deploy to S3 - identifier: Deploy_to_S3 - spec: - connectorRef: account.harnessImage - image: amazon/aws-cli:2.31.5 - shell: Bash - command: |- - aws s3 sync ./umd s3://split-public/sdk \ - --acl public-read --follow-symlinks --cache-control max-age=31536000,public - envVariables: - AWS_DEFAULT_REGION: us-east-1 - infrastructure: - type: KubernetesDirect - spec: - connectorRef: use1prod1cd - namespace: harness-delegate - serviceAccountName: use1-prod-1-reactclient-prod - automountServiceAccountToken: false - nodeSelector: {} - os: Linux - delegateSelectors: - - use1-prod-1-cd From 9dbd07e7cfb6858638594f44dd3bed016bae269d Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Fri, 31 Jul 2026 12:20:06 -0300 Subject: [PATCH 4/9] ci: trigger validation Co-Authored-By: Claude Sonnet 4.6 AI-Session-Id: f0f3d103-4dc6-4518-ad97-997b6285a5bb AI-Tool: claude-code AI-Model: unknown From ccec3bcf59ade4d9b84642129a68dd6682c00651 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 31 Jul 2026 13:19:30 -0300 Subject: [PATCH 5/9] Remove GitHub actions --- .github/CODEOWNERS | 1 - .github/pull_request_template.md | 7 -- .github/workflows/ci-cd.yml | 135 ----------------------- .github/workflows/update-notice-year.yml | 45 -------- 4 files changed, 188 deletions(-) delete mode 100644 .github/CODEOWNERS delete mode 100644 .github/pull_request_template.md delete mode 100644 .github/workflows/ci-cd.yml delete mode 100644 .github/workflows/update-notice-year.yml 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 f51e2c7..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,7 +0,0 @@ -# React SDK - -## What did you accomplish? - -## How do we test the changes introduced in this PR? - -## Extra Notes diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml deleted file mode 100644 index 6fc6399..0000000 --- a/.github/workflows/ci-cd.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: ci - -on: - push: - branches: - - '**' - pull_request: - branches: - - main - - development - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -permissions: - contents: read - id-token: write - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: 'lts/*' - cache: 'npm' - - - name: npm ci - run: npm ci - - - name: npm check - run: npm run check - - - name: npm test - run: npm run test - - - name: npm build - run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build - - - name: Set VERSION env - run: echo "VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV - - - name: Store assets - if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/development') - uses: actions/upload-artifact@v5 - with: - name: assets - path: umd/ - retention-days: 1 - - upload-stage: - name: Upload assets - runs-on: ubuntu-latest - needs: build - if: github.event_name == 'push' && github.ref == 'refs/heads/development' - strategy: - matrix: - environment: - - stage - include: - - environment: stage - account_id: "079419646996" - bucket: split-public-stage - - steps: - - name: Download assets - uses: actions/download-artifact@v6 - with: - name: assets - path: umd - - - name: Display structure of assets - run: ls -R - working-directory: umd - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role - aws-region: us-east-1 - - - name: Upload to S3 - run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS - env: - BUCKET: ${{ matrix.bucket }} - SOURCE_DIR: ./umd - DEST_DIR: sdk - ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public - - upload-prod: - name: Upload assets - runs-on: ubuntu-latest - needs: build - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - strategy: - matrix: - environment: - - prod - include: - - environment: prod - account_id: "825951051969" - bucket: split-public - - steps: - - name: Download assets - uses: actions/download-artifact@v6 - with: - name: assets - path: umd - - - name: Display structure of assets - run: ls -R - working-directory: umd - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role - aws-region: us-east-1 - - - name: Upload to S3 - run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS - env: - BUCKET: ${{ matrix.bucket }} - SOURCE_DIR: ./umd - DEST_DIR: sdk - ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public diff --git a/.github/workflows/update-notice-year.yml b/.github/workflows/update-notice-year.yml deleted file mode 100644 index 7043f6f..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@v5 - 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 From 771f7179af7b7c0c01ff201cfcfd568182a7f2d6 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 31 Jul 2026 13:50:35 -0300 Subject: [PATCH 6/9] =?UTF-8?q?connectorRef:=20artifacts=20=E2=80=94=20AWS?= =?UTF-8?q?=20auth,=20same=20as=20javascript-client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PROD/projects/Harness_Split/pipelines/reactclient.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml index 231dd25..f58cca4 100644 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml @@ -176,8 +176,7 @@ pipeline: stageStatus: Success condition: <+matrix.nodeVersion> == "lts" && <+codebase.branch> == "development" && <+trigger.event> == "PUSH" spec: - connectorRef: account.harnessImage - image: amazon/aws-cli:2.31.5 + connectorRef: artifacts shell: Bash command: |- aws s3 sync ./umd s3://split-public-stage/sdk \ @@ -192,8 +191,7 @@ pipeline: stageStatus: Success condition: <+matrix.nodeVersion> == "lts" && <+codebase.branch> == "main" && <+trigger.event> == "PUSH" spec: - connectorRef: account.harnessImage - image: amazon/aws-cli:2.31.5 + connectorRef: artifacts shell: Bash command: |- aws s3 sync ./umd s3://split-public/sdk \ From b14e093b7b15a61d5651ac006e672f8940f0da02 Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Fri, 31 Jul 2026 14:17:26 -0300 Subject: [PATCH 7/9] ci: trigger validation Co-Authored-By: Claude Sonnet 4.6 AI-Session-Id: f0f3d103-4dc6-4518-ad97-997b6285a5bb AI-Tool: claude-code AI-Model: unknown From 97133a275e204914f35facff9020024d55d957e7 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 31 Jul 2026 17:51:07 -0300 Subject: [PATCH 8/9] Simplify pipeline --- .../Harness_Split/pipelines/reactclient.yaml | 43 +++++-------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml index f58cca4..0dd6417 100644 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml @@ -33,14 +33,13 @@ pipeline: steps: - step: type: Run - name: Install Node - identifier: Install_Node + name: Set up Node.js + identifier: Set_up_Nodejs spec: shell: Bash command: |- - curl https://mise.run | sh - export PATH="$HOME/.local/bin:$PATH" - mise use --global node@<+matrix.nodeVersion> + curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - + sudo apt-get install -y nodejs node --version npm --version - step: @@ -49,47 +48,32 @@ pipeline: identifier: Install_Dependencies spec: shell: Bash - command: |- - export PATH="$HOME/.local/bin:$PATH" - eval "$(mise activate bash)" - npm ci + command: npm ci - step: type: Run name: Run Checks identifier: Run_Checks spec: shell: Bash - command: |- - export PATH="$HOME/.local/bin:$PATH" - eval "$(mise activate bash)" - npm run check + command: npm run check - step: type: Run name: Run Tests identifier: Run_Tests spec: shell: Bash - command: |- - export PATH="$HOME/.local/bin:$PATH" - eval "$(mise activate bash)" - npm run test + command: npm run test - step: type: Run name: Run Build identifier: Run_Build spec: shell: Bash - command: |- - export PATH="$HOME/.local/bin:$PATH" - eval "$(mise activate bash)" - BUILD_BRANCH=<+codebase.branch> npm run build + command: BUILD_BRANCH=<+codebase.branch> npm run build - step: type: Run name: SonarQube Scan identifier: SonarQube_Scan - when: - stageStatus: Success - condition: <+matrix.nodeVersion> == "lts" spec: connectorRef: account.harnessImage image: sonarsource/sonar-scanner-cli @@ -128,9 +112,6 @@ pipeline: type: Run name: Post Quality Gate identifier: Post_Quality_Gate - when: - stageStatus: Success - condition: <+matrix.nodeVersion> == "lts" spec: shell: Bash command: |- @@ -174,7 +155,7 @@ pipeline: identifier: Deploy_to_Stage_S3 when: stageStatus: Success - condition: <+matrix.nodeVersion> == "lts" && <+codebase.branch> == "development" && <+trigger.event> == "PUSH" + condition: <+codebase.branch> == "development" && <+trigger.event> == "PUSH" spec: connectorRef: artifacts shell: Bash @@ -189,7 +170,7 @@ pipeline: identifier: Deploy_to_Prod_S3 when: stageStatus: Success - condition: <+matrix.nodeVersion> == "lts" && <+codebase.branch> == "main" && <+trigger.event> == "PUSH" + condition: <+codebase.branch> == "main" && <+trigger.event> == "PUSH" spec: connectorRef: artifacts shell: Bash @@ -198,7 +179,3 @@ pipeline: --acl public-read --follow-symlinks --cache-control max-age=31536000,public envVariables: AWS_DEFAULT_REGION: us-east-1 - strategy: - matrix: - nodeVersion: - - "lts" From 5a346044491e48a660673b2484fb691001026945 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 31 Jul 2026 18:19:11 -0300 Subject: [PATCH 9/9] Migrate Harness CI as in js-client --- .../Harness_Split/pipelines/reactclient.yaml | 103 +++++++++--------- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml index 0dd6417..cd5d5ca 100644 --- a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml @@ -10,11 +10,10 @@ pipeline: connectorRef: fmegithubharnessgitops repoName: react-client build: <+input> - depth: 0 stages: - stage: - name: Build and Test - identifier: Build_and_Test + name: Check-Test-Build-Upload + identifier: Check_Test_Build_Upload description: "" type: CI spec: @@ -22,52 +21,49 @@ pipeline: caching: enabled: true override: true - platform: - os: Linux - arch: Amd64 - runtime: - type: Cloud - spec: - size: flex + paths: [] + buildIntelligence: + enabled: false execution: steps: - step: type: Run - name: Set up Node.js - identifier: Set_up_Nodejs - spec: - shell: Bash - command: |- - curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - - sudo apt-get install -y nodejs - node --version - npm --version - - step: - type: Run - name: Install Dependencies - identifier: Install_Dependencies + name: npm ci + identifier: npm_ci spec: + connectorRef: dockerhub + image: node:lts shell: Bash command: npm ci - step: type: Run - name: Run Checks - identifier: Run_Checks + name: npm run check + identifier: npm_run_check spec: + connectorRef: dockerhub + image: node:lts shell: Bash command: npm run check - step: type: Run - name: Run Tests - identifier: Run_Tests + name: npm run test + identifier: npm_run_test spec: + connectorRef: dockerhub + image: node:lts shell: Bash - command: npm run test + command: npm run test -- --maxWorkers=2 + resources: + limits: + memory: 4Gi + cpu: "2" - step: type: Run - name: Run Build - identifier: Run_Build + name: npm run build + identifier: npm_run_build spec: + connectorRef: dockerhub + image: node:lts shell: Bash command: BUILD_BRANCH=<+codebase.branch> npm run build - step: @@ -75,7 +71,7 @@ pipeline: name: SonarQube Scan identifier: SonarQube_Scan spec: - connectorRef: account.harnessImage + connectorRef: dockerhub image: sonarsource/sonar-scanner-cli shell: Bash command: | @@ -113,6 +109,8 @@ pipeline: name: Post Quality Gate identifier: Post_Quality_Gate spec: + connectorRef: dockerhub + image: python:3 shell: Bash command: |- #!/bin/bash @@ -151,31 +149,38 @@ pipeline: - parallel: - step: type: Run - name: Deploy to Stage S3 - identifier: Deploy_to_Stage_S3 - when: - stageStatus: Success - condition: <+codebase.branch> == "development" && <+trigger.event> == "PUSH" + name: upload dev assets to CDN + identifier: upload_dev_assets_to_CDN spec: - connectorRef: artifacts + connectorRef: dockerhub + image: amazon/aws-cli:2.31.5 shell: Bash - command: |- - aws s3 sync ./umd s3://split-public-stage/sdk \ - --acl public-read --follow-symlinks --cache-control max-age=31536000,public + command: aws s3 sync ./umd s3://split-public-stage/sdk --acl public-read --follow-symlinks --cache-control max-age=31536000,public envVariables: AWS_DEFAULT_REGION: us-east-1 - - step: - type: Run - name: Deploy to Prod S3 - identifier: Deploy_to_Prod_S3 when: stageStatus: Success - condition: <+codebase.branch> == "main" && <+trigger.event> == "PUSH" + condition: <+trigger.event> == "PUSH" && <+trigger.branch> == "development" + - step: + type: Run + name: upload prod assets to CDN + identifier: upload_prod_assets_to_CDN spec: - connectorRef: artifacts + connectorRef: dockerhub + image: amazon/aws-cli:2.31.5 shell: Bash - command: |- - aws s3 sync ./umd s3://split-public/sdk \ - --acl public-read --follow-symlinks --cache-control max-age=31536000,public + command: aws s3 sync ./umd s3://split-public/sdk --acl public-read --follow-symlinks --cache-control max-age=31536000,public envVariables: AWS_DEFAULT_REGION: us-east-1 + when: + stageStatus: Success + condition: <+trigger.event> == "PUSH" && <+trigger.branch> == "main" + infrastructure: + type: KubernetesDirect + spec: + connectorRef: "<+codebase.branch == \"main\" ? \"use1prod1cd\" : \"use1stage1cd\">" + namespace: harness-delegate + serviceAccountName: "<+codebase.branch == \"main\" ? \"use1-prod-1-public-assets\" : \"use1-stage-1-public-assets\">" + automountServiceAccountToken: false + nodeSelector: {} + os: Linux