Skip to content

Commit 3106d83

Browse files
authored
Merge branch 'main' into provider/flipt-issue89
2 parents b97602a + 1c2c650 commit 3106d83

File tree

8 files changed

+28
-8
lines changed

8 files changed

+28
-8
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ jobs:
9191
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
9292

9393
- name: Initialize CodeQL
94-
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3
94+
uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3
9595
with:
9696
languages: python
9797
config-file: ./.github/codeql-config.yml
9898

9999
- name: Perform CodeQL Analysis
100-
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3
100+
uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[submodule "providers/openfeature-provider-flagd/test-harness"]
66
path = providers/openfeature-provider-flagd/openfeature/test-harness
77
url = [email protected]:open-feature/flagd-testbed.git
8-
branch = v0.5.20
8+
branch = v0.5.21
99
[submodule "providers/openfeature-provider-flagd/spec"]
1010
path = providers/openfeature-provider-flagd/openfeature/spec
1111
url = https://github.com/open-feature/spec

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
default_stages: [commit]
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.8.5
4+
rev: v0.8.6
55
hooks:
66
- id: ruff
77
args: [--fix]

providers/openfeature-provider-flagd/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies = [
4040
"pytest-bdd",
4141
"testcontainers",
4242
"asserts",
43-
"grpcio-health-checking==1.68.1",
43+
"grpcio-health-checking==1.69.0",
4444
]
4545
pre-install-commands = [
4646
"hatch build",

providers/openfeature-provider-ofrep/src/openfeature/contrib/provider/ofrep/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ def resolve_object_details(
107107
FlagType.OBJECT, flag_key, default_value, evaluation_context
108108
)
109109

110+
def _get_ofrep_api_url(self, api_version: str = "v1") -> str:
111+
ofrep_base_url = (
112+
self.base_url if self.base_url.endswith("/") else f"{self.base_url}/"
113+
)
114+
return urljoin(ofrep_base_url, f"ofrep/{api_version}/")
115+
110116
def _resolve(
111117
self,
112118
flag_type: FlagType,
@@ -124,7 +130,7 @@ def _resolve(
124130

125131
try:
126132
response = self.session.post(
127-
urljoin(self.base_url, f"/ofrep/v1/evaluate/flags/{flag_key}"),
133+
urljoin(self._get_ofrep_api_url(), f"evaluate/flags/{flag_key}"),
128134
json=_build_request_data(evaluation_context),
129135
timeout=self.timeout,
130136
headers=self.headers_factory() if self.headers_factory else None,

providers/openfeature-provider-ofrep/tests/test_provider.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,17 @@ def test_provider_typecheck_flag_value(ofrep_provider, requests_mock):
164164

165165
with pytest.raises(TypeMismatchError):
166166
ofrep_provider.resolve_boolean_details("flag_key", False)
167+
168+
169+
@pytest.mark.parametrize(
170+
"base_url",
171+
[
172+
"https://localhost:8080",
173+
"https://localhost:8080/",
174+
"https://localhost:8080/tools/feature_flags",
175+
"https://localhost:8080/tools/feature_flags/",
176+
],
177+
)
178+
def test_provider_api_path_resolution(base_url):
179+
provider = OFREPProvider(base_url=base_url)
180+
assert provider._get_ofrep_api_url() == f"{base_url.rstrip('/')}/ofrep/v1/"

0 commit comments

Comments
 (0)