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

Fix for acceptance test on discover workflow #22595

Merged
merged 10 commits into from
Feb 9, 2023
Merged

Conversation

xiaohansong
Copy link
Contributor

What

Describe what the change is solving
It helps to add screenshots if it affects the frontend.

How

Describe the solution

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

Affected Connector Report

NOTE ⚠️ Changes in this PR affect the following connectors. Make sure to do the following as needed:

  • Run integration tests
  • Bump connector or module version
  • Add changelog
  • Publish the new version

✅ Sources (30)

Connector Version Changelog Publish
source-alloydb 1.0.43
source-alloydb-strict-encrypt 1.0.43 🔵
(ignored)
🔵
(ignored)
source-bigquery 0.2.3
source-clickhouse 0.1.15
source-clickhouse-strict-encrypt 0.1.15 🔵
(ignored)
🔵
(ignored)
source-cockroachdb 0.1.19
source-cockroachdb-strict-encrypt 0.1.19 🔵
(ignored)
🔵
(ignored)
source-db2 0.1.17
source-db2-strict-encrypt 0.1.17 🔵
(ignored)
🔵
(ignored)
source-dynamodb 0.1.0
source-e2e-test 2.1.3
source-e2e-test-cloud 2.1.1 🔵
(ignored)
🔵
(ignored)
source-elasticsearch 0.1.1
source-jdbc 0.3.5 🔵
(ignored)
🔵
(ignored)
source-kafka 0.2.3
source-mongodb-strict-encrypt 0.1.19 🔵
(ignored)
🔵
(ignored)
source-mongodb-v2 0.1.19
source-mssql 0.4.28
source-mssql-strict-encrypt 0.4.28 🔵
(ignored)
🔵
(ignored)
source-mysql 1.0.21
source-mysql-strict-encrypt 1.0.21 🔵
(ignored)
🔵
(ignored)
source-oracle 0.3.22
source-oracle-strict-encrypt 0.3.22 🔵
(ignored)
🔵
(ignored)
source-postgres 1.0.43
source-postgres-strict-encrypt 1.0.43 🔵
(ignored)
🔵
(ignored)
source-redshift 0.3.16
source-scaffold-java-jdbc 0.1.0 🔵
(ignored)
🔵
(ignored)
source-sftp 0.1.2
source-snowflake 0.1.29
source-tidb 0.2.2
  • See "Actionable Items" below for how to resolve warnings and errors.

✅ Destinations (0)

Connector Version Changelog Publish
  • See "Actionable Items" below for how to resolve warnings and errors.

✅ Other Modules (0)

Actionable Items

(click to expand)

Category Status Actionable Item
Version
mismatch
The version of the connector is different from its normal variant. Please bump the version of the connector.

doc not found
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug.
Changelog
doc not found
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug.

changelog missing
There is no chnagelog for the current version of the connector. If you are the author of the current version, please add a changelog.
Publish
not in seed
The connector is not in the seed file (e.g. source_definitions.yaml), so its publication status cannot be checked. This can be normal (e.g. some connectors are cloud-specific, and only listed in the cloud seed file). Please double-check to make sure that it is not a bug.

diff seed version
The connector exists in the seed file, but the latest version is not listed there. This usually means that the latest version is not published. Please use the /publish command to publish the latest version.

Copy link
Contributor

@sergio-ropero sergio-ropero left a comment

Choose a reason for hiding this comment

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

I think this is not required anymore then:

  // This has to be using the protocol version of the platform in order to capture the arg
  private final ArgumentCaptor<io.airbyte.protocol.models.AirbyteCatalog> lastPersistedCatalog =
      ArgumentCaptor.forClass(io.airbyte.protocol.models.AirbyteCatalog.class);

You can just remove it 😄

@xiaohansong xiaohansong requested a review from a team as a code owner February 8, 2023 19:51
@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Feb 8, 2023
@xiaohansong xiaohansong requested a review from a team as a code owner February 8, 2023 22:06
@xiaohansong
Copy link
Contributor Author

xiaohansong commented Feb 8, 2023

/test connector=connectors/source-postgres

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

Build Failed

Test summary info:

Could not find result summary

@xiaohansong
Copy link
Contributor Author

xiaohansong commented Feb 8, 2023

