diff --git a/airbyte-ci/connectors/pipelines/README.md b/airbyte-ci/connectors/pipelines/README.md index 2a15062dcdcd7..99d25dd0c415e 100644 --- a/airbyte-ci/connectors/pipelines/README.md +++ b/airbyte-ci/connectors/pipelines/README.md @@ -66,6 +66,10 @@ To clean the airbyte-ci install, run the following command: make tools.airbyte-ci.clean ``` +## Disabling telemetry + +We collect anonymous usage data to help improve the tool. If you would like to disable this, you can set the `AIRBYTE_CI_DISABLE_TELEMETRY` environment variable to `true`. + ## Installation for development #### Pre-requisites @@ -640,6 +644,7 @@ E.G.: running Poe tasks on the modified internal packages of the current branch: | Version | PR | Description | | ------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| 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. | | 4.2.3 | [#35322](https://github.com/airbytehq/airbyte/pull/35322) | Declare `connectors_qa` as an internal package for testing. | | 4.2.2 | [#35364](https://github.com/airbytehq/airbyte/pull/35364) | Fix connector tests following gradle changes in #35307. | diff --git a/airbyte-ci/connectors/pipelines/pipelines/cli/telemetry.py b/airbyte-ci/connectors/pipelines/pipelines/cli/telemetry.py index a6998724897ac..8ecb606973a1e 100644 --- a/airbyte-ci/connectors/pipelines/pipelines/cli/telemetry.py +++ b/airbyte-ci/connectors/pipelines/pipelines/cli/telemetry.py @@ -13,13 +13,15 @@ import segment.analytics as analytics # type: ignore from asyncclick import get_current_context +DISABLE_TELEMETRY = os.environ.get("AIRBYTE_CI_DISABLE_TELEMETRY", "false").lower() == "true" + if TYPE_CHECKING: from typing import Any, Callable, Dict, Tuple from asyncclick import Command analytics.write_key = "G6G7whgro81g9xM00kN2buclGKvcOjFd" -analytics.send = True +analytics.send = not DISABLE_TELEMETRY analytics.debug = False @@ -49,13 +51,13 @@ def click_track_command(f: Callable) -> Callable: def wrapper(*args: Tuple, **kwargs: Dict[str, Any]) -> Command: ctx = get_current_context() + top_level_command = ctx.command_path full_cmd = " ".join(sys.argv) # remove anything prior to the command name f.__name__ # to avoid logging inline secrets - santized_cmd = full_cmd[full_cmd.find(top_level_command) :] - + sanitized_cmd = full_cmd[full_cmd.find(top_level_command) :] sys_id = _get_anonymous_system_id() sys_user_name = f"anonymous:{sys_id}" airbyter = _is_airbyte_user() @@ -65,7 +67,7 @@ def wrapper(*args: Tuple, **kwargs: Dict[str, Any]) -> Command: event = f"airbyte-ci:{f.__name__}" # IMPORTANT! do not log kwargs as they may contain secrets - analytics.track(user_id, event, {"username": sys_user_name, "command": santized_cmd, "airbyter": airbyter}) + analytics.track(user_id, event, {"username": sys_user_name, "command": sanitized_cmd, "airbyter": airbyter}) return f(*args, **kwargs) diff --git a/airbyte-ci/connectors/pipelines/pyproject.toml b/airbyte-ci/connectors/pipelines/pyproject.toml index 6f77c50066f9e..275aad8b7b949 100644 --- a/airbyte-ci/connectors/pipelines/pyproject.toml +++ b/airbyte-ci/connectors/pipelines/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "pipelines" -version = "4.2.4" +version = "4.3.0" description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines" authors = ["Airbyte "]