Skip to content

Commit

Permalink
fix: update ff api url path for harness ffs
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma committed May 1, 2024
1 parent c38d4bd commit 60c34ba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/cdf/core/feature_flag/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def drop(self, ident: str) -> str:
"""Drop a feature flag."""
logger.info(f"Deleting feature flag {ident}")
requests.delete(
f"https://app.harness.io/gateway/cf/admin/features/{ident}",
f"https://app.harness.io/cf/admin/features/{ident}",
headers={"x-api-key": self.api_key},
params={
"accountIdentifier": self.account,
Expand All @@ -108,7 +108,7 @@ def create(self, ident: str, name: str) -> str:
logger.info(f"Creating feature flag {ident}")
try:
requests.post(
"https://app.harness.io/gateway/cf/admin/features",
"https://app.harness.io/cf/admin/features",
params={
"accountIdentifier": self.account,
"orgIdentifier": self.organization,
Expand Down
26 changes: 18 additions & 8 deletions src/cdf/core/runtime/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,30 @@ def run(
)


def pipeline_factory() -> RuntimePipeline:
def pipeline_factory(**user_options: t.Any) -> RuntimePipeline:
"""Creates a cdf pipeline. This is used in lieu of dlt.pipeline. in user code.
A cdf pipeline is a wrapper around a dlt pipeline that leverages injected information
from the runtime context. Raises a ValueError if the runtime context is not set.
from the runtime context.
Args:
**user_options: Kwargs which override the context options. All dlt.pipeline options can
be passed here except _impl_cls.
Raises:
ValueError if the runtime context is not set.
"""
runtime = CONTEXT.get()
# TODO: contribute a PR to expose an _impl_cls argument in dlt.pipeline
# https://github.com/dlt-hub/dlt/pull/1176
context_options = {
"pipeline_name": runtime.pipeline_name,
"destination": runtime.destination,
"dataset_name": runtime.dataset_name,
}
if runtime.enable_stage:
context_options["staging"] = runtime.staging
context_options.update(user_options)
return dlt.pipeline(
pipeline_name=runtime.pipeline_name,
destination=runtime.destination,
staging=runtime.staging if runtime.enable_stage else None,
dataset_name=runtime.dataset_name,
**context_options,
_impl_cls=RuntimePipeline,
)

Expand Down

0 comments on commit 60c34ba

Please sign in to comment.