Skip to content

feat(flagd): Implement dual-mode selector handling (header and body) for in-process mode in python-sdk-contrib #1078

feat(flagd): Implement dual-mode selector handling (header and body) for in-process mode in python-sdk-contrib

feat(flagd): Implement dual-mode selector handling (header and body) for in-process mode in python-sdk-contrib #1078

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: "Build, lint, and test"
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- main
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read # needed for `dorny/paths-filter`
outputs:
packages: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: filter
with:
filters: |
hooks/openfeature-hooks-opentelemetry:
- 'hooks/openfeature-hooks-opentelemetry/**'
- 'uv.lock'
providers/openfeature-provider-env-var:
- 'providers/openfeature-provider-env-var/**'
- 'uv.lock'
providers/openfeature-provider-flagd:
- 'providers/openfeature-provider-flagd/**'
- 'uv.lock'
providers/openfeature-provider-flipt:
- 'providers/openfeature-provider-flipt/**'
- 'uv.lock'
providers/openfeature-provider-ofrep:
- 'providers/openfeature-provider-ofrep/**'
- 'uv.lock'
build:
needs: changes
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
package: ${{ fromJSON(needs.changes.outputs.packages) }}
exclude: # enable when `grpcio` has Python 3.14 wheels
- python-version: "3.14"
package: "providers/openfeature-provider-flagd"
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
submodules: recursive
- name: Install uv and set the python version ${{ matrix.python-version }}
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
working-directory: ${{ matrix.package }}
run: uv sync --frozen
- name: Building first to generate files
working-directory: ${{ matrix.package }}
run: uv build
- name: Type checking
if: matrix.python-version == '3.13'
working-directory: ${{ matrix.package }}
run: uv run mypy-check --frozen
- name: Test with pytest
working-directory: ${{ matrix.package }}
run: uv run cov --frozen
- if: matrix.python-version == '3.13'
name: Upload coverage to Codecov
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
name: Code Coverage for ${{ matrix.package }} on Python ${{ matrix.python-version }}
directory: ${{ matrix.package }}
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Install uv and set the python version
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7
with:
python-version: "3.13"
enable-cache: false # caching is done automatically in `pre-commit/action`
- name: Run pre-commit
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
sast:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Initialize CodeQL
uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v4
with:
languages: python
config-file: ./.github/codeql-config.yml
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v4