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

Java connectors use protocol v0 objects #20404

Merged
merged 13 commits into from
Dec 15, 2022

Conversation

gosusnp
Copy link
Contributor

@gosusnp gosusnp commented Dec 12, 2022

What

Migrate the Java connectors to use the protocol objects in the v0 namespace (io.airbyte.protocol.models.v0).

Closes #20037

How

  • Duplicate some helper objects into io.airbyte.protocol.models.v0
  • Update imports for the Java connectors
  • Add object conversions in some shared test objects of the Java connectors to keep the build happy

The object conversions is a short term mitigation for the build, a better solution should be implemented when we start migrating some connectors to the v1 of the protocol.

Recommended reading order

  1. airbyte-protocol/protocol-models/src/main/java/io/airbyte/protocol/models/v0 contain the helper objects that have been duplicated to be version specific
  2. airbyte-integrations/bases/standard-source-test/src/main/java/io/airbyte/integrations/standardtest/source/AbstractSourceConnectorTest.java, airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/DestinationAcceptanceTest.java and airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/LocalAirbyteDestination.java contain the tests that have been updated with the object conversion
  3. the rest should be namespacing updates to reference v0 objects rather than version-less objects.

🚨 User Impact 🚨

There should be no behavior change, the v0 and v1 of the protocol are structurally identical, what differs is the interpretation of some fields.

@gosusnp gosusnp temporarily deployed to more-secrets December 14, 2022 19:06 — with GitHub Actions Inactive
@gosusnp gosusnp temporarily deployed to more-secrets December 14, 2022 19:07 — with GitHub Actions Inactive
@gosusnp gosusnp temporarily deployed to more-secrets December 14, 2022 21:11 — with GitHub Actions Inactive
@gosusnp gosusnp temporarily deployed to more-secrets December 14, 2022 21:11 — with GitHub Actions Inactive
@gosusnp
Copy link
Contributor Author

gosusnp commented Dec 14, 2022

/test connector=connectors/source-postgres

🕑 connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/3698829907
❌ connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/3698829907
🐛 https://gradle.com/s/phecw4g25erfw

Build Failed

Test summary info:

Could not find result summary

@gosusnp
Copy link
Contributor Author

gosusnp commented Dec 14, 2022

/test connector=connectors/source-postgres

🕑 connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/3699213012
❌ connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/3699213012
🐛 https://gradle.com/s/uk25ye6rfxhgy

Build Failed

Test summary info:

Could not find result summary

@gosusnp gosusnp temporarily deployed to more-secrets December 14, 2022 22:22 — with GitHub Actions Inactive
@gosusnp gosusnp temporarily deployed to more-secrets December 14, 2022 22:22 — with GitHub Actions Inactive
@gosusnp
Copy link
Contributor Author

gosusnp commented Dec 14, 2022

@edgao, @akashkulk, while looking into the connector failure, found extra references to the v-null objects.
Most of the fixes should be purely namespace changes, one to be aware of is AbstractDbSource.java where I added a conversion for the state messages. I think it is the first conversion that is happening in the main code path (as opposed to tests only for the others)

@gosusnp
Copy link
Contributor Author

gosusnp commented Dec 14, 2022

/test connector=connectors/destination-snowflake

🕑 connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/3699257990
✅ connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/3699257990
Python tests coverage:

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 14      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    14      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     166      8    95%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         189     48    75%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         61     38    38%
normalization/transform_catalog/stream_processor.py                 595    400    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1441    629    56%

Build Passed

Test summary info:

All Passed

Copy link
Contributor

@edgao edgao left a comment

Choose a reason for hiding this comment

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

thanks for the heads up - not expecting anything to break here 🤞hopefully the tests pass

@sherifnada
Copy link
Contributor

@gosusnp review is requested from the extensibility team but this doesn't seem to touch any extensibility code. Was that review request intentional?

@sherifnada sherifnada removed the request for review from a team December 15, 2022 00:36
@akashkulk
Copy link
Contributor

akashkulk commented Dec 15, 2022

/test connector=connectors/source-postgres

🕑 connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/3699971481
✅ connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/3699971481
Python tests coverage:

	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          12      4    67%   16-19
	 source_acceptance_test/config.py                       140      5    96%   87, 93, 238, 242-243
	 source_acceptance_test/conftest.py                     208     92    56%   36, 42-44, 49, 54, 77, 83, 89-91, 110, 115-117, 123-125, 131-132, 137-138, 143, 149, 158-167, 173-178, 193, 217, 248, 254, 262-267, 275-280, 288-301, 306-312, 319-330, 337-353
	 source_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 source_acceptance_test/tests/test_core.py              402    115    71%   53, 58, 93-104, 109-116, 120-121, 125-126, 308, 346-363, 376-387, 391-396, 402, 435-440, 478-485, 528-530, 533, 598-606, 618-621, 626, 682-683, 689, 692, 728-738, 751-776
	 source_acceptance_test/tests/test_incremental.py       158     14    91%   52-59, 64-77, 240
	 source_acceptance_test/utils/asserts.py                 39      2    95%   62-63
	 source_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/connector_runner.py       133     33    75%   24-27, 46-47, 50-54, 57-58, 73-75, 78-80, 83-85, 88-90, 93-95, 124-125, 159-161, 208
	 source_acceptance_test/utils/json_schema_helper.py     107     13    88%   30-31, 38, 41, 65-68, 96, 120, 192-194
	 ----------------------------------------------------------------------------------
	 TOTAL                                                 1603    336    79%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestConnection.test_check: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestDiscovery.test_discover: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestBasicRead.test_read: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestFullRefresh.test_sequential_reads: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
