From 0a8e7f180fcf105ef23347893abae78216f71f7f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 10:38:43 -0500 Subject: [PATCH 1/6] chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.8.5 (#139) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 16eb005..3f87d3d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ default_stages: [commit] repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.4 + rev: v0.8.5 hooks: - id: ruff args: [--fix] From 68015220ea9005286c0a45d4cdeb3891d9f43b3b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:51:33 +0000 Subject: [PATCH 2/6] chore(deps): update providers/openfeature-provider-flagd/openfeature/spec digest to d261f68 (#140) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- providers/openfeature-provider-flagd/openfeature/spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/openfeature-provider-flagd/openfeature/spec b/providers/openfeature-provider-flagd/openfeature/spec index ed0f9ef..d261f68 160000 --- a/providers/openfeature-provider-flagd/openfeature/spec +++ b/providers/openfeature-provider-flagd/openfeature/spec @@ -1 +1 @@ -Subproject commit ed0f9ef5a3fb4d66f51b9467d8064c82a6b4d930 +Subproject commit d261f68331b94fd8ed10bc72bc0485cfc72a51a8 From 8a5106d49bae6037bda1ad53135941250453ee49 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:12:26 +0000 Subject: [PATCH 3/6] chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.8.6 (#144) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f87d3d..23c715b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ default_stages: [commit] repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.5 + rev: v0.8.6 hooks: - id: ruff args: [--fix] From 09402df3129c1b9d219465b82807fa53aafec039 Mon Sep 17 00:00:00 2001 From: Ben Mask Date: Sat, 4 Jan 2025 15:40:16 -0500 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20Allow=20configuring=20ofrep=20provid?= =?UTF-8?q?er=20requests=20to=20api=20at=20base=20=E2=80=A6=20(#142)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: atmask --- .../openfeature/contrib/provider/ofrep/__init__.py | 8 +++++++- .../tests/test_provider.py | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/providers/openfeature-provider-ofrep/src/openfeature/contrib/provider/ofrep/__init__.py b/providers/openfeature-provider-ofrep/src/openfeature/contrib/provider/ofrep/__init__.py index 90002d9..8007afa 100644 --- a/providers/openfeature-provider-ofrep/src/openfeature/contrib/provider/ofrep/__init__.py +++ b/providers/openfeature-provider-ofrep/src/openfeature/contrib/provider/ofrep/__init__.py @@ -107,6 +107,12 @@ def resolve_object_details( FlagType.OBJECT, flag_key, default_value, evaluation_context ) + def _get_ofrep_api_url(self, api_version: str = "v1") -> str: + ofrep_base_url = ( + self.base_url if self.base_url.endswith("/") else f"{self.base_url}/" + ) + return urljoin(ofrep_base_url, f"ofrep/{api_version}/") + def _resolve( self, flag_type: FlagType, @@ -124,7 +130,7 @@ def _resolve( try: response = self.session.post( - urljoin(self.base_url, f"/ofrep/v1/evaluate/flags/{flag_key}"), + urljoin(self._get_ofrep_api_url(), f"evaluate/flags/{flag_key}"), json=_build_request_data(evaluation_context), timeout=self.timeout, headers=self.headers_factory() if self.headers_factory else None, diff --git a/providers/openfeature-provider-ofrep/tests/test_provider.py b/providers/openfeature-provider-ofrep/tests/test_provider.py index ca7dbba..f698a16 100644 --- a/providers/openfeature-provider-ofrep/tests/test_provider.py +++ b/providers/openfeature-provider-ofrep/tests/test_provider.py @@ -164,3 +164,17 @@ def test_provider_typecheck_flag_value(ofrep_provider, requests_mock): with pytest.raises(TypeMismatchError): ofrep_provider.resolve_boolean_details("flag_key", False) + + +@pytest.mark.parametrize( + "base_url", + [ + "https://localhost:8080", + "https://localhost:8080/", + "https://localhost:8080/tools/feature_flags", + "https://localhost:8080/tools/feature_flags/", + ], +) +def test_provider_api_path_resolution(base_url): + provider = OFREPProvider(base_url=base_url) + assert provider._get_ofrep_api_url() == f"{base_url.rstrip('/')}/ofrep/v1/" From 149526337c5fd9948e10a1e3aab0176f2d1e7c8b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 22:26:48 +0000 Subject: [PATCH 5/6] chore(deps): update dependency providers/openfeature-provider-flagd/openfeature/test-harness to v0.5.21 (#145) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .gitmodules | 2 +- providers/openfeature-provider-flagd/openfeature/test-harness | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0ec57f2..91761e3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,7 +5,7 @@ [submodule "providers/openfeature-provider-flagd/test-harness"] path = providers/openfeature-provider-flagd/openfeature/test-harness url = git@github.com:open-feature/flagd-testbed.git - branch = v0.5.20 + branch = v0.5.21 [submodule "providers/openfeature-provider-flagd/spec"] path = providers/openfeature-provider-flagd/openfeature/spec url = https://github.com/open-feature/spec diff --git a/providers/openfeature-provider-flagd/openfeature/test-harness b/providers/openfeature-provider-flagd/openfeature/test-harness index 706a7e9..8931c86 160000 --- a/providers/openfeature-provider-flagd/openfeature/test-harness +++ b/providers/openfeature-provider-flagd/openfeature/test-harness @@ -1 +1 @@ -Subproject commit 706a7e951bb72a145523b38fe83060becc34c4d7 +Subproject commit 8931c8645b8600e251d5e3ebbad42dff8ce4c78e From 905b42b6e654c86c9161f02d87a812ad4ac42bed Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 5 Jan 2025 10:01:38 +0000 Subject: [PATCH 6/6] chore(deps): update dependency grpcio-health-checking to v1.69.0 (#147) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- providers/openfeature-provider-flagd/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/openfeature-provider-flagd/pyproject.toml b/providers/openfeature-provider-flagd/pyproject.toml index bca7f94..a8171b6 100644 --- a/providers/openfeature-provider-flagd/pyproject.toml +++ b/providers/openfeature-provider-flagd/pyproject.toml @@ -40,7 +40,7 @@ dependencies = [ "pytest-bdd", "testcontainers", "asserts", - "grpcio-health-checking==1.68.1", + "grpcio-health-checking==1.69.0", ] pre-install-commands = [ "hatch build",