-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: refactor GradleTask to run in subprocess #52033
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Install Java Environment | ||
description: "Installs the Java environment" | ||
inputs: | ||
java_version: | ||
description: "Java version" | ||
required: false | ||
default: "21" | ||
type: string | ||
gradle_cache_read_only: | ||
description: "Whether to use a read-only Gradle cache" | ||
required: false | ||
default: false | ||
type: boolean | ||
gradle_cache_write_only: | ||
description: "Whether to use a write-only Gradle cache" | ||
required: false | ||
default: false | ||
type: boolean | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: corretto | ||
java-version: ${{ inputs.java_version }} | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: ${{ inputs.gradle_cache_read_only }} | ||
cache-write-only: ${{ inputs.gradle_cache_write_only }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,8 @@ async def run_connector_build(context: ConnectorContext) -> StepResult: | |
build_connector_tar_result = await BuildConnectorDistributionTar(context).run() | ||
if build_connector_tar_result.status is not StepStatus.SUCCESS: | ||
return build_connector_tar_result | ||
dist_dir = await build_connector_tar_result.output.directory(dist_tar_directory_path(context)) | ||
|
||
dist_dir = await build_connector_tar_result.output.directory("build/distributions") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for understanding: why are we using "build/distributions" directly? feels unrelated to the other changes, maybe I'm missing something. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It changes because the original path related to an "absolute path airbyte repo path". the |
||
return await BuildConnectorImages(context).run(dist_dir) | ||
|
||
|
||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,24 +61,3 @@ def context_with_setup(dagger_client, python_connector_with_setup_not_latest_cdk | |
@pytest.fixture(scope="module") | ||
def python_connector_base_image_address(python_connector_with_setup_not_latest_cdk): | ||
return python_connector_with_setup_not_latest_cdk.metadata["connectorBuildOptions"]["baseImage"] | ||
|
||
|
||
async def test_with_python_connector_installed_from_setup(context_with_setup, python_connector_base_image_address, latest_cdk_version): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test was failing - removing it as installing from setup.py is now legacy |
||
python_container = context_with_setup.dagger_client.container().from_(python_connector_base_image_address) | ||
user = await BuildConnectorImages.get_image_user(python_container) | ||
container = await common.with_python_connector_installed( | ||
context_with_setup, python_container, str(context_with_setup.connector.code_directory), user | ||
) | ||
# Uninstall and reinstall the latest cdk version | ||
cdk_install_latest_output = ( | ||
await container.with_env_variable("CACHEBUSTER", datetime.datetime.now().isoformat()) | ||
.with_user("root") | ||
.with_exec(["pip", "uninstall", "-y", f"airbyte-cdk=={latest_cdk_version}"]) | ||
.with_exec(["pip", "install", f"airbyte-cdk=={latest_cdk_version}"]) | ||
.stdout() | ||
) | ||
# Assert that the latest cdk version is installed from cache | ||
assert f"Using cached airbyte_cdk-{latest_cdk_version}-py3-none-any.whl" in cdk_install_latest_output | ||
# Assert that the connector is installed | ||
pip_freeze_output = await container.with_exec(["pip", "freeze"]).stdout() | ||
assert context_with_setup.connector.technical_name in pip_freeze_output |
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.
For a followup: that would be cool to spare python connector only PR from installing the java env. We could rely on the
changes
output to check if any java connector was modified