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: format improvements #32999

Merged
merged 16 commits into from
Dec 1, 2023

Conversation

postamar
Copy link
Contributor

This PR removes the dependency on gradle for airbyte-ci's format command. This PR also improves the performance of the python formatting.

@postamar postamar requested a review from a team November 30, 2023 21:03
Copy link

vercel bot commented Nov 30, 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 1, 2023 4:43pm

return await format_container.directory("/src").export(".")


def mount_repo_for_formatting(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was not called anywhere.

"pip install pipx",
"pipx ensurepath",
"pipx install poetry",
"poetry install --no-root",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should speed up the python formatting by caching the poetry install which depends on a poetry.lock file which changes very little over time.

Copy link
Contributor

@erohmensing erohmensing left a comment

Choose a reason for hiding this comment

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

Only major concern is around the mounting

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.

Requesting change as I think:

return await format_container.directory("/airbyte/repo").export(".")

is a typo, it should export /src. I'll try to push a fix

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.

This is great!
Using maven instead of gradle allows us to not suffer from the overhead of starting and configuring gradle + messing up with its cache.

I pushed the small fix in term of consistency of repo mount path.

I checked the check all performances after modifying a python and a java file:
Runs in 30 seconds 👍.

(The first time you run airbyte-ci format check all is definitely longer as we're pulling images from remote registries and install deps: I confirm all this is cached in subsequent runs.)

@postamar
Copy link
Contributor Author

postamar commented Dec 1, 2023

Alright, this should be good to go.

@postamar
Copy link
Contributor Author

postamar commented Dec 1, 2023

Notice that the autoformat is failing, but that's expected, as I removed the spotless plugin from the build.gradle and the autoformat is running with the published binary which doesn't yet have the changes in this PR.

Copy link
Contributor

@erohmensing erohmensing left a comment

Choose a reason for hiding this comment

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

Looks great!

Co-authored-by: Ella Rohm-Ensing <erohmensing@gmail.com>
@postamar
Copy link
Contributor Author

postamar commented Dec 1, 2023

Thanks for the reviews! I'll merge shortly.

postamar added a commit that referenced this pull request Dec 1, 2023
@postamar
Copy link
Contributor Author

postamar commented Dec 1, 2023

I've reverted 22e1bbd and will put it in a separate follow-up PR to not force-merge this one.

@postamar postamar merged commit 300ce85 into master Dec 1, 2023
22 checks passed
@postamar postamar deleted the postamar/use-maven-in-airbyte-ci-format branch December 1, 2023 16:53
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.

3 participants