Skip to content
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

feat(qa_check): enable checking connector docs structure via qa check #39326

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e33561e
enable CheckDocumentationStructure qa check + extended test suite
darynaishchenko May 31, 2024
8b5993b
added keywords for creds check, valid http statuses, spec for low-code
darynaishchenko May 31, 2024
ae8e1f8
added specific heading for cloud/oss setup
darynaishchenko May 31, 2024
8d082e5
updated _replace_link func
darynaishchenko May 31, 2024
c5648db
updated headers and description templates. added unit tests.
darynaishchenko Jun 6, 2024
c6d52f8
added CheckDocumentationLinks
darynaishchenko Jun 10, 2024
ff7ae9c
refactored documentation qa checks
darynaishchenko Jun 10, 2024
2f10134
refactored changelog checking
darynaishchenko Jun 11, 2024
58f5c34
updated unit tests
darynaishchenko Jun 11, 2024
3aa5061
Merge branch 'master' into daryna/move-TestConnectorDocumentation-fro…
darynaishchenko Jun 11, 2024
e96ebea
fix tests
darynaishchenko Jun 11, 2024
ce250d7
bump version
darynaishchenko Jun 11, 2024
d39e7f6
refactor type hints
darynaishchenko Jun 11, 2024
f118b61
updated connector_spec_file_content comment
darynaishchenko Jun 21, 2024
122cb39
deleted separete doc templates
darynaishchenko Jun 21, 2024
c3bf40b
deleted documentation utils from common utils
darynaishchenko Jun 21, 2024
3bba5be
added documentation models and helpers
darynaishchenko Jun 21, 2024
3769314
refactor documentation checks
darynaishchenko Jun 21, 2024
9685475
added one standard template
darynaishchenko Jun 21, 2024
8966149
deleted old documentation file
darynaishchenko Jun 21, 2024
92844a2
added templates for checks descriptions
darynaishchenko Jun 21, 2024
0a0609d
generated qa-checks doc
darynaishchenko Jun 21, 2024
075de5c
updated init.py
darynaishchenko Jun 21, 2024
b5bc9bf
updated unit tests
darynaishchenko Jun 21, 2024
27a6f27
fix bugs in qa checks
darynaishchenko Jun 25, 2024
ca0bd36
format fix
darynaishchenko Jun 25, 2024
77b61a6
renamed templates
darynaishchenko Jul 3, 2024
bbfb429
refactor code
darynaishchenko Jul 4, 2024
8d549db
Merge branch 'master' into daryna/move-TestConnectorDocumentation-fro…
darynaishchenko Jul 4, 2024
c3372fe
updated qa-checks.md
darynaishchenko Jul 4, 2024
ec08f63
Merge branch 'master' into daryna/move-TestConnectorDocumentation-fro…
darynaishchenko Jul 8, 2024
cf571cc
Merge branch 'master' into daryna/move-TestConnectorDocumentation-fro…
darynaishchenko Aug 12, 2024
9316069
bump versions
darynaishchenko Aug 12, 2024
05e48ea
fixed docs
darynaishchenko Aug 12, 2024
00f4289
updated link to template
darynaishchenko Aug 12, 2024
4e1ee54
removed invalid link
darynaishchenko Aug 12, 2024
0fd84a4
Merge branch 'master' into daryna/move-TestConnectorDocumentation-fro…
darynaishchenko Aug 12, 2024
7a2a9d3
updated CheckDocumentationLinks to skip example urls and 406 status code
darynaishchenko Aug 12, 2024
3ea9b9a
Merge branch 'master' into daryna/move-TestConnectorDocumentation-fro…
darynaishchenko Aug 13, 2024
86bce76
Merge branch 'master' into daryna/move-TestConnectorDocumentation-fro…
darynaishchenko Aug 14, 2024
4611ef2
fixed documentation
darynaishchenko Aug 14, 2024
8bd8d65
updated links validation
darynaishchenko Aug 14, 2024
5e1d905
fixed tests
darynaishchenko Aug 14, 2024
c9c609d
Merge branch 'master' into daryna/move-TestConnectorDocumentation-fro…
darynaishchenko Aug 14, 2024
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
20 changes: 20 additions & 0 deletions airbyte-ci/connectors/connector_ops/connector_ops/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

import functools
import json
import logging
import os
import re
Expand Down Expand Up @@ -383,6 +384,25 @@ def metadata(self) -> Optional[dict]:
return None
return yaml.safe_load((self.code_directory / METADATA_FILE_NAME).read_text())["data"]

@property
def connector_spec_file_content(self) -> Optional[dict]:
"""
Returns spec file content from spec.yaml, spec.json, manifest.yaml.
This spec is not a "source of truth" for connector specification and can't be used as is.
"""
yaml_spec = Path(self.python_source_dir_path / "spec.yaml")
json_spec = Path(self.python_source_dir_path / "spec.json")

if yaml_spec.exists():
return yaml.safe_load(yaml_spec.read_text())
elif json_spec.exists():
with open(json_spec) as f:
return json.load(f)
elif self.manifest_path.exists():
return yaml.safe_load(self.manifest_path.read_text())["spec"]

return None

@property
def language(self) -> ConnectorLanguage:
if Path(self.code_directory / self.technical_name.replace("-", "_") / "manifest.yaml").is_file():
Expand Down
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/connector_ops/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 = "connector_ops"
version = "0.5.0"
version = "0.5.1"
description = "Packaged maintained by the connector operations team to perform CI for connectors"
authors = ["Airbyte <contact@airbyte.io>"]

Expand Down
4 changes: 4 additions & 0 deletions airbyte-ci/connectors/connectors_qa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ poe lint

## Changelog

### 1.5.0

Added `CheckDocumentationHeaders`, `CheckDocumentationDescriptions`, `CheckDocumentationLinks` checks that verifies that documentation file follow standard template.

### 1.4.0

Added the `IntegrationTestsEnabledCheck` check that verifies if the integration tests are enabled for connectors with higher cloud usage.
Expand Down
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/connectors_qa/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion airbyte-ci/connectors/connectors_qa/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "connectors-qa"
version = "1.4.0"
version = "1.5.0"
description = "A package to run QA checks on Airbyte connectors, generate reports and documentation."
authors = ["Airbyte <contact@airbyte.io>"]
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<details>
<summary>Expand to review</summary>
</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

1. [Log into your Airbyte Cloud](https://cloud.airbyte.com/workspaces) account.
2. Click Sources and then click + New source.
3. On the Set up the source page, select {connector_name} from the Source type dropdown.
4. Enter a name for the {connector_name} connector.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

1. Navigate to the Airbyte Open Source dashboard.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

<HideInUI>

This page contains the setup guide and reference information for the [{connector_name}]({docs_link}) source connector.

</HideInUI>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

The {connector_name} source connector supports the following [sync modes](https://docs.airbyte.com/cloud/core-concepts/#connection-sync-modes):
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

Now that you have set up the {connector_name} source connector, check out the following {connector_name} tutorials:
Loading
Loading