Skip to content

connectors-insights: fix generation for non manifest connector #43430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions airbyte-ci/connectors/connectors_insights/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ This CLI is currently running nightly in GitHub Actions. The workflow can be fou

## Changelog

### 0.3.1
Skip manifest inferred insights when the connector does not have a `manifest.yaml` file.

### 0.3.0
Adding `manifest_uses_parameters`, `manifest_uses_custom_components`, and `manifest_custom_components_classes` insights.

Expand Down
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/connectors_insights/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "connectors-insights"
version = "0.3.0"
version = "0.3.1"
description = ""
authors = ["Airbyte <[email protected]>"]
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@


def get_manifest_inferred_insights(connector: Connector) -> dict:
if connector.manifest_path is None or not connector.manifest_path.exists():
return {}

manifest = connector.manifest_path.read_text()

schemas_directory = connector.code_path / connector.technical_name.replace("-", "_") / "schemas"
schemas_directory = connector.code_directory / connector.technical_name.replace("-", "_") / "schemas"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait up, did I mess it up and it never worked? How did I manage that without failing a test? Or does code_path exist, but does a different thing? What's the difference between them?


return {
"manifest_uses_parameters": manifest.find("$parameters") != -1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class ConnectorInsights(BaseModel):
deprecated_classes_in_use: list[str] | None
deprecated_modules_in_use: list[str] | None
forbidden_method_names_in_use: list[str] | None
manifest_uses_parameters: StrictBool
manifest_uses_custom_components: StrictBool
manifest_uses_parameters: StrictBool | None
manifest_uses_custom_components: StrictBool | None
manifest_custom_component_classes: list[str] | None
has_json_schemas: StrictBool
has_json_schemas: StrictBool | None

class Config:
json_encoders = {dict: lambda v: json.dumps(v, default=pydantic_encoder)}
Loading