Skip to content

Commit bc6bd50

Browse files
authored
airbyte-ci: ignore archived connectors (#43426)
1 parent 597ccdc commit bc6bd50

File tree

6 files changed

+20
-6
lines changed

6 files changed

+20
-6
lines changed

airbyte-ci/connectors/pipelines/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ Available commands:
253253
| `--metadata-query` | False | | | Filter connectors by the `data` field in the metadata file using a [simpleeval](https://github.com/danthedeckie/simpleeval) query. e.g. 'data.ab_internal.ql == 200' |
254254
| `--use-local-cdk` | False | False | | Build with the airbyte-cdk from the local repository. " "This is useful for testing changes to the CDK. |
255255
| `--language` | True | | | Select connectors with a specific language: `python`, `low-code`, `java`. Can be used multiple times to select multiple languages. |
256-
| `--modified` | False | False | | Run the pipeline on only the modified connectors on the branch or previous commit (depends on the pipeline implementation). |
256+
| `--modified` | False | False | | Run the pipeline on only the modified connectors on the branch or previous commit (depends on the pipeline implementation). Archived connectors are ignored. |
257257
| `--concurrency` | False | 5 | | Control the number of connector pipelines that can run in parallel. Useful to speed up pipelines or control their resource usage. |
258258
| `--metadata-change-only/--not-metadata-change-only` | False | `--not-metadata-change-only` | | Only run the pipeline on connectors with changes on their metadata.yaml file. |
259259
| `--enable-dependency-scanning / --disable-dependency-scanning` | False | ` --disable-dependency-scanning` | | When enabled the dependency scanning will be performed to detect the connectors to select according to a dependency change. |
@@ -789,6 +789,7 @@ airbyte-ci connectors --language=low-code migrate-to-manifest-only
789789

790790
| Version | PR | Description |
791791
|---------| ---------------------------------------------------------- |------------------------------------------------------------------------------------------------------------------------------|
792+
| 4.31.3 | [#43426](https://github.com/airbytehq/airbyte/pull/43426) | Ignore archived connectors on connector selection from modified files. |
792793
| 4.31.2 | [#43433](https://github.com/airbytehq/airbyte/pull/43433) | Fix 'changed_file' indentation in 'pull-request' command |
793794
| 4.31.1 | [#43442](https://github.com/airbytehq/airbyte/pull/43442) | Resolve type check failure in bump version |
794795
| 4.31.0 | [#42970](https://github.com/airbytehq/airbyte/pull/42970) | Add explicit version set to bump version |

airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/commands.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,12 @@ def validate_environment(is_local: bool) -> None:
169169
help="Filter connectors to test by support_level.",
170170
type=click.Choice(SupportLevelEnum),
171171
)
172-
@click.option("--modified/--not-modified", help="Only test modified connectors in the current branch.", default=False, type=bool)
172+
@click.option(
173+
"--modified/--not-modified",
174+
help="Only test modified connectors in the current branch. Archived connectors are ignored",
175+
default=False,
176+
type=bool,
177+
)
173178
@click.option(
174179
"--metadata-changes-only/--not-metadata-changes-only",
175180
help="Only test connectors with modified metadata files in the current branch.",

airbyte-ci/connectors/pipelines/pipelines/helpers/connectors/modifed.py

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ def _find_modified_connectors(
2727
modified_connectors = set()
2828

2929
for connector in all_connectors:
30+
if connector.support_level == "archived":
31+
main_logger.info(f"Skipping connector '{connector}' due to 'archived' support level.")
32+
continue
3033
if Path(file_path).is_relative_to(Path(connector.code_directory)) or file_path == connector.documentation_file_path:
3134
main_logger.info(f"Adding connector '{connector}' due to connector file modification: {file_path}.")
3235
modified_connectors.add(connector)

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.31.2"
7+
version = "4.31.3"
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_commands/test_groups/test_connectors.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,11 @@ def test_get_selected_connectors_with_modified_and_language():
133133
metadata_query=None,
134134
modified_files=modified_files,
135135
)
136-
137-
assert len(selected_connectors) == 1
136+
has_strict_encrypt_variant = any("-strict-encrypt" in c.technical_name for c in selected_connectors)
137+
if has_strict_encrypt_variant:
138+
assert len(selected_connectors) == 2
139+
else:
140+
assert len(selected_connectors) == 1
138141
assert selected_connectors[0].technical_name == second_modified_connector.technical_name
139142

140143

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def pick_a_random_connector(
3535
all_connectors = [c for c in all_connectors if c.language is language]
3636
if support_level:
3737
all_connectors = [c for c in all_connectors if c.support_level == support_level]
38+
else:
39+
all_connectors = [c for c in all_connectors if c.support_level != "archived"]
3840
picked_connector = random.choice(all_connectors)
3941
if other_picked_connectors:
4042
while picked_connector in other_picked_connectors:
@@ -44,7 +46,7 @@ def pick_a_random_connector(
4446

4547
def pick_a_strict_encrypt_variant_pair():
4648
for c in ALL_CONNECTORS:
47-
if c.technical_name.endswith("-strict-encrypt"):
49+
if c.technical_name.endswith("-strict-encrypt") and c.support_level != "archived":
4850
main_connector = Connector(c.relative_connector_path.replace("-strict-encrypt", ""))
4951
return main_connector, c
5052

0 commit comments

Comments
 (0)