-
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
gradle: remove airbyteDocker.outputs dependencies #30314
Changes from all commits
ffeae03
54ebe61
43bf3ac
bf2c399
01e1f2b
6842402
e0b04ce
dc659e0
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 |
---|---|---|
|
@@ -9,66 +9,9 @@ | |
from typing import TYPE_CHECKING, Callable, List | ||
|
||
import requests | ||
from connector_ops.utils import ConnectorLanguage | ||
from dagger import DaggerError | ||
|
||
if TYPE_CHECKING: | ||
from dagger import Client, Container, Directory | ||
from pipelines.contexts import ConnectorContext | ||
|
||
|
||
LINES_TO_REMOVE_FROM_GRADLE_FILE = [ | ||
# Do not build normalization with Gradle - we build normalization with Dagger in the BuildOrPullNormalization step. | ||
"project(':airbyte-integrations:bases:base-normalization').airbyteDocker.output", | ||
] | ||
|
||
|
||
async def _patch_gradle_file(context: ConnectorContext, connector_dir: Directory) -> Directory: | ||
"""Patch the build.gradle file of the connector under test by removing the lines declared in LINES_TO_REMOVE_FROM_GRADLE_FILE. | ||
|
||
Underlying issue: | ||
Java connectors build.gradle declare a dependency to the normalization module. | ||
It means every time we test a java connector the normalization is built. | ||
This is time consuming and not required as normalization is now baked in containers. | ||
Normalization is going away soon so hopefully this hack will be removed soon. | ||
|
||
Args: | ||
context (ConnectorContext): The initialized connector context. | ||
connector_dir (Directory): The directory containing the build.gradle file to patch. | ||
Returns: | ||
Directory: The directory containing the patched gradle file. | ||
""" | ||
if context.connector.language is not ConnectorLanguage.JAVA: | ||
context.logger.info(f"Connector language {context.connector.language} does not require a patched build.gradle file.") | ||
return connector_dir | ||
|
||
try: | ||
gradle_file_content = await connector_dir.file("build.gradle").contents() | ||
except DaggerError: | ||
context.logger.info("Could not find build.gradle file in the connector directory. Skipping patching.") | ||
return connector_dir | ||
|
||
context.logger.warn("Patching build.gradle file to remove normalization build.") | ||
|
||
patched_gradle_file = [] | ||
|
||
for line in gradle_file_content.splitlines(): | ||
if not any(line_to_remove in line for line_to_remove in LINES_TO_REMOVE_FROM_GRADLE_FILE): | ||
patched_gradle_file.append(line) | ||
return connector_dir.with_new_file("build.gradle", contents="\n".join(patched_gradle_file)) | ||
|
||
|
||
async def patch_connector_dir(context: ConnectorContext, connector_dir: Directory) -> Directory: | ||
"""Patch a connector directory: patch cat config, gradle file and dockerfile. | ||
|
||
Args: | ||
context (ConnectorContext): The initialized connector context. | ||
connector_dir (Directory): The directory containing the connector to patch. | ||
Returns: | ||
Directory: The directory containing the patched connector. | ||
""" | ||
patched_connector_dir = await _patch_gradle_file(context, connector_dir) | ||
return patched_connector_dir.with_timestamps(1) | ||
Comment on lines
-16
to
-71
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. I love seeing hacks being removed! In order to validate that it's not breaking anything I would love to see a test bhon the following "stable" java connectors:
@edgao @evantahler do you have a destination connector still using normalization which is passing test? I can't find any. 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. Done! All green, modulo one small regression fix. |
||
from dagger import Client, Container | ||
|
||
|
||
async def cache_latest_cdk(dagger_client: Client, pip_cache_volume_name: str = "pip_cache") -> None: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ dependencies { | |
implementation project(':airbyte-config-oss:config-models-oss') | ||
implementation libs.airbyte.protocol | ||
implementation project(':airbyte-integrations:bases:base-java') | ||
implementation files(project(':airbyte-integrations:bases:base-java').airbyteDocker.outputs) | ||
Comment on lines
8
to
-9
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. Nice to see these being dropped. 👍 |
||
|
||
implementation 'org.apache.commons:commons-csv:1.4' | ||
implementation 'com.github.alexmojaki:s3-stream-upload:2.2.2' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,4 @@ dependencies { | |
|
||
integrationTestJavaImplementation project(':airbyte-integrations:bases:standard-destination-test') | ||
integrationTestJavaImplementation libs.connectors.testcontainers.postgresql | ||
|
||
implementation files(project(':airbyte-integrations:bases:base-java').airbyteDocker.outputs) | ||
integrationTestJavaImplementation files(project(':airbyte-integrations:bases:base-normalization').airbyteDocker.outputs) | ||
Comment on lines
-32
to
-34
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. I mentioned this in our 1:1, but I’m excited to see these drop because they complicated the Java CDK build process. Happy to see them retiring. |
||
} |
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.
@alafanechere do we still want this
.with_timestamps(1)
?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 so: its a trick to avoid cache bursting when a file is rewritten without modification of its content.