-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
connectors-qa: add check for 'maxSecondsBetweenMessages' presence in certified connectors metadata #36803
connectors-qa: add check for 'maxSecondsBetweenMessages' presence in certified connectors metadata #36803
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -149,8 +149,33 @@ def _run(self, connector: Connector) -> CheckResult: | |||
) | |||
|
|||
|
|||
class CheckConnectorMaxSecondsBetweenMessagesValue(MetadataCheck): | |||
name = "Certified connector must have a value filled out for maxSecondsBetweenMessages in metadata" | |||
description = f"Certified connectors must have a value filled out for maxSecondsBetweenMessages in metadata. It must be set in the 'data' field in {consts.METADATA_FILE_NAME}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add more details about the purpose of this field, why its important etc.?
class CheckConnectorMaxSecondsBetweenMessagesValue(MetadataCheck): | ||
name = "Certified connector must have a value filled out for maxSecondsBetweenMessages in metadata" | ||
description = f"Certified connectors must have a value filled out for maxSecondsBetweenMessages in metadata. It must be set in the 'data' field in {consts.METADATA_FILE_NAME}" | ||
applies_to_connector_languages = [ConnectorLanguage.PYTHON, ConnectorLanguage.LOW_CODE] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make sense to remove this line so that it runs for java connectors too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
applies_to_connector_languages = [ConnectorLanguage.PYTHON, ConnectorLanguage.LOW_CODE] | ||
|
||
@staticmethod | ||
def check_connector_certified(connector: Connector) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this check should run on all connectors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All certified should be covered, what is the purpose of having this for the community sources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to enforce best practices on new community PRs too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion. Say we run this on all community connectors — will their CI be red on all pull requests moving forward unless we add the field? We'd end up just adding the field with some dummy value, because knowing actual value requires tedious work of actually reading the API docs.
I'd say it should be a requirement to be published on Cloud, so perhaps certified is alright?
airbyte-ci/connectors/connectors_qa/src/connectors_qa/checks/metadata.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments — I like the idea, but I'll let Augustin to support this through the review.
Either way, please add the changelog + version.
airbyte-ci/connectors/connectors_qa/src/connectors_qa/checks/metadata.py
Outdated
Show resolved
Hide resolved
applies_to_connector_languages = [ConnectorLanguage.PYTHON, ConnectorLanguage.LOW_CODE] | ||
|
||
@staticmethod | ||
def check_connector_certified(connector: Connector) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion. Say we run this on all community connectors — will their CI be red on all pull requests moving forward unless we add the field? We'd end up just adding the field with some dummy value, because knowing actual value requires tedious work of actually reading the API docs.
I'd say it should be a requirement to be published on Cloud, so perhaps certified is alright?
@staticmethod | ||
def check_connector_certified(connector: Connector) -> bool: | ||
connector_sl_value = connector.metadata.get("ab_internal", {}).get("sl", 0) | ||
return connector_sl_value >= 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if certified is the same as connector_sl_value being higher than 200.
I see what you did here — but do you really want that criteria vs perhaps this check should only run on connectors that are published to cloud registry instead? @alafanechere has a method to check for whether connector is in registry in a neighboring PR somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…sBetweenMessages_value
@staticmethod | ||
def check_connector_certified(connector: Connector) -> bool: | ||
connector_sl_value = connector.metadata.get("ab_internal", {}).get("sl", 0) | ||
return connector_sl_value >= 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use the supportLevel
instead of the sl_value
return connector_sl_value >= 200 | |
return connector.metadata.get("supportLevel") == "certified" |
I think sl_value
is not accurate as archived connector still have the sl_value
set to 200
applies_to_connector_types = ["source"] | ||
|
||
@staticmethod | ||
def check_connector_certified(connector: Connector) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method should move up to the Check
abstract class and you should add a runs_on_certified_connectors
property and change Check.run
method to skip there if the connector is not certified. (same logic as if connector.language not in self.applies_to_connector_languages:
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes!
Just a minor comment for maintainability.
@@ -21,6 +21,8 @@ | |||
|
|||
ALL_TYPES = ["source", "destination"] | |||
|
|||
ALL_SUPPORT_LEVELS = ["certified", "community"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if we add a new support level we would have to update this list.
We could make applies_to_connector_support_levels
return None
by default which would me "applies to all support levels"
…_maxSecondsBetweenMessages_value' into Danylo_GL/QA_check_metadata_file_maxSecondsBetweenMessages_value
…sBetweenMessages_value
…_maxSecondsBetweenMessages_value' into Danylo_GL/QA_check_metadata_file_maxSecondsBetweenMessages_value
…sBetweenMessages_value
…certified connectors metadata (airbytehq#36803) Co-authored-by: Natik Gadzhi <natik@respawn.io>
All certified source connectors must have maximum request rate limit reset time set in their metadata.yaml files.
What
Added QA check for presence of 'maxSecondsBetweenMessages' value in 'metadata.yaml' files for all certified source python and low-code connectors.
How
🚨 User Impact 🚨
No breaking changes