Skip to content

Commit

Permalink
use slugify
Browse files Browse the repository at this point in the history
  • Loading branch information
clnoll committed May 30, 2024
1 parent 2b00226 commit b10829f
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 5 deletions.
30 changes: 29 additions & 1 deletion airbyte-ci/connectors/live-tests/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions airbyte-ci/connectors/live-tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pyyaml = "^6.0.1"
dpath = "^2.1.6"
genson = "^1.2.2"
segment-analytics-python = "^2.3.2"
python-slugify = ">=8.0.4"

[tool.poetry.scripts]
live-tests = "live_tests.cli:live_tests"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import pytest
from mitmproxy import http, io # type: ignore
from mitmproxy.addons.savehar import SaveHar # type: ignore
from slugify import slugify


async def get_container_from_id(dagger_client: dagger.Client, container_id: str) -> dagger.Container:
Expand Down Expand Up @@ -97,7 +98,7 @@ async def get_connector_container(dagger_client: dagger.Client, image_name_with_
# If a container_id.txt file is available, we'll use it to load the connector container
# We use a txt file as container ids can be too long to be passed as env vars
# It's used for dagger-in-dagger use case with airbyte-ci, when the connector container is built via an upstream dagger operation
container_id_path = Path(f"/tmp/{image_name_with_tag.split(':')[1]}_container_id.txt")
container_id_path = Path(f"/tmp/{slugify(image_name_with_tag)}_container_id.txt")
if container_id_path.exists():
return await get_container_from_id(dagger_client, container_id_path.read_text())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from pipelines.helpers.utils import METADATA_FILE_NAME, get_exec_result
from pipelines.models.secrets import Secret
from pipelines.models.steps import STEP_PARAMS, MountPath, Step, StepResult, StepStatus
from slugify import slugify


class VersionCheck(Step, ABC):
Expand Down Expand Up @@ -459,7 +460,9 @@ async def _build_regression_test_container(self, target_container_id: str) -> Co
# regression tests. The connector can be found if you know the container ID, so we write the container ID to a file and put
# it in the regression test container. This way regression tests will use the already-built connector instead of trying to
# build their own.
.with_new_file(f"/tmp/{self.target_version}_container_id.txt", contents=str(target_container_id))
.with_new_file(
f"/tmp/{slugify(self.connector_image + ':' + self.target_version)}_container_id.txt", contents=str(target_container_id)
)
)

if self.context.is_ci:
Expand Down
34 changes: 32 additions & 2 deletions airbyte-ci/connectors/pipelines/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions airbyte-ci/connectors/pipelines/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ google-cloud-secret-manager = "^2.20.0"
google-auth = "^2.29.0"
pygithub = "^2.3.0"
pydash = "6.0.2"
python-slugify = ">=8.0.4"

[tool.poetry.group.dev.dependencies]
freezegun = "^1.2.2"
Expand Down

0 comments on commit b10829f

Please sign in to comment.