airbyte-internal-ops 0.1.4__py3-none-any.whl → 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {airbyte_internal_ops-0.1.4.dist-info → airbyte_internal_ops-0.1.6.dist-info}/METADATA +70 -1
- {airbyte_internal_ops-0.1.4.dist-info → airbyte_internal_ops-0.1.6.dist-info}/RECORD +30 -31
- airbyte_ops_mcp/__init__.py +30 -2
- airbyte_ops_mcp/_legacy/airbyte_ci/connector_pipelines/airbyte_ci/connectors/pipeline.py +2 -8
- airbyte_ops_mcp/airbyte_repo/list_connectors.py +176 -4
- airbyte_ops_mcp/airbyte_repo/utils.py +5 -3
- airbyte_ops_mcp/cli/cloud.py +35 -36
- airbyte_ops_mcp/cli/registry.py +90 -1
- airbyte_ops_mcp/cli/repo.py +15 -0
- airbyte_ops_mcp/connection_config_retriever/__init__.py +26 -0
- airbyte_ops_mcp/{live_tests/_connection_retriever → connection_config_retriever}/audit_logging.py +5 -6
- airbyte_ops_mcp/{live_tests/_connection_retriever → connection_config_retriever}/retrieval.py +8 -22
- airbyte_ops_mcp/{live_tests/_connection_retriever → connection_config_retriever}/secrets_resolution.py +8 -42
- airbyte_ops_mcp/constants.py +35 -0
- airbyte_ops_mcp/live_tests/connection_secret_retriever.py +1 -1
- airbyte_ops_mcp/mcp/github_repo_ops.py +10 -0
- airbyte_ops_mcp/mcp/live_tests.py +21 -6
- airbyte_ops_mcp/mcp/prod_db_queries.py +357 -0
- airbyte_ops_mcp/mcp/server.py +2 -0
- airbyte_ops_mcp/mcp/server_info.py +2 -2
- airbyte_ops_mcp/prod_db_access/__init__.py +34 -0
- airbyte_ops_mcp/prod_db_access/db_engine.py +127 -0
- airbyte_ops_mcp/prod_db_access/py.typed +0 -0
- airbyte_ops_mcp/prod_db_access/queries.py +272 -0
- airbyte_ops_mcp/prod_db_access/sql.py +353 -0
- airbyte_ops_mcp/registry/__init__.py +34 -0
- airbyte_ops_mcp/registry/models.py +63 -0
- airbyte_ops_mcp/registry/publish.py +368 -0
- airbyte_ops_mcp/_legacy/airbyte_ci/connector_pipelines/airbyte_ci/connectors/publish/__init__.py +0 -3
- airbyte_ops_mcp/_legacy/airbyte_ci/connector_pipelines/airbyte_ci/connectors/publish/commands.py +0 -242
- airbyte_ops_mcp/_legacy/airbyte_ci/connector_pipelines/airbyte_ci/connectors/publish/context.py +0 -175
- airbyte_ops_mcp/_legacy/airbyte_ci/connector_pipelines/airbyte_ci/connectors/publish/pipeline.py +0 -1056
- airbyte_ops_mcp/_legacy/airbyte_ci/connector_pipelines/airbyte_ci/poetry/publish/__init__.py +0 -3
- airbyte_ops_mcp/_legacy/airbyte_ci/connector_pipelines/airbyte_ci/poetry/publish/commands.py +0 -127
- airbyte_ops_mcp/_legacy/airbyte_ci/connector_pipelines/airbyte_ci/steps/python_registry.py +0 -238
- airbyte_ops_mcp/_legacy/airbyte_ci/connector_pipelines/models/contexts/python_registry_publish.py +0 -119
- airbyte_ops_mcp/live_tests/_connection_retriever/__init__.py +0 -35
- airbyte_ops_mcp/live_tests/_connection_retriever/consts.py +0 -33
- airbyte_ops_mcp/live_tests/_connection_retriever/db_access.py +0 -82
- {airbyte_internal_ops-0.1.4.dist-info → airbyte_internal_ops-0.1.6.dist-info}/WHEEL +0 -0
- {airbyte_internal_ops-0.1.4.dist-info → airbyte_internal_ops-0.1.6.dist-info}/entry_points.txt +0 -0
airbyte_ops_mcp/_legacy/airbyte_ci/connector_pipelines/airbyte_ci/connectors/publish/context.py
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
"""Module declaring context related classes."""
|
|
6
|
-
|
|
7
|
-
from enum import Enum
|
|
8
|
-
from typing import List, Optional
|
|
9
|
-
|
|
10
|
-
import asyncclick as click
|
|
11
|
-
from consts import (
|
|
12
|
-
PUBLISH_FAILURE_SLACK_CHANNEL,
|
|
13
|
-
PUBLISH_UPDATES_SLACK_CHANNEL,
|
|
14
|
-
ContextState,
|
|
15
|
-
)
|
|
16
|
-
from github import PullRequest
|
|
17
|
-
from pipelines.airbyte_ci.connectors.context import ConnectorContext
|
|
18
|
-
from pipelines.helpers.connectors.modifed import ConnectorWithModifiedFiles
|
|
19
|
-
from pipelines.helpers.github import AIRBYTE_GITHUB_REPO_URL_PREFIX
|
|
20
|
-
from pipelines.helpers.utils import format_duration
|
|
21
|
-
from pipelines.models.secrets import Secret
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class RolloutMode(Enum):
|
|
25
|
-
ROLLBACK = "Rollback"
|
|
26
|
-
PUBLISH = "Publish"
|
|
27
|
-
PROMOTE = "Promote"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class PublishConnectorContext(ConnectorContext):
|
|
31
|
-
def __init__(
|
|
32
|
-
self,
|
|
33
|
-
connector: ConnectorWithModifiedFiles,
|
|
34
|
-
pre_release: bool,
|
|
35
|
-
spec_cache_gcs_credentials: Secret,
|
|
36
|
-
spec_cache_bucket_name: str,
|
|
37
|
-
metadata_service_gcs_credentials: Secret,
|
|
38
|
-
metadata_bucket_name: str,
|
|
39
|
-
docker_hub_username: Secret,
|
|
40
|
-
docker_hub_password: Secret,
|
|
41
|
-
ci_gcp_credentials: Secret,
|
|
42
|
-
slack_webhook: str,
|
|
43
|
-
ci_report_bucket: str,
|
|
44
|
-
report_output_prefix: str,
|
|
45
|
-
is_local: bool,
|
|
46
|
-
git_branch: str,
|
|
47
|
-
git_revision: str,
|
|
48
|
-
diffed_branch: str,
|
|
49
|
-
git_repo_url: str,
|
|
50
|
-
python_registry_url: str,
|
|
51
|
-
python_registry_check_url: str,
|
|
52
|
-
rollout_mode: RolloutMode,
|
|
53
|
-
gha_workflow_run_url: Optional[str] = None,
|
|
54
|
-
dagger_logs_url: Optional[str] = None,
|
|
55
|
-
pipeline_start_timestamp: Optional[int] = None,
|
|
56
|
-
ci_context: Optional[str] = None,
|
|
57
|
-
pull_request: Optional[PullRequest.PullRequest] = None,
|
|
58
|
-
s3_build_cache_access_key_id: Optional[Secret] = None,
|
|
59
|
-
s3_build_cache_secret_key: Optional[Secret] = None,
|
|
60
|
-
use_local_cdk: bool = False,
|
|
61
|
-
use_cdk_ref: Optional[str] = None,
|
|
62
|
-
python_registry_token: Optional[Secret] = None,
|
|
63
|
-
ci_github_access_token: Optional[Secret] = None,
|
|
64
|
-
) -> None:
|
|
65
|
-
self.pre_release = pre_release
|
|
66
|
-
self.spec_cache_bucket_name = spec_cache_bucket_name
|
|
67
|
-
self.metadata_bucket_name = metadata_bucket_name
|
|
68
|
-
self.spec_cache_gcs_credentials = spec_cache_gcs_credentials
|
|
69
|
-
self.metadata_service_gcs_credentials = metadata_service_gcs_credentials
|
|
70
|
-
self.python_registry_token = python_registry_token
|
|
71
|
-
self.python_registry_url = python_registry_url
|
|
72
|
-
self.python_registry_check_url = python_registry_check_url
|
|
73
|
-
self.rollout_mode = rollout_mode
|
|
74
|
-
|
|
75
|
-
pipeline_name = f"{rollout_mode.value} {connector.technical_name}"
|
|
76
|
-
pipeline_name = (
|
|
77
|
-
pipeline_name + " (pre-release)" if pre_release else pipeline_name
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
if (use_local_cdk or use_cdk_ref) and not self.pre_release:
|
|
81
|
-
raise click.UsageError(
|
|
82
|
-
"Publishing with CDK overrides is only supported for pre-release publishing."
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
super().__init__(
|
|
86
|
-
pipeline_name=pipeline_name,
|
|
87
|
-
connector=connector,
|
|
88
|
-
report_output_prefix=report_output_prefix,
|
|
89
|
-
ci_report_bucket=ci_report_bucket,
|
|
90
|
-
is_local=is_local,
|
|
91
|
-
git_branch=git_branch,
|
|
92
|
-
git_revision=git_revision,
|
|
93
|
-
diffed_branch=diffed_branch,
|
|
94
|
-
git_repo_url=git_repo_url,
|
|
95
|
-
gha_workflow_run_url=gha_workflow_run_url,
|
|
96
|
-
dagger_logs_url=dagger_logs_url,
|
|
97
|
-
pipeline_start_timestamp=pipeline_start_timestamp,
|
|
98
|
-
ci_context=ci_context,
|
|
99
|
-
slack_webhook=slack_webhook,
|
|
100
|
-
ci_gcp_credentials=ci_gcp_credentials,
|
|
101
|
-
should_save_report=True,
|
|
102
|
-
use_local_cdk=use_local_cdk,
|
|
103
|
-
use_cdk_ref=use_cdk_ref,
|
|
104
|
-
docker_hub_username=docker_hub_username,
|
|
105
|
-
docker_hub_password=docker_hub_password,
|
|
106
|
-
s3_build_cache_access_key_id=s3_build_cache_access_key_id,
|
|
107
|
-
s3_build_cache_secret_key=s3_build_cache_secret_key,
|
|
108
|
-
ci_github_access_token=ci_github_access_token,
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
# Reassigning current class required instance attribute
|
|
112
|
-
# Which are optional in the super class
|
|
113
|
-
# for type checking
|
|
114
|
-
self.docker_hub_username: Secret = docker_hub_username
|
|
115
|
-
self.docker_hub_password: Secret = docker_hub_password
|
|
116
|
-
self.ci_gcp_credentials: Secret = ci_gcp_credentials
|
|
117
|
-
|
|
118
|
-
@property
|
|
119
|
-
def pre_release_suffix(self) -> str:
|
|
120
|
-
return self.git_revision[:10]
|
|
121
|
-
|
|
122
|
-
@property
|
|
123
|
-
def docker_image_tag(self) -> str:
|
|
124
|
-
# get the docker image tag from the parent class
|
|
125
|
-
metadata_tag = super().docker_image_tag
|
|
126
|
-
if self.pre_release:
|
|
127
|
-
return f"{metadata_tag}-dev.{self.pre_release_suffix}"
|
|
128
|
-
else:
|
|
129
|
-
return metadata_tag
|
|
130
|
-
|
|
131
|
-
@property
|
|
132
|
-
def should_send_slack_message(self) -> bool:
|
|
133
|
-
should_send = super().should_send_slack_message
|
|
134
|
-
if not should_send:
|
|
135
|
-
return False
|
|
136
|
-
if self.pre_release:
|
|
137
|
-
return False
|
|
138
|
-
return True
|
|
139
|
-
|
|
140
|
-
def get_slack_channels(self) -> List[str]:
|
|
141
|
-
if self.state in [ContextState.FAILURE, ContextState.ERROR]:
|
|
142
|
-
return [PUBLISH_UPDATES_SLACK_CHANNEL, PUBLISH_FAILURE_SLACK_CHANNEL]
|
|
143
|
-
else:
|
|
144
|
-
return [PUBLISH_UPDATES_SLACK_CHANNEL]
|
|
145
|
-
|
|
146
|
-
def create_slack_message(self) -> str:
|
|
147
|
-
docker_hub_url = f"https://hub.docker.com/r/{self.connector.metadata['dockerRepository']}/tags"
|
|
148
|
-
message = (
|
|
149
|
-
f"*{self.rollout_mode.value} <{docker_hub_url}|{self.docker_image}>*\n"
|
|
150
|
-
)
|
|
151
|
-
if self.is_ci:
|
|
152
|
-
message += f"🤖 <{self.gha_workflow_run_url}|GitHub Action workflow>\n"
|
|
153
|
-
else:
|
|
154
|
-
message += "🧑💻 Local run\n"
|
|
155
|
-
message += f"*Connector:* {self.connector.technical_name}\n"
|
|
156
|
-
message += f"*Version:* {self.connector.version}\n"
|
|
157
|
-
branch_url = f"{AIRBYTE_GITHUB_REPO_URL_PREFIX}/tree/{self.git_branch}"
|
|
158
|
-
message += f"*Branch:* <{branch_url}|{self.git_branch}>\n"
|
|
159
|
-
commit_url = f"{AIRBYTE_GITHUB_REPO_URL_PREFIX}/commit/{self.git_revision}"
|
|
160
|
-
message += f"*Commit:* <{commit_url}|{self.git_revision[:10]}>\n"
|
|
161
|
-
if self.state in [ContextState.INITIALIZED, ContextState.RUNNING]:
|
|
162
|
-
message += "🟠"
|
|
163
|
-
if self.state is ContextState.SUCCESSFUL:
|
|
164
|
-
message += "🟢"
|
|
165
|
-
if self.state in [ContextState.FAILURE, ContextState.ERROR]:
|
|
166
|
-
message += "🔴"
|
|
167
|
-
message += f" {self.state.value['description']}\n"
|
|
168
|
-
if self.state is ContextState.SUCCESSFUL:
|
|
169
|
-
assert self.report is not None, (
|
|
170
|
-
"Report should be set when state is successful"
|
|
171
|
-
)
|
|
172
|
-
message += f"⏲️ Run duration: {format_duration(self.report.run_duration)}\n"
|
|
173
|
-
if self.state is ContextState.FAILURE:
|
|
174
|
-
message += "\ncc. <!subteam^S08SQDL2RS9>"
|
|
175
|
-
return message
|