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

airbyte-ci: Add upgrade cdk command #33313

Merged
merged 26 commits into from
Dec 19, 2023
Merged

Conversation

flash1293
Copy link
Contributor

@flash1293 flash1293 commented Dec 11, 2023

This PR adds a new command to airbyte-ci that allows updating the CDK version in connectors. It's mostly meant to be called in an automated fashion from Github Action workflows to auto-upgrade connectors after an upgrade.

Prod version of #32721

Copy link

vercel bot commented Dec 11, 2023

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 Dec 19, 2023 11:18am

new_version: str,
):
super().__init__(context)
self.repo_dir = repo_dir
Copy link
Contributor

Choose a reason for hiding this comment

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

repo_dir is already an attribute of context

set_cdk_version_result = await set_cdk_version.run()
steps_results.append(set_cdk_version_result)
final_repo_dir = set_cdk_version_result.output_artifact
await og_repo_dir.diff(final_repo_dir).export(str(git.get_git_repo_path()))
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we move the export logic back to the SetCDKVersion so that a failed export fails the step (and the report)?

Comment on lines 90 to 91
final_repo_dir = set_cdk_version_result.output_artifact
await og_repo_dir.diff(final_repo_dir).export(str(git.get_git_repo_path()))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should export the connector directory and not the full repo directory. This will improve performances.

Comment on lines 22 to 23
def connector_with_poetry():
return Connector("destination-duckdb")
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be more stable to not rely on a single connector. I suggest to iterate on the all_connectors fixture and return a connector which has a pyproject.toml file and skip otherwise.

Suggested change
def connector_with_poetry():
return Connector("destination-duckdb")
def connector_with_poetry(all_connectors):
for connector in all_connectors:
if (connector.code_directory / "pyproject.toml").exists():
return connector
pytest.skip("No connector using poetry found")

@flash1293
Copy link
Contributor Author

Thanks for your comments @alafanechere - I adjusted the code and wrote some tests, could you take another look?

@flash1293 flash1293 marked this pull request as ready for review December 15, 2023 10:41
@flash1293 flash1293 requested a review from a team December 15, 2023 10:41
Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

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

I've a couple of additional minor suggestions, nothing blocking.
Could you please bump the airbyte-ci version in README.md and pyproject.toml 🙏

Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

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

Nothing blocking and minor remaining suggestions 👍 👏 👏 👏
Please increment the version by a minor bump before merging

async def _run(self) -> StepResult:
context: ConnectorContext = self.context
og_connector_dir = await context.get_connector_dir()
if not "setup.py" in await og_connector_dir.entries():
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we return self.skip(reason="Connector is not a Python connector") when the connector is a Java connector?

@flash1293 flash1293 enabled auto-merge (squash) December 19, 2023 11:19
@flash1293 flash1293 merged commit 37d0b91 into master Dec 19, 2023
21 checks passed
@flash1293 flash1293 deleted the flash1293/upgrade-cdk-command branch December 19, 2023 11:30
timroes pushed a commit that referenced this pull request Dec 19, 2023
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
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