================= 14 passed, 5 skipped, 21 warnings in 32.00s ==================

@akashkulk
Copy link
Contributor

Looks good - I assume that was why the Postgres test was failing? Just kicked off another run there

@gosusnp gosusnp temporarily deployed to more-secrets December 15, 2022 00:42 — with GitHub Actions Inactive
@gosusnp gosusnp temporarily deployed to more-secrets December 15, 2022 00:43 — with GitHub Actions Inactive
@gosusnp
Copy link
Contributor Author

gosusnp commented Dec 15, 2022

@sherifnada, that was not intentional, I suspect some change detection script (Check if a review is required from Connector teams maybe?) automatically tagged extensibility

@gosusnp
Copy link
Contributor Author

gosusnp commented Dec 15, 2022

/test connector=connectors/source-postgres

🕑 connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/3699999270
✅ connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/3699999270
Python tests coverage:

	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          12      4    67%   16-19
	 source_acceptance_test/config.py                       140      5    96%   87, 93, 238, 242-243
	 source_acceptance_test/conftest.py                     208     92    56%   36, 42-44, 49, 54, 77, 83, 89-91, 110, 115-117, 123-125, 131-132, 137-138, 143, 149, 158-167, 173-178, 193, 217, 248, 254, 262-267, 275-280, 288-301, 306-312, 319-330, 337-353
	 source_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 source_acceptance_test/tests/test_core.py              402    115    71%   53, 58, 93-104, 109-116, 120-121, 125-126, 308, 346-363, 376-387, 391-396, 402, 435-440, 478-485, 528-530, 533, 598-606, 618-621, 626, 682-683, 689, 692, 728-738, 751-776
	 source_acceptance_test/tests/test_incremental.py       158     14    91%   52-59, 64-77, 240
	 source_acceptance_test/utils/asserts.py                 39      2    95%   62-63
	 source_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/connector_runner.py       133     33    75%   24-27, 46-47, 50-54, 57-58, 73-75, 78-80, 83-85, 88-90, 93-95, 124-125, 159-161, 208
	 source_acceptance_test/utils/json_schema_helper.py     107     13    88%   30-31, 38, 41, 65-68, 96, 120, 192-194
	 ----------------------------------------------------------------------------------
	 TOTAL                                                 1603    336    79%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestConnection.test_check: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestDiscovery.test_discover: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestBasicRead.test_read: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestFullRefresh.test_sequential_reads: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
================= 14 passed, 5 skipped, 21 warnings in 29.71s ==================

@gosusnp
Copy link
Contributor Author

gosusnp commented Dec 15, 2022

@akashkulk, I think b16f07d should fix the issues in the source-postgres. Just kicked off another run to confirm this.

@gosusnp gosusnp temporarily deployed to more-secrets December 15, 2022 19:24 — with GitHub Actions Inactive
@gosusnp gosusnp temporarily deployed to more-secrets December 15, 2022 19:24 — with GitHub Actions Inactive
@gosusnp gosusnp merged commit 094aff1 into master Dec 15, 2022
@gosusnp gosusnp deleted the gosusnp/20037-java-connectors-on-protocol-v0 branch December 15, 2022 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/platform issues related to the platform area/protocol connectors/destination/aws-datalake connectors/destination/azure-blob-storage connectors/destination/bigquery connectors/destination/bigquery-denormalized connectors/destination/cassandra connectors/destination/clickhouse connectors/destination/clickhouse-strict-encrypt connectors/destination/csv connectors/destination/databricks connectors/destination/dev-null connectors/destination/doris connectors/destination/dynamodb connectors/destination/e2e-test connectors/destination/elasticsearch connectors/destination/elasticsearch-strict-encryp connectors/destination/gcs connectors/destination/iceberg connectors/destination/jdbc connectors/destination/kafka connectors/destination/keen connectors/destination/kinesis connectors/destination/local-json connectors/destination/mariadb-columnstore connectors/destination/mongodb connectors/destination/mongodb-strict-encrypt connectors/destination/mqtt connectors/destination/mssql connectors/destination/mssql-strict-encrypt connectors/destination/mysql connectors/destination/mysql-strict-encrypt connectors/destination/oracle connectors/destination/oracle-strict-encrypt connectors/destination/postgres connectors/destination/postgres-strict-encrypt connectors/destination/pubsub connectors/destination/pulsar connectors/destination/redis connectors/destination/redpanda connectors/destination/redshift connectors/destination/rockset connectors/destination/s3-glue connectors/destination/s3 connectors/destination/scylla connectors/destination/snowflake connectors/destination/tidb connectors/destination/yugabytedb connectors/source/bigquery connectors/source/clickhouse connectors/source/clickhouse-strict-encrypt connectors/source/cockroachdb connectors/source/cockroachdb-strict-encrypt connectors/source/db2-strict-encrypt connectors/source/db2 connectors/source/dynamodb connectors/source/e2e-test connectors/source/e2e-test-cloud connectors/source/elasticsearch connectors/source/jdbc connectors/source/kafka connectors/source/mongodb-strict-encrypt connectors/source/mongodb-v2 connectors/source/mssql connectors/source/mssql-strict-encrypt connectors/source/mysql connectors/source/mysql-strict-encrypt connectors/source/oracle connectors/source/oracle-strict-encrypt connectors/source/postgres connectors/source/postgres-strict-encrypt connectors/source/redshift connectors/source/relational-db connectors/source/scaffold-java-jdbc connectors/source/sftp connectors/source/snowflake connectors/source/tidb
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have Java Connectors depend on v0 of the protocol.
6 participants