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

Ella/fail on extra fields #23985

Merged
merged 20 commits into from
Mar 23, 2023
Merged

Ella/fail on extra fields #23985

merged 20 commits into from
Mar 23, 2023

Conversation

erohmensing
Copy link
Contributor

@erohmensing erohmensing commented Mar 13, 2023

TODO

  • Create follow up issues for community program to add extra fields to spec and turn off the override flag

What

How

During the basic read test, during schema validation, artificially inject/overwrite additionalProperties on the top level of the schema to be set to false. Records that come in with extra properties will then fail the test. Don't do this if fail_on_extra_columns is set to True.

In order to avoid this breaking CAT runs for all of our GA/beta connectors and making it hard for teams to deploy updates to those connectors, I ran this test locally on all connectors. Beta and GA connectors that failed specifically due to the new Additional properties are not allowed validation were updated so that fail_on_extra_columns: True is set on their basic read tests.

Recommended reading order

  1. connector-acceptance-tests/test_core.py: introduction of new test logic
  2. connector-acceptance-tests/unit_tests/test_core.py: unit tests for new logic
  3. acceptance-test-config.yml files: connectors which have been updated to bypass this logic for now until their specs are updated

🚨 User Impact 🚨

No end user impact. Connector developers might find that a connector starts failing CAT because of this test. If so, they can add a bypass or fix the behavior (we attempted to add as many bypasses as possible for faiiling connectors to avoid this sudden failing).

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 Mar 13, 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 (1)

Connector Version Changelog Publish
source-railz 0.1.1
  • 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

@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.

LGTM but please consider my comment about nested properties.
Please bump the version in the dockerfile + update changelog if you want to publish a new version of CAT.
Thank you for this addition, I'm sure it'll help us detect API changes faster.

@erohmensing
Copy link
Contributor Author

I double-checked the other categories (failed for another reason) for beta and GA connectors and rebuilt/reran them. Most fell into the "success" or "failed and needs bypass" and the only one which didn't is failing on connector-health. So I am relatively confident we caught what we could!

Going to get this in and work on

  • Get the list of definite successes to Michael
  • Creating the issues to fix these bypassed connector

@erohmensing
Copy link
Contributor Author

erohmensing commented Mar 23, 2023

Tried to run airtable in the PR because of single-use token shenanigans, but realized it wasn't using the local version of CAT. Now running here with dev off of ella/no-extra-fields

@erohmensing
Copy link
Contributor Author

erohmensing commented Mar 23, 2023

/test connector=connectors/source-slack connector-acceptance-test-version=dev

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

Name                       Stmts   Miss  Cover
----------------------------------------------
source_slack/__init__.py       2      0   100%
source_slack/source.py       225     19    92%
----------------------------------------------
TOTAL                        227     19    92%
	 Name                                                    Stmts   Miss  Cover   Missing
	 -------------------------------------------------------------------------------------
	 connector_acceptance_test/base.py                          12      4    67%   16-19
	 connector_acceptance_test/config.py                       153      8    95%   87, 93, 252, 256, 261-262, 267-268
	 connector_acceptance_test/conftest.py                     233    106    55%   38, 44-46, 51, 56, 61, 84, 90, 96-98, 117, 122-124, 130-132, 138-139, 144-145, 150, 161, 170-179, 185-190, 217, 241, 272, 278, 286-294, 306-325, 333-346, 351-357, 364-375, 382-398
	 connector_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 connector_acceptance_test/tests/test_core.py              535     95    82%   55, 60, 99-110, 115-122, 126-127, 131-132, 382, 402, 427, 507, 545-564, 577-588, 592-597, 603, 636-641, 679-686, 825-828, 833, 838, 898-899, 905, 945-955, 972-973, 975, 993-998
	 connector_acceptance_test/tests/test_incremental.py       162     14    91%   58-65, 70-83, 252
	 connector_acceptance_test/utils/asserts.py                 48      2    96%   78-79
	 connector_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 connector_acceptance_test/utils/compare.py                 64     23    64%   21-51, 68, 101-103
	 connector_acceptance_test/utils/connector_runner.py       134     33    75%   30-33, 53-54, 57-61, 64-65, 80-82, 85-87, 90-92, 95-97, 100-102, 132-133, 167-169, 216
	 connector_acceptance_test/utils/json_schema_helper.py     117     13    89%   31-32, 39, 42, 66-69, 97, 121, 210-212
	 -------------------------------------------------------------------------------------
	 TOTAL                                                    1812    333    82%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:578: The previous and actual discovered catalogs are identical.