/test connector=connectors/source-postgres

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

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_incremental.py::TestIncremental::test_two_sequential_reads[inputs1]
FAILED test_incremental.py::TestIncremental::test_read_sequential_slices[inputs1]
SKIPPED [2] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:98: The previous and actual specifications are identical.
SKIPPED [2] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:507: The previous and actual discovered catalogs are identical.
SKIPPED [2] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_incremental.py:22: `future_state` has a bypass reason, skipping.
============= 2 failed, 64 passed, 6 skipped in 102.71s (0:01:42) ==============

@xiaohansong xiaohansong temporarily deployed to more-secrets February 8, 2023 22:21 — with GitHub Actions Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets February 8, 2023 22:21 — with GitHub Actions Inactive
Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

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

@xiaohansong could you remove the files in airbyte-cdk? this is a problem we're aware of and are fixing but we shouldn't be adding these files to VCS

@xiaohansong
Copy link
Contributor Author

@sherifnada will do - will clean it up before merging

@octavia-squidington-iii octavia-squidington-iii removed the CDK Connector Development Kit label Feb 8, 2023
@xiaohansong xiaohansong temporarily deployed to more-secrets February 8, 2023 23:21 — with GitHub Actions Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets February 8, 2023 23:21 — with GitHub Actions Inactive
@sherifnada
Copy link
Contributor

@xiaohansong i'm gitignoring those files here #22616

Copy link
Contributor

@pmossman pmossman left a comment

Choose a reason for hiding this comment

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

Left some more thoughts about catalog converter tech debt - I don't want to block the PR but I want to make it clear that this is definitely adding to some pre-existing tech debt and I want to make sure we're doing everything we can to contain the blast radius of tech debt wherever we can!

@@ -125,11 +126,9 @@ public abstract class AbstractSourceConnectorTest {
private ConnectorConfigUpdater mConnectorConfigUpdater;

// This has to be using the protocol version of the platform in order to capture the arg
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this comment makes sense to keep anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that meant to be AirbyteCatalog as it has to be using protocol version, but yeah definitely not used to capture the arg

* @param catalog
* @return
*/
public static io.airbyte.protocol.models.AirbyteCatalog toAirbyteProtocol(
Copy link
Contributor

Choose a reason for hiding this comment

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

It definitely makes me feel uneasy to duplicate such complicated and hard-to-maintain code. It seems like it will be very likely that this code will need to change in both places, but it will only end up being changed in a single place because it isn't obvious that there are multiple implementations of nearly the exact same thing.

I don't really have a good answer for this right now, since the conversion logic isn't actually duplicated (in one case, they are server-side java models, and here they are client-side java models, so they're technically different types).

I think it would be ideal to add very apparent comments to this class AND to the other CatalogConverter class that the logic is duplicated for now, and we should discuss and try to prioritize an issue for coming up with a better approach for these super-complicated catalog conversion methods.

I don't want to block this PR, but I want to make sure we're doing everything we can to minimize the tech debt here and come up with a solid long term solution!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree - conversion between those three types with added logic for stream makes it really hard to maintain.

@xiaohansong xiaohansong temporarily deployed to more-secrets February 9, 2023 00:05 — with GitHub Actions Inactive
@xiaohansong xiaohansong temporarily deployed to more-secrets February 9, 2023 00:05 — with GitHub Actions Inactive
@sergio-ropero sergio-ropero temporarily deployed to more-secrets February 9, 2023 00:15 — with GitHub Actions Inactive
@sergio-ropero sergio-ropero temporarily deployed to more-secrets February 9, 2023 00:15 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Airbyte Code Coverage

File Coverage [47.3%]
CatalogClientConverters.java 47.3%
Total Project Coverage 24.66%

@sergio-ropero
Copy link
Contributor

sergio-ropero commented Feb 9, 2023

/test connector=connectors/source-postgres

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

Build Failed

Test summary info:

Could not find result summary

@xiaohansong xiaohansong enabled auto-merge (squash) February 9, 2023 00:40
@xiaohansong xiaohansong merged commit 0ba609c into master Feb 9, 2023
@xiaohansong xiaohansong deleted the xiaohan/testfix branch February 9, 2023 00:52
danidelvalle pushed a commit to danidelvalle/airbyte that referenced this pull request Feb 9, 2023
* fix test

* remove unused var

* add converter into test

* use converters to convert client catalog to proto

* remove cdk related changes

* more cdk remove

* Minor format changes

* remove untrue comment

* Minor format changes

---------

Co-authored-by: Sergio Ropero <42538006+sergio-ropero@users.noreply.github.com>
Co-authored-by: Sergio Ropero <sergio@airbyte.io>
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.

5 participants