diff --git a/airbyte-ci/connectors/pipelines/README.md b/airbyte-ci/connectors/pipelines/README.md index b127b33c836c..334be5f9dfcd 100644 --- a/airbyte-ci/connectors/pipelines/README.md +++ b/airbyte-ci/connectors/pipelines/README.md @@ -652,6 +652,7 @@ E.G.: running Poe tasks on the modified internal packages of the current branch: | Version | PR | Description | | ------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| 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. | | 4.5.4 | [#36206](https://github.com/airbytehq/airbyte/pull/36206) | Revert poetry cache removal during nightly builds | diff --git a/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/migrate_to_base_image/commands.py b/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/migrate_to_base_image/commands.py index 7b6196e6eee5..50f98a85a4ff 100644 --- a/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/migrate_to_base_image/commands.py +++ b/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/migrate_to_base_image/commands.py @@ -2,6 +2,7 @@ # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # + import asyncclick as click from pipelines.airbyte_ci.connectors.context import ConnectorContext from pipelines.airbyte_ci.connectors.migrate_to_base_image.pipeline import run_connector_migration_to_base_image_pipeline @@ -14,13 +15,16 @@ cls=DaggerPipelineCommand, short_help="Make the selected connectors use our base image: remove dockerfile, update metadata.yaml and update documentation.", ) -@click.argument("pull-request-number", type=str) +@click.option("pull-request-number", type=str, required=False, default=None) @click.pass_context async def migrate_to_base_image( ctx: click.Context, - pull_request_number: str, + pull_request_number: str | None, ) -> bool: - """Bump a connector version: update metadata.yaml, changelog and delete legacy files.""" + """ + Bump a connector version: update metadata.yaml, changelog and delete legacy files. + If the `PULL_REQUEST_NUMBER` is not provided, no changelog entry will be added. + """ fail_if_missing_docker_hub_creds(ctx) diff --git a/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/migrate_to_base_image/pipeline.py b/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/migrate_to_base_image/pipeline.py index cb1f6d357d3a..b544943deac3 100644 --- a/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/migrate_to_base_image/pipeline.py +++ b/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/migrate_to_base_image/pipeline.py @@ -284,12 +284,11 @@ async def run_connector_base_image_upgrade_pipeline(context: ConnectorContext, s async def run_connector_migration_to_base_image_pipeline( - context: ConnectorContext, semaphore: "Semaphore", pull_request_number: str + context: ConnectorContext, semaphore: "Semaphore", pull_request_number: str | None ) -> Report: async with semaphore: steps_results = [] async with context: - # DELETE DOCKERFILE delete_docker_file = DeleteConnectorFile( context, "Dockerfile", @@ -330,16 +329,17 @@ async def run_connector_migration_to_base_image_pipeline( bump_version_in_metadata_result = await bump_version_in_metadata.run() steps_results.append(bump_version_in_metadata_result) - # ADD CHANGELOG ENTRY - add_changelog_entry = AddChangelogEntry( - context, - bump_version_in_metadata_result.output, - new_version, - "Base image migration: remove Dockerfile and use the python-connector-base image", - pull_request_number, - ) - add_changelog_entry_result = await add_changelog_entry.run() - steps_results.append(add_changelog_entry_result) + # ADD CHANGELOG ENTRY only if the PR number is provided. + if pull_request_number is not None: + add_changelog_entry = AddChangelogEntry( + context, + bump_version_in_metadata_result.output, + new_version, + "Base image migration: remove Dockerfile and use the python-connector-base image", + pull_request_number, + ) + add_changelog_entry_result = await add_changelog_entry.run() + steps_results.append(add_changelog_entry_result) # UPDATE DOC add_build_instructions_to_doc = AddBuildInstructionsToReadme( diff --git a/airbyte-ci/connectors/pipelines/pyproject.toml b/airbyte-ci/connectors/pipelines/pyproject.toml index e0febef44052..c71f38efd518 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 = "4.6.1" +version = "4.6.2" description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines" authors = ["Airbyte "]