Skip to content

Commit 5c6acb4

Browse files
alafanechereerohmensing
authored andcommitted
airbyte-ci: do no run QA checks on publish - only MetadataValidation (#35437)
Co-authored-by: Ella Rohm-Ensing <[email protected]>
1 parent 5832206 commit 5c6acb4

File tree

4 files changed

+27
-25
lines changed

4 files changed

+27
-25
lines changed

airbyte-ci/connectors/pipelines/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ E.G.: running Poe tasks on the modified internal packages of the current branch:
644644

645645
| Version | PR | Description |
646646
| ------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
647+
| 4.3.1 | [#35437](https://github.com/airbytehq/airbyte/pull/35437) | Do not run QA checks on publish, just MetadataValidation. |
647648
| 4.3.0 | [#35438](https://github.com/airbytehq/airbyte/pull/35438) | Optionally disable telemetry with environment variable. |
648649
| 4.2.4 | [#35325](https://github.com/airbytehq/airbyte/pull/35325) | Use `connectors_qa` for QA checks and remove redundant checks. |
649650
| 4.2.3 | [#35322](https://github.com/airbytehq/airbyte/pull/35322) | Declare `connectors_qa` as an internal package for testing. |

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
from pipelines.airbyte_ci.connectors.build_image import steps
1414
from pipelines.airbyte_ci.connectors.publish.context import PublishConnectorContext
1515
from pipelines.airbyte_ci.connectors.reports import ConnectorReport
16-
from pipelines.airbyte_ci.connectors.test.steps.common import QaChecks
17-
from pipelines.airbyte_ci.metadata.pipeline import MetadataUpload
16+
from pipelines.airbyte_ci.metadata.pipeline import MetadataUpload, MetadataValidation
1817
from pipelines.airbyte_ci.steps.python_registry import PublishToPythonRegistry, PythonRegistryPublishContext
1918
from pipelines.dagger.actions.remote_storage import upload_to_gcs
2019
from pipelines.dagger.actions.system import docker
@@ -274,11 +273,11 @@ def create_connector_report(results: List[StepResult]) -> ConnectorReport:
274273

275274
results = []
276275

277-
qa_check_results = await QaChecks(context).run()
278-
results.append(qa_check_results)
276+
metadata_validation_results = await MetadataValidation(context).run()
277+
results.append(metadata_validation_results)
279278

280-
# Exit early if the qa checks do not pass
281-
if qa_check_results.status is not StepStatus.SUCCESS:
279+
# Exit early if the metadata file is invalid.
280+
if metadata_validation_results.status is not StepStatus.SUCCESS:
282281
return create_connector_report(results)
283282

284283
check_connector_image_results = await CheckConnectorImageDoesNotExist(context).run()

airbyte-ci/connectors/pipelines/pyproject.toml

Lines changed: 1 addition & 1 deletion
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.3.0"
7+
version = "4.3.1"
88
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines"
99
authors = ["Airbyte <[email protected]>"]
1010

airbyte-ci/connectors/pipelines/tests/test_publish.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def test_parse_spec_output_no_spec(self, publish_context):
147147

148148

149149
STEPS_TO_PATCH = [
150-
(publish_pipeline, "QaChecks"),
150+
(publish_pipeline, "MetadataValidation"),
151151
(publish_pipeline, "MetadataUpload"),
152152
(publish_pipeline, "CheckConnectorImageDoesNotExist"),
153153
(publish_pipeline, "UploadSpecToCache"),
@@ -159,29 +159,29 @@ def test_parse_spec_output_no_spec(self, publish_context):
159159

160160

161161
@pytest.mark.parametrize("pre_release", [True, False])
162-
async def test_run_connector_publish_pipeline_when_failed_qa_checks(mocker, pre_release):
163-
"""We validate that no other steps are called if the qa checks step fails."""
162+
async def test_run_connector_publish_pipeline_when_failed_validation(mocker, pre_release):
163+
"""We validate that no other steps are called if the metadata validation step fails."""
164164
for module, to_mock in STEPS_TO_PATCH:
165165
mocker.patch.object(module, to_mock, return_value=mocker.AsyncMock())
166166

167-
run_qa_checks = publish_pipeline.QaChecks.return_value.run
168-
run_qa_checks.return_value = mocker.Mock(status=StepStatus.FAILURE)
167+
run_metadata_validation = publish_pipeline.MetadataValidation.return_value.run
168+
run_metadata_validation.return_value = mocker.Mock(status=StepStatus.FAILURE)
169169

170170
context = mocker.MagicMock(pre_release=pre_release)
171171
semaphore = anyio.Semaphore(1)
172172
report = await publish_pipeline.run_connector_publish_pipeline(context, semaphore)
173-
run_qa_checks.assert_called_once()
173+
run_metadata_validation.assert_called_once()
174174

175175
# Check that nothing else is called
176176
for module, to_mock in STEPS_TO_PATCH:
177-
if to_mock != "QaChecks":
177+
if to_mock != "MetadataValidation":
178178
getattr(module, to_mock).return_value.run.assert_not_called()
179179

180180
assert (
181181
report.steps_results
182182
== context.report.steps_results
183183
== [
184-
run_qa_checks.return_value,
184+
run_metadata_validation.return_value,
185185
]
186186
)
187187

@@ -200,8 +200,8 @@ async def test_run_connector_publish_pipeline_when_image_exists_or_failed(mocker
200200
for module, to_mock in STEPS_TO_PATCH:
201201
mocker.patch.object(module, to_mock, return_value=mocker.AsyncMock())
202202

203-
run_qa_checks = publish_pipeline.QaChecks.return_value.run
204-
run_qa_checks.return_value = mocker.Mock(status=StepStatus.SUCCESS)
203+
run_metadata_validation = publish_pipeline.MetadataValidation.return_value.run
204+
run_metadata_validation.return_value = mocker.Mock(status=StepStatus.SUCCESS)
205205

206206
# ensure spec always succeeds
207207
run_upload_spec_to_cache = publish_pipeline.UploadSpecToCache.return_value.run
@@ -214,12 +214,12 @@ async def test_run_connector_publish_pipeline_when_image_exists_or_failed(mocker
214214

215215
semaphore = anyio.Semaphore(1)
216216
report = await publish_pipeline.run_connector_publish_pipeline(publish_context, semaphore)
217-
run_qa_checks.assert_called_once()
217+
run_metadata_validation.assert_called_once()
218218
run_check_connector_image_does_not_exist.assert_called_once()
219219

220220
# Check that nothing else is called
221221
for module, to_mock in STEPS_TO_PATCH:
222-
if to_mock not in ["QaChecks", "MetadataUpload", "CheckConnectorImageDoesNotExist", "UploadSpecToCache"]:
222+
if to_mock not in ["MetadataValidation", "MetadataUpload", "CheckConnectorImageDoesNotExist", "UploadSpecToCache"]:
223223
getattr(module, to_mock).return_value.run.assert_not_called()
224224

225225
if check_image_exists_status is StepStatus.SKIPPED:
@@ -228,7 +228,7 @@ async def test_run_connector_publish_pipeline_when_image_exists_or_failed(mocker
228228
report.steps_results
229229
== publish_context.report.steps_results
230230
== [
231-
run_qa_checks.return_value,
231+
run_metadata_validation.return_value,
232232
run_check_connector_image_does_not_exist.return_value,
233233
run_upload_spec_to_cache.return_value,
234234
run_metadata_upload.return_value,
@@ -241,7 +241,7 @@ async def test_run_connector_publish_pipeline_when_image_exists_or_failed(mocker
241241
report.steps_results
242242
== publish_context.report.steps_results
243243
== [
244-
run_qa_checks.return_value,
244+
run_metadata_validation.return_value,
245245
run_check_connector_image_does_not_exist.return_value,
246246
]
247247
)
@@ -268,10 +268,12 @@ async def test_run_connector_publish_pipeline_when_image_does_not_exist(
268268
upload_to_spec_cache_step_status,
269269
metadata_upload_step_status,
270270
):
271-
"""We check that the full pipeline is executed as expected when the connector image does not exist and the qa checks passed."""
271+
"""We check that the full pipeline is executed as expected when the connector image does not exist and the metadata validation passed."""
272272
for module, to_mock in STEPS_TO_PATCH:
273273
mocker.patch.object(module, to_mock, return_value=mocker.AsyncMock())
274-
publish_pipeline.QaChecks.return_value.run.return_value = mocker.Mock(name="qa_checks_result", status=StepStatus.SUCCESS)
274+
publish_pipeline.MetadataValidation.return_value.run.return_value = mocker.Mock(
275+
name="metadata_validation_result", status=StepStatus.SUCCESS
276+
)
275277
publish_pipeline.CheckConnectorImageDoesNotExist.return_value.run.return_value = mocker.Mock(
276278
name="check_connector_image_does_not_exist_result", status=StepStatus.SUCCESS
277279
)
@@ -306,7 +308,7 @@ async def test_run_connector_publish_pipeline_when_image_does_not_exist(
306308
report = await publish_pipeline.run_connector_publish_pipeline(context, semaphore)
307309

308310
steps_to_run = [
309-
publish_pipeline.QaChecks.return_value.run,
311+
publish_pipeline.MetadataValidation.return_value.run,
310312
publish_pipeline.CheckConnectorImageDoesNotExist.return_value.run,
311313
publish_pipeline.steps.run_connector_build,
312314
publish_pipeline.PushConnectorImageToRegistry.return_value.run,
@@ -364,7 +366,7 @@ async def test_run_connector_python_registry_publish_pipeline(
364366
)
365367

366368
for step in [
367-
publish_pipeline.QaChecks,
369+
publish_pipeline.MetadataValidation,
368370
publish_pipeline.CheckConnectorImageDoesNotExist,
369371
publish_pipeline.UploadSpecToCache,
370372
publish_pipeline.MetadataUpload,

0 commit comments

Comments
 (0)