================== 40 passed, 2 skipped in 5434.56s (1:30:34) ==================

@erohmensing
Copy link
Contributor Author

erohmensing commented Mar 23, 2023

/test connector=connectors/source-linkedin-ads connector-acceptance-test-version=dev

🕑 connectors/source-linkedin-ads https://github.com/airbytehq/airbyte/actions/runs/4505235809
✅ connectors/source-linkedin-ads https://github.com/airbytehq/airbyte/actions/runs/4505235809
Python tests coverage:

Name                               Stmts   Miss  Cover
------------------------------------------------------
source_linkedin_ads/analytics.py      45      0   100%
source_linkedin_ads/__init__.py        2      0   100%
source_linkedin_ads/utils.py          91      5    95%
source_linkedin_ads/source.py        195     27    86%
------------------------------------------------------
TOTAL                                333     32    90%
	 Name                                                    Stmts   Miss  Cover   Missing
	 -------------------------------------------------------------------------------------
	 connector_acceptance_test/base.py                          12      4    67%   16-19
	 connector_acceptance_test/config.py                       153      8    95%   87, 93, 252, 256, 261-262, 267-268
	 connector_acceptance_test/conftest.py                     233    106    55%   38, 44-46, 51, 56, 61, 84, 90, 96-98, 117, 122-124, 130-132, 138-139, 144-145, 150, 161, 170-179, 185-190, 217, 241, 272, 278, 286-294, 306-325, 333-346, 351-357, 364-375, 382-398
	 connector_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 connector_acceptance_test/tests/test_core.py              535     95    82%   55, 60, 99-110, 115-122, 126-127, 131-132, 382, 402, 427, 507, 545-564, 577-588, 592-597, 603, 636-641, 679-686, 825-828, 833, 838, 898-899, 905, 945-955, 972-973, 975, 993-998
	 connector_acceptance_test/tests/test_incremental.py       162     14    91%   58-65, 70-83, 252
	 connector_acceptance_test/utils/asserts.py                 48      2    96%   78-79
	 connector_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 connector_acceptance_test/utils/compare.py                 64     23    64%   21-51, 68, 101-103
	 connector_acceptance_test/utils/connector_runner.py       134     33    75%   30-33, 53-54, 57-61, 64-65, 80-82, 85-87, 90-92, 95-97, 100-102, 132-133, 167-169, 216
	 connector_acceptance_test/utils/json_schema_helper.py     117     13    89%   31-32, 39, 42, 66-69, 97, 121, 210-212
	 -------------------------------------------------------------------------------------
	 TOTAL                                                    1812    333    82%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:578: The previous and actual discovered catalogs are identical.
================== 38 passed, 2 skipped in 2036.56s (0:33:56) ==================

@erohmensing erohmensing enabled auto-merge (squash) March 23, 2023 22:07
@erohmensing erohmensing merged commit 9cfc647 into master Mar 23, 2023
@erohmensing erohmensing deleted the ella/no-extra-fields branch March 23, 2023 22:22
@alafanechere
Copy link
Contributor

alafanechere commented Mar 24, 2023

/publish connector=bases/connector-acceptance-test auto-bump-version=false

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

🕑 Publishing the following connectors:
bases/connector-acceptance-test
https://github.com/airbytehq/airbyte/actions/runs/4509711507


Connector Did it publish? Were definitions generated?
bases/connector-acceptance-test

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@erohmensing
Copy link
Contributor Author

@alafanechere thank you! Forget that one a lot 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment