From 0a2a651d7940b0662cfd674d5968845419d8bb7c Mon Sep 17 00:00:00 2001 From: Ben Church Date: Wed, 4 Oct 2023 16:19:00 -0700 Subject: [PATCH 1/2] Add loud ci error --- airbyte-ci/connectors/pipelines/README.md | 1 + .../pipelines/pipelines/commands/airbyte_ci.py | 18 +++++++++++++----- airbyte-ci/connectors/pipelines/pyproject.toml | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/airbyte-ci/connectors/pipelines/README.md b/airbyte-ci/connectors/pipelines/README.md index 3ffd028c05587..2a081aa63d648 100644 --- a/airbyte-ci/connectors/pipelines/README.md +++ b/airbyte-ci/connectors/pipelines/README.md @@ -398,6 +398,7 @@ This command runs the Python tests for a airbyte-ci poetry package. ## Changelog | Version | PR | Description | |---------| --------------------------------------------------------- |-----------------------------------------------------------------------------------------------------------| +| 1.4.5 | | Throw error if airbyte-ci tools is out of date | | 1.4.4 | [#30743](https://github.com/airbytehq/airbyte/pull/30743) | Add `--disable-report-auto-open` and `--use-host-gradle-dist-tar` to allow gradle integration. | | 1.4.3 | [#30595](https://github.com/airbytehq/airbyte/pull/30595) | Add --version and version check | | 1.4.2 | [#30595](https://github.com/airbytehq/airbyte/pull/30595) | Remove directory name requirement | diff --git a/airbyte-ci/connectors/pipelines/pipelines/commands/airbyte_ci.py b/airbyte-ci/connectors/pipelines/pipelines/commands/airbyte_ci.py index 7cd3d55903481..b14a4d1a6bada 100644 --- a/airbyte-ci/connectors/pipelines/pipelines/commands/airbyte_ci.py +++ b/airbyte-ci/connectors/pipelines/pipelines/commands/airbyte_ci.py @@ -35,19 +35,27 @@ def check_up_to_date() -> bool: """Check if the installed version of pipelines is up to date.""" - # get the version of the latest release, which is just in the pyproject.toml file of the pipelines package - # as this is an internal tool, we don't need to check for the latest version on PyPI latest_version = get_latest_version() if latest_version != __installed_version__: - main_logger.warning(f"pipelines is not up to date. Installed version: {__installed_version__}. Latest version: {latest_version}") - main_logger.warning("Please run `pipx reinstall pipelines` to upgrade to the latest version.") - return False + upgrade_error_message = f""" + 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 + + airbyte-ci is not up to date. Installed version: {__installed_version__}. Latest version: {latest_version} + Please run `pipx reinstall pipelines` to upgrade to the latest version. + + 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 + """ + raise Exception(upgrade_error_message) main_logger.info(f"pipelines is up to date. Installed version: {__installed_version__}. Latest version: {latest_version}") return True def get_latest_version() -> str: + """ + Get the version of the latest release, which is just in the pyproject.toml file of the pipelines package + as this is an internal tool, we don't need to check for the latest version on PyPI + """ path_to_pyproject_toml = LOCAL_PIPELINE_PACKAGE_PATH + "pyproject.toml" with open(path_to_pyproject_toml, "r") as f: for line in f.readlines(): diff --git a/airbyte-ci/connectors/pipelines/pyproject.toml b/airbyte-ci/connectors/pipelines/pyproject.toml index 4564419a82e10..7e28fb07aafd3 100644 --- a/airbyte-ci/connectors/pipelines/pyproject.toml +++ b/airbyte-ci/connectors/pipelines/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "pipelines" -version = "1.4.4" +version = "1.4.5" description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines" authors = ["Airbyte "] From 0afe8c1104494fd37a67f08dcc62650014702e02 Mon Sep 17 00:00:00 2001 From: Ben Church Date: Wed, 4 Oct 2023 16:20:44 -0700 Subject: [PATCH 2/2] Update readme --- airbyte-ci/connectors/pipelines/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-ci/connectors/pipelines/README.md b/airbyte-ci/connectors/pipelines/README.md index 2a081aa63d648..c68f328fab2a7 100644 --- a/airbyte-ci/connectors/pipelines/README.md +++ b/airbyte-ci/connectors/pipelines/README.md @@ -398,7 +398,7 @@ This command runs the Python tests for a airbyte-ci poetry package. ## Changelog | Version | PR | Description | |---------| --------------------------------------------------------- |-----------------------------------------------------------------------------------------------------------| -| 1.4.5 | | Throw error if airbyte-ci tools is out of date | +| 1.4.5 |[ #31087](https://github.com/airbytehq/airbyte/pull/31087) | Throw error if airbyte-ci tools is out of date | | 1.4.4 | [#30743](https://github.com/airbytehq/airbyte/pull/30743) | Add `--disable-report-auto-open` and `--use-host-gradle-dist-tar` to allow gradle integration. | | 1.4.3 | [#30595](https://github.com/airbytehq/airbyte/pull/30595) | Add --version and version check | | 1.4.2 | [#30595](https://github.com/airbytehq/airbyte/pull/30595) | Remove directory name requirement |