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

connectors-qa: introduce run_on_released_connectors flag #36818

Conversation

alafanechere
Copy link
Contributor

@alafanechere alafanechere commented Apr 4, 2024

We have some check that are not meant to run on nightly builds, for released connectors.
This PR introduce a flag that can be set at the Check level to determine if the check should run on a released connector or be skipped.
The released state of the connector is determined by the presence of the current version in metadata in the OSS registry.

Copy link

vercel bot commented Apr 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Apr 8, 2024 3:01pm

Copy link
Contributor Author

alafanechere commented Apr 4, 2024

@alafanechere alafanechere marked this pull request as ready for review April 4, 2024 08:14
@alafanechere alafanechere requested a review from a team April 4, 2024 08:14
@alafanechere alafanechere force-pushed the augustin/04-04-connectors-qa_Introduce_the_Check.run_on_released_connectors_flag branch from 1eb23c5 to 8deb9a3 Compare April 4, 2024 08:17
@alafanechere alafanechere requested a review from natikgadzhi April 4, 2024 08:19
Copy link
Contributor

@natikgadzhi natikgadzhi left a comment

Choose a reason for hiding this comment

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

LGTM with a question on OSS vs Cloud registry as release guard.

@@ -555,6 +556,20 @@ def normalization_tag(self) -> Optional[str]:
def is_using_poetry(self) -> bool:
return Path(self.code_directory / "pyproject.toml").exists()

@property
def is_released(self) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: can you add a comment line here? Pretty obvious, sure, but why use OSS catalog for example?

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we for example insist on running https checks when we're pushing a connector from being available on OSS only to being available in cloud? Should those be two separate release levels?

Copy link
Contributor Author

@alafanechere alafanechere Apr 8, 2024

Choose a reason for hiding this comment

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

but why use OSS catalog for example?

The cloud registry is a subset of the oss registry. Some connector are not on cloud but I still want to know if they are released.

registry = download_catalog(OSS_CATALOG_URL)
for connector in registry[f"{self.connector_type}s"]:
if (
connector[f"{self.connector_type}DefinitionId"] == metadata["definitionId"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait a second, does each version of a connector have a different definition ID? Because we want to run all checks on each new version in case new version screws things up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitions IDs are static and are connector's primary key. The logic here is:
If the definition ID and the dockerImage version are found in the registry it means the connector was published.

@property
def is_released(self) -> bool:
metadata = self.metadata
in_registry = False
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
in_registry = False

connector[f"{self.connector_type}DefinitionId"] == metadata["definitionId"]
and connector["dockerImageTag"] == metadata["dockerImageTag"]
):
in_registry = True
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
in_registry = True
return True

and connector["dockerImageTag"] == metadata["dockerImageTag"]
):
in_registry = True
break
Copy link
Contributor

@natikgadzhi natikgadzhi Apr 4, 2024

Choose a reason for hiding this comment

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

Suggested change
break
return False

):
in_registry = True
break
return in_registry
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return in_registry

@alafanechere alafanechere force-pushed the augustin/04-04-connectors-qa_Introduce_the_Check.run_on_released_connectors_flag branch from 8deb9a3 to 4da8624 Compare April 8, 2024 15:01
@alafanechere alafanechere merged commit b2e7f37 into master Apr 8, 2024
30 checks passed
@alafanechere alafanechere deleted the augustin/04-04-connectors-qa_Introduce_the_Check.run_on_released_connectors_flag branch April 8, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants