Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,38 @@ on:
- synchronize

permissions:
pull-requests: read
pull-requests: write

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.

Details:

```
${{ steps.lint_pr_title.outputs.error_message }}
```

# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Run Release Please

on:
workflow_dispatch:
inputs:

push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest

# Release-please creates a PR that tracks all changes
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main
signoff: "OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>"
- name: Dump Release Please Output
env:
RELEASE_PLEASE_OUTPUT: ${{ toJson(steps.release.outputs) }}
run: |
echo "$RELEASE_PLEASE_OUTPUT"
outputs:
release_created: ${{ steps.release.outputs.releases_created }}
all: ${{ toJSON(steps.release.outputs) }}
paths_released: ${{ steps.release.outputs.paths_released }}

pypi-release:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
strategy:
matrix:
path: ${{ fromJSON(needs.release-please.outputs.paths_released) }}
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing to pypi
id-token: write
container:
image: "python:3.12"

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Upgrade pip
run: pip install --upgrade pip

- name: Install hatch
run: pip install hatch

- name: Build a binary wheel and a source tarball
run: hatch build
working-directory: ${{ matrix.path }}

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ matrix.path }}
4 changes: 4 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"hooks/openfeature-hooks-opentelemetry": "0.1.0",
"providers/openfeature-provider-flagd": "0.1.0"
}
9 changes: 1 addition & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ We use `pytest` for our unit testing, making use of `parametrized` to inject cas

These are planned once the SDK has been stabilized and a Flagd provider implemented. At that point, we will utilize the [gherkin integration tests](https://github.com/open-feature/test-harness/blob/main/features/evaluation.feature) to validate against a live, seeded Flagd instance.

### Packaging

We publish to the PyPI repository, where you can find each individual package:

- [openfeature-provider-flagd](https://pypi.org/project/openfeature-provider-flagd/)
- [openfeature-hooks-opentelemetry](https://pypi.org/project/openfeature-hooks-opentelemetry/)

## Pull Request

All contributions to the OpenFeature project are welcome via GitHub pull requests.
Expand All @@ -48,7 +41,7 @@ git clone https://github.com/open-feature/python-sdk-contrib.git openfeature-pyt
Navigate to the repository folder

```bash
cd openfeature-python-sdk-contrib
cd python-sdk-contrib
```

Add your fork as an origin
Expand Down
5 changes: 3 additions & 2 deletions hooks/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# OpenFeature Python Hooks

Hooks are a mechanism whereby application developers can add arbitrary behavior to flag evaluation.
They operate similarly to middleware in many web frameworks. Please see the
[spec](https://openfeature.dev/specification/sections/hooks) for more details.
They operate similarly to middleware in many web frameworks.
Please see the [spec](https://openfeature.dev/specification/sections/hooks) for more details.
9 changes: 5 additions & 4 deletions providers/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# OpenFeature Python Providers
Providers are responsible for performing flag evaluation. They provide an abstraction between the underlying
flag management system and OpenFeature itself. This allows providers to be changed without requiring a major
code refactor. Please see the [spec]("https://github.com/open-feature/spec/blob/main/specification/sections/02-providers.md")
for more details.

Providers are responsible for performing flag evaluation.
They provide an abstraction between the underlying flag management system and OpenFeature itself.
This allows providers to be changed without requiring a major code refactor.
Please see the [spec](https://openfeature.dev/specification/sections/providers) for more details.
84 changes: 84 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"bootstrap-sha": "1cef37c5d8c7d97ee52a8e6b71f12150063b8503",
"separate-pull-requests": true,
"release-type": "python",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"include-component-in-tag": true,
"tag-separator": "/",
"packages": {
"providers/openfeature-provider-flagd": {
"package-name": "providers/flagd",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"versioning": "default",
"extra-files": [
"README.md"
]
},
"hooks/openfeature-hooks-opentelemetry": {
"package-name": "hooks/opentelemetry",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"versioning": "default",
"extra-files": [
"README.md"
]
}
},
"changelog-sections": [
{
"type": "fix",
"section": "🐛 Bug Fixes"
},
{
"type": "feat",
"section": "✨ New Features"
},
{
"type": "chore",
"section": "🧹 Chore"
},
{
"type": "docs",
"section": "📚 Documentation"
},
{
"type": "perf",
"section": "🚀 Performance"
},
{
"type": "build",
"hidden": true,
"section": "🛠️ Build"
},
{
"type": "deps",
"section": "📦 Dependencies"
},
{
"type": "ci",
"hidden": true,
"section": "🚦 CI"
},
{
"type": "refactor",
"section": "🔄 Refactoring"
},
{
"type": "revert",
"section": "🔙 Reverts"
},
{
"type": "style",
"hidden": true,
"section": "🎨 Styling"
},
{
"type": "test",
"hidden": true,
"section": "🧪 Tests"
}
],
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}