Skip to content

Commit

Permalink
airbyte-ci: make QA check work on strict-encrypt connectors (#35536)
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere authored and xiaohansong committed Feb 27, 2024
1 parent 770bbfe commit 6ec81eb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
1 change: 1 addition & 0 deletions airbyte-ci/connectors/pipelines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ E.G.: running Poe tasks on the modified internal packages of the current branch:

| Version | PR | Description |
| ------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| 4.3.2 | [#35536](https://github.com/airbytehq/airbyte/pull/35536) | Make QA checks run correctly on `*-strict-encrypt` connectors. |
| 4.3.1 | [#35437](https://github.com/airbytehq/airbyte/pull/35437) | Do not run QA checks on publish, just MetadataValidation. |
| 4.3.0 | [#35438](https://github.com/airbytehq/airbyte/pull/35438) | Optionally disable telemetry with environment variable. |
| 4.2.4 | [#35325](https://github.com/airbytehq/airbyte/pull/35325) | Use `connectors_qa` for QA checks and remove redundant checks. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
from abc import ABC, abstractmethod
from functools import cached_property
from pathlib import Path
from typing import ClassVar, List, Optional

import requests # type: ignore
Expand Down Expand Up @@ -124,16 +125,33 @@ class QaChecks(SimpleDockerStep):
"""

def __init__(self, context: ConnectorContext) -> None:
code_directory = context.connector.code_directory
documentation_file_path = context.connector.documentation_file_path
migration_guide_file_path = context.connector.migration_guide_file_path
icon_path = context.connector.icon_path
technical_name = context.connector.technical_name

# When the connector is strict-encrypt, we should run QA checks on the main one as it's the one whose artifacts gets released
if context.connector.technical_name.endswith("-strict-encrypt"):
technical_name = technical_name.replace("-strict-encrypt", "")
code_directory = Path(str(code_directory).replace("-strict-encrypt", ""))
if documentation_file_path:
documentation_file_path = Path(str(documentation_file_path).replace("-strict-encrypt", ""))
if migration_guide_file_path:
migration_guide_file_path = Path(str(migration_guide_file_path).replace("-strict-encrypt", ""))
if icon_path:
icon_path = Path(str(icon_path).replace("-strict-encrypt", ""))

super().__init__(
title=f"Run QA checks for {context.connector.technical_name}",
title=f"Run QA checks for {technical_name}",
context=context,
paths_to_mount=[
MountPath(context.connector.code_directory),
MountPath(code_directory),
# These paths are optional
# But their absence might make the QA check fail
MountPath(context.connector.documentation_file_path, optional=True),
MountPath(context.connector.migration_guide_file_path, optional=True),
MountPath(context.connector.icon_path, optional=True),
MountPath(documentation_file_path, optional=True),
MountPath(migration_guide_file_path, optional=True),
MountPath(icon_path, optional=True),
],
internal_tools=[
MountPath(INTERNAL_TOOL_PATHS.CONNECTORS_QA.value),
Expand All @@ -146,7 +164,7 @@ def __init__(self, context: ConnectorContext) -> None:
}.items()
if v
},
command=["connectors-qa", "run", f"--name={context.connector.technical_name}"],
command=["connectors-qa", "run", f"--name={technical_name}"],
)


Expand Down
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/pipelines/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pipelines"
version = "4.3.1"
version = "4.3.2"
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines"
authors = ["Airbyte <[email protected]>"]

Expand Down

0 comments on commit 6ec81eb

Please sign in to comment.