Skip to content

Commit 2458c9b

Browse files
authored
airbyte-ci: make QA check work on strict-encrypt connectors (#35536)
1 parent 833f336 commit 2458c9b

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
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.2 | [#35536](https://github.com/airbytehq/airbyte/pull/35536) | Make QA checks run correctly on `*-strict-encrypt` connectors. |
647648
| 4.3.1 | [#35437](https://github.com/airbytehq/airbyte/pull/35437) | Do not run QA checks on publish, just MetadataValidation. |
648649
| 4.3.0 | [#35438](https://github.com/airbytehq/airbyte/pull/35438) | Optionally disable telemetry with environment variable. |
649650
| 4.2.4 | [#35325](https://github.com/airbytehq/airbyte/pull/35325) | Use `connectors_qa` for QA checks and remove redundant checks. |

airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/test/steps/common.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
from abc import ABC, abstractmethod
1010
from functools import cached_property
11+
from pathlib import Path
1112
from typing import ClassVar, List, Optional
1213

1314
import requests # type: ignore
@@ -124,16 +125,33 @@ class QaChecks(SimpleDockerStep):
124125
"""
125126

126127
def __init__(self, context: ConnectorContext) -> None:
128+
code_directory = context.connector.code_directory
129+
documentation_file_path = context.connector.documentation_file_path
130+
migration_guide_file_path = context.connector.migration_guide_file_path
131+
icon_path = context.connector.icon_path
132+
technical_name = context.connector.technical_name
133+
134+
# When the connector is strict-encrypt, we should run QA checks on the main one as it's the one whose artifacts gets released
135+
if context.connector.technical_name.endswith("-strict-encrypt"):
136+
technical_name = technical_name.replace("-strict-encrypt", "")
137+
code_directory = Path(str(code_directory).replace("-strict-encrypt", ""))
138+
if documentation_file_path:
139+
documentation_file_path = Path(str(documentation_file_path).replace("-strict-encrypt", ""))
140+
if migration_guide_file_path:
141+
migration_guide_file_path = Path(str(migration_guide_file_path).replace("-strict-encrypt", ""))
142+
if icon_path:
143+
icon_path = Path(str(icon_path).replace("-strict-encrypt", ""))
144+
127145
super().__init__(
128-
title=f"Run QA checks for {context.connector.technical_name}",
146+
title=f"Run QA checks for {technical_name}",
129147
context=context,
130148
paths_to_mount=[
131-
MountPath(context.connector.code_directory),
149+
MountPath(code_directory),
132150
# These paths are optional
133151
# But their absence might make the QA check fail
134-
MountPath(context.connector.documentation_file_path, optional=True),
135-
MountPath(context.connector.migration_guide_file_path, optional=True),
136-
MountPath(context.connector.icon_path, optional=True),
152+
MountPath(documentation_file_path, optional=True),
153+
MountPath(migration_guide_file_path, optional=True),
154+
MountPath(icon_path, optional=True),
137155
],
138156
internal_tools=[
139157
MountPath(INTERNAL_TOOL_PATHS.CONNECTORS_QA.value),
@@ -146,7 +164,7 @@ def __init__(self, context: ConnectorContext) -> None:
146164
}.items()
147165
if v
148166
},
149-
command=["connectors-qa", "run", f"--name={context.connector.technical_name}"],
167+
command=["connectors-qa", "run", f"--name={technical_name}"],
150168
)
151169

152170

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.1"
7+
version = "4.3.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)