Skip to content

Commit d96d47d

Browse files
fix(airbyte-ci): fix progressive rollout finalize steps bugs (airbytehq#46278)
Co-authored-by: Octavia Squidington III <[email protected]>
1 parent 0e7f3bc commit d96d47d

File tree

4 files changed

+31
-25
lines changed

4 files changed

+31
-25
lines changed

.github/workflows/finalize_rollout.yml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
metadata_service_gcs_credentials: ${{ secrets.METADATA_SERVICE_PROD_GCS_CREDENTIALS }}
4444
sentry_dsn: ${{ secrets.SENTRY_AIRBYTE_CI_DSN }}
4545
slack_webhook_url: ${{ secrets.PUBLISH_ON_MERGE_SLACK_WEBHOOK }}
46+
spec_cache_gcs_credentials: ${{ secrets.SPEC_CACHE_SERVICE_ACCOUNT_KEY_PUBLISH }}
4647
subcommand: "connectors --name=${{ github.event.inputs.connector_name }} publish --promote-release-candidate"
4748
- name: Rollback {{ github.event.inputs.connector_name }} release candidate
4849
id: rollback-release-candidate

airbyte-ci/connectors/pipelines/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,8 @@ airbyte-ci connectors --language=low-code migrate-to-manifest-only
851851

852852
| Version | PR | Description |
853853
| ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
854-
| 4.36.1 | | `airbyte-ci format js` respects `.prettierc` and `.prettierignore` |
854+
| 4.36.2 | [#46278](https://github.com/airbytehq/airbyte/pull/46278) | Fixed a bug in RC rollout and promote not taking `semaphore` |
855+
| 4.36.1 | [#46274](https://github.com/airbytehq/airbyte/pull/46274) | `airbyte-ci format js` respects `.prettierc` and `.prettierignore` |
855856
| 4.36.0 | [#44877](https://github.com/airbytehq/airbyte/pull/44877) | Implement `--promote/rollback-release-candidate` in `connectors publish`. |
856857
| 4.35.6 | [#45632](https://github.com/airbytehq/airbyte/pull/45632) | Add entry to format file ignore list (`destination-*/expected-spec.json`) |
857858
| 4.35.5 | [#45672](https://github.com/airbytehq/airbyte/pull/45672) | Fix docs mount during publish |

airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/publish/pipeline.py

+27-23
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ async def _run_python_registry_publish_pipeline(context: PublishConnectorContext
543543
return results, False
544544

545545

546-
async def run_connector_rollback_pipeline(context: PublishConnectorContext) -> ConnectorReport:
546+
async def run_connector_rollback_pipeline(context: PublishConnectorContext, semaphore: anyio.Semaphore) -> ConnectorReport:
547547
"""Run a rollback pipeline for a single connector.
548548
549549
1. Check if the current metadata is a release candidate
@@ -554,19 +554,22 @@ async def run_connector_rollback_pipeline(context: PublishConnectorContext) -> C
554554
"""
555555

556556
results = []
557-
async with context:
558-
assert context.rollout_mode == RolloutMode.ROLLBACK, "This pipeline can only run in rollback mode."
559-
assert context.connector.metadata.get("releases", {}).get(
560-
"isReleaseCandidate", True
561-
), "This pipeline can only run for release candidates."
562-
results.append(
563-
await MetadataRollbackReleaseCandidate(context, context.metadata_bucket_name, context.metadata_service_gcs_credentials).run()
564-
)
557+
async with semaphore:
558+
async with context:
559+
assert context.rollout_mode == RolloutMode.ROLLBACK, "This pipeline can only run in rollback mode."
560+
assert context.connector.metadata.get("releases", {}).get(
561+
"isReleaseCandidate", True
562+
), "This pipeline can only run for release candidates."
563+
results.append(
564+
await MetadataRollbackReleaseCandidate(
565+
context, context.metadata_bucket_name, context.metadata_service_gcs_credentials
566+
).run()
567+
)
565568

566569
return ConnectorReport(context, results, name="ROLLBACK RESULTS")
567570

568571

569-
async def run_connector_promote_pipeline(context: PublishConnectorContext) -> ConnectorReport:
572+
async def run_connector_promote_pipeline(context: PublishConnectorContext, semaphore: anyio.Semaphore) -> ConnectorReport:
570573
"""Run a promote pipeline for a single connector.
571574
572575
1. Publish the release candidate version docker image with the latest tag.
@@ -576,19 +579,20 @@ async def run_connector_promote_pipeline(context: PublishConnectorContext) -> Co
576579
ConnectorReport: The reports holding promote results.
577580
"""
578581
results = []
579-
async with context:
580-
assert context.rollout_mode == RolloutMode.PROMOTE, "This pipeline can only run in promote mode."
581-
assert context.connector.metadata.get("releases", {}).get(
582-
"isReleaseCandidate", True
583-
), "This pipeline can only run for release candidates."
584-
metadata_promote_result = await MetadataPromoteReleaseCandidate(
585-
context, context.metadata_bucket_name, context.metadata_service_gcs_credentials
586-
).run()
587-
results.append(metadata_promote_result)
588-
if metadata_promote_result.status is StepStatus.FAILURE:
589-
return ConnectorReport(context, results, name="PROMOTE RESULTS")
590-
publish_latest_tag_results = await PushVersionImageAsLatest(context).run()
591-
results.append(publish_latest_tag_results)
582+
async with semaphore:
583+
async with context:
584+
assert context.rollout_mode == RolloutMode.PROMOTE, "This pipeline can only run in promote mode."
585+
assert context.connector.metadata.get("releases", {}).get(
586+
"isReleaseCandidate", True
587+
), "This pipeline can only run for release candidates."
588+
metadata_promote_result = await MetadataPromoteReleaseCandidate(
589+
context, context.metadata_bucket_name, context.metadata_service_gcs_credentials
590+
).run()
591+
results.append(metadata_promote_result)
592+
if metadata_promote_result.status is StepStatus.FAILURE:
593+
return ConnectorReport(context, results, name="PROMOTE RESULTS")
594+
publish_latest_tag_results = await PushVersionImageAsLatest(context).run()
595+
results.append(publish_latest_tag_results)
592596
return ConnectorReport(context, results, name="PROMOTE RESULTS")
593597

594598

airbyte-ci/connectors/pipelines/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "pipelines"
7-
version = "4.36.1"
7+
version = "4.36.2"
88
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines"
99
authors = ["Airbyte <[email protected]>"]
1010

0 commit comments

Comments
 (0)