Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

airbyte ci test to support --extras #36527

Merged
merged 2 commits into from
Mar 27, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/airbyte-ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
with:
# Note: expressions within a filter are OR'ed
filters: |
# This list is duplicated in `pipelines/airbyte_ci/test/__init__.py`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just a note for me when I was working on the upstack PR

There is some weird stuff around keepign this list up to date and also the output of changes being calculated differently from the --modified flag that we should look into later but I haven't addressed in this stack.

internal_poetry_packages:
- airbyte-lib/**
- airbyte-ci/connectors/pipelines/**
Expand Down
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/base_images/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ publish = "base_images.commands:publish_existing_version"
test = "pytest tests"

[tool.airbyte_ci]
extra_poetry_groups = ["dev"]
optional_poetry_groups = ["dev"]
poe_tasks = ["test"]
mount_docker_socket = true
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/ci_credentials/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ ci_credentials = "ci_credentials.main:ci_credentials"
test = "pytest tests"

[tool.airbyte_ci]
extra_poetry_groups = ["dev"]
optional_poetry_groups = ["dev"]
poe_tasks = ["test"]
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/common_utils/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ build-backend = "poetry.core.masonry.api"
test = "pytest tests"

[tool.airbyte_ci]
extra_poetry_groups = ["dev"]
optional_poetry_groups = ["dev"]
# Disable poe tasks as tests are not passing ATM
poe_tasks = []
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/connector_ops/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ allowed-hosts-checks = "connector_ops.allowed_hosts_checks:check_allowed_hosts"
test = "pytest tests"

[tool.airbyte_ci]
extra_poetry_groups = ["dev"]
optional_poetry_groups = ["dev"]
poe_tasks = ["test"]
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/connectors_qa/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ type_check = "mypy src --disallow-untyped-defs"
lint = "ruff check src"

[tool.airbyte_ci]
extra_poetry_groups = ["dev"]
optional_poetry_groups = ["dev"]
poe_tasks = ["type_check", "lint", "test"]
required_environment_variables = ["DOCKER_HUB_USERNAME", "DOCKER_HUB_PASSWORD",]
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ promote-connector-to-latest = "gsutil -m rsync -r -d gs://$TARGET_BUCKET/metada
test = "pytest tests"

[tool.airbyte_ci]
extra_poetry_groups = ["dev"]
optional_poetry_groups = ["dev"]
poe_tasks = ["test"]

[build-system]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ module_name = "orchestrator"
test = "pytest tests"

[tool.airbyte_ci]
extra_poetry_groups = ["dev"]
optional_poetry_groups = ["dev"]
poe_tasks = ["test"]
1 change: 1 addition & 0 deletions airbyte-ci/connectors/pipelines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ E.G.: running Poe tasks on the modified internal packages of the current branch:

| Version | PR | Description |
| ------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| 4.6.3 | [#36527](https://github.com/airbytehq/airbyte/pull/36527) | Handle extras as well as groups in `airbyte ci test` [poetry packages] |
| 4.6.2 | [#36220](https://github.com/airbytehq/airbyte/pull/36220) | Allow using `migrate-to-base-image` without PULL_REQUEST_NUMBER |
| 4.6.1 | [#36319](https://github.com/airbytehq/airbyte/pull/36319) | Fix `ValueError` related to PR number in migrate-to-poetry |
| 4.6.0 | [#35583](https://github.com/airbytehq/airbyte/pull/35583) | Implement the `airbyte-ci connectors migrate-to-poetry` command. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class AirbyteCiPackageConfiguration(BaseModel):
required_environment_variables: Set[str] = Field(
set(), description="List of unique required environment variables to pass to the container running the poe task"
)
extra_poetry_groups: Set[str] = Field(set(), description="List of unique extra poetry groups to install")
poetry_extras: Set[str] = Field(set(), description="List of unique poetry extras to install")
optional_poetry_groups: Set[str] = Field(set(), description="List of unique poetry groups to install")
side_car_docker_engine: bool = Field(
False, description="Flag indicating the use of a sidecar Docker engine during the poe task executions"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ def prepare_container_for_poe_tasks(
container = container.with_workdir(f"/airbyte/{poetry_package_path}")

# Install the poetry package
container = container.with_exec(["poetry", "install"] + [f"--with={group}" for group in airbyte_ci_package_config.extra_poetry_groups])
container = container.with_exec(
["poetry", "install"]
+ [f"--with={group}" for group in airbyte_ci_package_config.optional_poetry_groups]
+ [f"--extras={extra}" for extra in airbyte_ci_package_config.poetry_extras]
)
return container


Expand Down
4 changes: 2 additions & 2 deletions airbyte-ci/connectors/pipelines/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pipelines"
version = "4.6.2"
version = "4.6.3"
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines"
authors = ["Airbyte <contact@airbyte.io>"]

Expand Down Expand Up @@ -62,6 +62,6 @@ type_check = "mypy pipelines --disallow-untyped-defs"
lint = "ruff check pipelines"

[tool.airbyte_ci]
extra_poetry_groups = ["dev"]
optional_poetry_groups = ["dev"]
poe_tasks = ["type_check", "lint", "test"]
mount_docker_socket = true
2 changes: 1 addition & 1 deletion airbyte-lib/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ airbyte-lib-validate-source = "airbyte_lib.validate:run"
test = "pytest tests"

[tool.airbyte_ci]
extra_poetry_groups = ["dev"]
optional_poetry_groups = ["dev"]
poe_tasks = ["test"]
required_environment_variables = ["GCP_GSM_CREDENTIALS"]
side_car_docker_engine = true
Loading