diff --git a/.github/workflows/CODEOWNERS b/.github/workflows/CODEOWNERS deleted file mode 100644 index 9e31981..0000000 --- a/.github/workflows/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 ae4966e..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: ci - -on: - push: - branches: - - main - - development - pull_request: - branches: - - main - - development - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - test: - name: Test - runs-on: ubuntu-24.04 - steps: - - name: Checkout code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: '3.9.13' - - - name: Install dependencies - run: | - pip install -U setuptools pip wheel - pip install -e . - pip install -r requirements-dev.txt - - - name: Run tests with coverage - working-directory: tests - run: pytest -v --cov=split_openfeature_provider --cov-report=xml:../coverage.xml - - - name: Set VERSION env - run: echo "VERSION=$(cat setup.py | grep "version=" | cut -d'"' -f2)" >> $GITHUB_ENV - - - name: SonarQube Scan (Push) - if: github.event_name == 'push' - uses: SonarSource/sonarqube-scan-action@v6 - env: - SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - projectBaseDir: . - args: > - -Dsonar.host.url=${{ vars.SONARQUBE_HOST }} - -Dsonar.projectVersion=${{ env.VERSION }} - - - name: SonarQube Scan (Pull Request) - if: github.event_name == 'pull_request' - uses: SonarSource/sonarqube-scan-action@v6 - env: - SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - projectBaseDir: . - args: > - -Dsonar.host.url=${{ vars.SONARQUBE_HOST }} - -Dsonar.projectVersion=${{ env.VERSION }} - -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/.harness/migration/report-2026-07-28.md b/.harness/migration/report-2026-07-28.md new file mode 100644 index 0000000..86b6b92 --- /dev/null +++ b/.harness/migration/report-2026-07-28.md @@ -0,0 +1,26 @@ +## Harness Migration Report — 2026-07-28 + +**Repo:** splitio/split-openfeature-provider-python +**Language:** Python (versions: 3.9.13) +**Status:** ✅ PASSED + +### Steps +| Step | Result | Notes | +|------|--------|-------| +| Detect context | ✅ | Python, split-openfeature-provider-python | +| Read GH workflow | ✅ | .github/workflows/ci.yml | +| Generate Harness YAML | ✅ | Adapted from ruby-client reference pipeline | +| Write pipeline file | ✅ | .harness/pipeline.yaml | +| Create pipeline in Harness | ✅ | imported from Git | +| Create input set | ✅ | splitopenfeatureproviderpyinputset | +| Create webhook trigger | ✅ | splitopenfeatureproviderpython, GitHub PR webhook | +| Dry-run | ✅ | https://harness0.harness.io/ng/account/l7B_kbSEQD2wjrM7PShm5w/all/orgs/PROD/projects/Harness_Split/pipelines/splitopenfeatureproviderpy/deployments/YIwqFMr6QNuul5wUD6kZtA/pipeline | + +**Pipeline is working. PR opened targeting development.** + +### Fixes applied during migration +- Pipeline codebase `build` changed to `<+input>` (was fixed to `type: branch`) so PR-type input sets/triggers can override it. +- Disabled mise's GitHub attestation check (`MISE_PYTHON_GITHUB_ATTESTATIONS=false`) — no attestations are published for python@3.9.13. +- Run tests from `tests/` (matches the original workflow's `working-directory: tests`), not `split_openfeature_provider/`. +- Upgraded `pip`/`setuptools`/`wheel` before install, matching the original workflow. +- Switched SonarQube steps from `shell: Sh` to `shell: Bash` — `eval "$(mise activate bash)"` requires bash, not POSIX sh. diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/splitopenfeatureproviderpy/input_sets/splitopenfeatureproviderpyinputset.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/splitopenfeatureproviderpy/input_sets/splitopenfeatureproviderpyinputset.yaml new file mode 100644 index 0000000..3e507a6 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/splitopenfeatureproviderpy/input_sets/splitopenfeatureproviderpyinputset.yaml @@ -0,0 +1,14 @@ +inputSet: + name: splitopenfeatureproviderpyinputset + identifier: splitopenfeatureproviderpyinputset + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: splitopenfeatureproviderpy + properties: + ci: + codebase: + build: + type: PR + spec: + number: <+trigger.prNumber> diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/splitopenfeatureproviderpy/input_sets/splitopenfeatureproviderpythoninputset.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/splitopenfeatureproviderpy/input_sets/splitopenfeatureproviderpythoninputset.yaml new file mode 100644 index 0000000..3e507a6 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/splitopenfeatureproviderpy/input_sets/splitopenfeatureproviderpythoninputset.yaml @@ -0,0 +1,14 @@ +inputSet: + name: splitopenfeatureproviderpyinputset + identifier: splitopenfeatureproviderpyinputset + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: splitopenfeatureproviderpy + properties: + ci: + codebase: + build: + type: PR + spec: + number: <+trigger.prNumber> diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/splitopenfeatureproviderpy/input_sets/splitopenfeatureproviderpythoninputset2.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/splitopenfeatureproviderpy/input_sets/splitopenfeatureproviderpythoninputset2.yaml new file mode 100644 index 0000000..3e507a6 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/splitopenfeatureproviderpy/input_sets/splitopenfeatureproviderpythoninputset2.yaml @@ -0,0 +1,14 @@ +inputSet: + name: splitopenfeatureproviderpyinputset + identifier: splitopenfeatureproviderpyinputset + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: splitopenfeatureproviderpy + properties: + ci: + codebase: + build: + type: PR + spec: + number: <+trigger.prNumber> diff --git a/.harness/pipeline.yaml b/.harness/pipeline.yaml new file mode 100644 index 0000000..8947bdd --- /dev/null +++ b/.harness/pipeline.yaml @@ -0,0 +1,133 @@ +pipeline: + name: split-openfeature-provider-python + identifier: splitopenfeatureproviderpy + projectIdentifier: Harness_Split + orgIdentifier: PROD + tags: {} + properties: + ci: + codebase: + connectorRef: fmegithubharnessgitops + repoName: split-openfeature-provider-python + build: <+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 Python + identifier: Install_Python + spec: + shell: Bash + command: |- + curl https://mise.run | sh + export PATH="$HOME/.local/bin:$PATH" + export MISE_PYTHON_GITHUB_ATTESTATIONS=false + mise use --global python@<+matrix.pythonVersion> + eval "$(mise activate bash)" + python --version + pip --version + - step: + type: Run + name: Install Dependencies + identifier: Install_Dependencies + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + pip install -U setuptools pip wheel + pip install -e . + pip install -r requirements-dev.txt + - step: + type: Run + name: Run Tests + identifier: Run_Tests + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + cd tests + pytest -v --cov=split_openfeature_provider --cov-report=xml:../coverage.xml + - step: + type: Run + name: SonarQube Scan Push + identifier: SonarQube_Scan_Push + when: + stageStatus: Success + condition: <+matrix.pythonVersion> == "3.9.13" && <+codebase.build.type> == "branch" + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + VERSION=$(python3 -c "import re; print(re.search(r'version\s*=\s*[\"\\']([^\"\\']+)[\"\\']', open('setup.py').read()).group(1))") + echo "Detected version: $VERSION" + 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=split-openfeature-provider-python \ + -Dsonar.sources=split_openfeature_provider \ + -Dsonar.tests=tests \ + -Dsonar.host.url=https://sonar.harness.io \ + -Dsonar.token=<+secrets.getValue("sonarqube-token")> \ + -Dsonar.python.coverage.reportPaths=coverage.xml \ + -Dsonar.projectVersion=$VERSION \ + -Dsonar.branch.name=<+codebase.branch> + - step: + type: Run + name: SonarQube Scan PR + identifier: SonarQube_Scan_PR + when: + stageStatus: Success + condition: <+matrix.pythonVersion> == "3.9.13" && <+codebase.build.type> == "PR" + spec: + shell: Bash + command: |- + export PATH="$HOME/.local/bin:$PATH" + eval "$(mise activate bash)" + VERSION=$(python3 -c "import re; print(re.search(r'version\s*=\s*[\"\\']([^\"\\']+)[\"\\']', open('setup.py').read()).group(1))") + echo "Detected version: $VERSION" + 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=split-openfeature-provider-python \ + -Dsonar.sources=split_openfeature_provider \ + -Dsonar.tests=tests \ + -Dsonar.host.url=https://sonar.harness.io \ + -Dsonar.token=<+secrets.getValue("sonarqube-token")> \ + -Dsonar.python.coverage.reportPaths=coverage.xml \ + -Dsonar.projectVersion=$VERSION \ + -Dsonar.pullrequest.key=<+codebase.prNumber> \ + -Dsonar.pullrequest.branch=<+codebase.sourceBranch> \ + -Dsonar.pullrequest.base=<+codebase.targetBranch> + strategy: + matrix: + pythonVersion: + - "3.9.13"