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

🚨🚨 Source Hubspot - fixed incremental for engagement stream #27161

Merged
merged 27 commits into from Jun 29, 2023

Conversation

midavadim
Copy link
Collaborator

@midavadim midavadim commented Jun 8, 2023

What

Fixed increment sync for engagements stream,

How

'Recent' API is used for recent syncs of last recent 30 days and less than 10k records, otherwise full sync if performed by 'All' API

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

Fixed schema for email_events stream. The correct type of "browser.version" field is list of strings.
Docs example also indicates the same type:
https://legacydocs.hubspot.com/docs/methods/email/get_events
"browser": {
"family": "Google Image Cache",
"name": "Google Image Cache",
"producer": "",
"producerUrl": "",
"type": "Proxy",
"url": "",
"version": []
},

For connector PRs, use this section to explain which type of semantic versioning bump occurs as a result of the changes. Refer to our Semantic Versioning for Connectors guidelines for more information. Breaking changes to connectors must be documented by an Airbyte engineer (PR author, or reviewer for community PRs) by using the Breaking Change Release Playbook.

If there are breaking changes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

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.
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Unit & integration tests added

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

@CLAassistant
Copy link

CLAassistant commented Jun 8, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2023

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan and you've followed all steps in the Breaking Changes Checklist
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • You, or an Airbyter, have run /test successfully on this PR - or on a non-forked branch
  • You've updated the connector's metadata.yaml file (new!)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@midavadim
Copy link
Collaborator Author

midavadim commented Jun 8, 2023

/test connector=connectors/source-hubspot

🕑 connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/5213835749
❌ connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/5213835749
🐛 https://gradle.com/s/pa7usgni4fviy

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - Failed: Stream conta...
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:598: The previous and actual discovered catalogs are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:695: This tests currently leads to too much failures. We need to fix the connectors at scale first.
============= 1 failed, 41 passed, 3 skipped in 430.69s (0:07:10) ==============

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Jun 8, 2023
@midavadim
Copy link
Collaborator Author

midavadim commented Jun 8, 2023

/test connector=connectors/source-hubspot

🕑 connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/5215907021
❌ connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/5215907021
🐛 https://gradle.com/s/lu2tbf3ckcqzm

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestDiscovery::test_backward_compatibility[inputs0] - co...
FAILED test_core.py::TestBasicRead::test_read[inputs0] - Failed: Stream conta...
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:695: This tests currently leads to too much failures. We need to fix the connectors at scale first.
============= 2 failed, 41 passed, 2 skipped in 401.80s (0:06:41) ==============

@midavadim
Copy link
Collaborator Author

midavadim commented Jun 9, 2023

/test connector=connectors/source-hubspot

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

Name                          Stmts   Miss  Cover
-------------------------------------------------
source_hubspot/errors.py         10      0   100%
source_hubspot/constants.py       2      0   100%
source_hubspot/__init__.py        2      0   100%
source_hubspot/helpers.py        70      3    96%
source_hubspot/streams.py       998     87    91%
source_hubspot/source.py         67     20    70%
-------------------------------------------------
TOTAL                          1149    110    90%
Name                          Stmts   Miss  Cover
-------------------------------------------------
source_hubspot/constants.py       2      0   100%
source_hubspot/__init__.py        2      0   100%
source_hubspot/helpers.py        70      7    90%
source_hubspot/errors.py         10      1    90%
source_hubspot/source.py         67     14    79%
source_hubspot/streams.py       998    241    76%
-------------------------------------------------
TOTAL                          1149    263    77%

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:607: Backward compatibility tests are disabled for version 0.8.4.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:695: This tests currently leads to too much failures. We need to fix the connectors at scale first.
================== 42 passed, 3 skipped in 410.93s (0:06:50) ===================

Copy link
Collaborator

@lazebnyi lazebnyi left a comment

Choose a reason for hiding this comment

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

Please fill PR description

@midavadim midavadim requested a review from lazebnyi June 14, 2023 08:46
@midavadim midavadim changed the title 🎉 Source Hubspot - fixed incremental for engagement stream rotating_lightrotating_light Source Hubspot - fixed incremental for engagement stream Jun 16, 2023
@midavadim midavadim changed the title rotating_lightrotating_light Source Hubspot - fixed incremental for engagement stream :rotating_lightrotating_light: Source Hubspot - fixed incremental for engagement stream Jun 16, 2023
@midavadim midavadim changed the title :rotating_lightrotating_light: Source Hubspot - fixed incremental for engagement stream 🚨 Source Hubspot - fixed incremental for engagement stream Jun 16, 2023
@midavadim midavadim changed the title 🚨 Source Hubspot - fixed incremental for engagement stream 🚨🚨 Source Hubspot - fixed incremental for engagement stream Jun 16, 2023
Copy link
Collaborator

@lazebnyi lazebnyi left a comment

Choose a reason for hiding this comment

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

LGTM! Small refactoring required.

Comment on lines +1529 to +1533
since_date = self._start_date
if stream_state:
since_date_timestamp = stream_state.get(self.updated_at_field)
if since_date_timestamp:
since_date = pendulum.from_timestamp(int(since_date_timestamp) / 1000)
Copy link
Collaborator

Choose a reason for hiding this comment

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

More pythonic way)

since_date_timestamp = stream_state.get(self.updated_at_field) if stream_state else stream_state
since_date = pendulum.from_timestamp(int(since_date_timestamp) / 1000) if since_date_timestamp else self._start_date

@midavadim midavadim requested a review from bnchrch June 19, 2023 17:35
@bnchrch
Copy link
Contributor

bnchrch commented Jun 19, 2023

@midavadim This is looking good. I noticed we checked

Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan and you've followed all steps in the Breaking Changes Checklist

Do we have a link to the breaking change plan?

@midavadim midavadim added the breaking-change Don't merge me unless you are ready. label Jun 20, 2023
@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit b1c3ddf291) - ✅

⏲️ Total pipeline duration: 648 seconds

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check.
Connector version increment check.
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit 798fed7a2b) - ✅

⏲️ Total pipeline duration: 687 seconds

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check.
Connector version increment check.
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@wmikemoon
Copy link

@midavadim This will be scheduled for 06/29/23 at 12:00PM EST. I will send outreach today. Please let me know if anything changes!

# Conflicts:
#	airbyte-integrations/connectors/source-hubspot/Dockerfile
#	airbyte-integrations/connectors/source-hubspot/metadata.yaml
#	docs/integrations/sources/hubspot.md
…emental-sync' into midavadim/26365-hubspot-fix-incremental-sync
@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit 9338c20892) - ❌

⏲️ Total pipeline duration: 11mn31s

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit b887d914d8) - ❌

⏲️ Total pipeline duration: 11mn46s

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit 7ab2e20d43) - ❌

⏲️ Total pipeline duration: 10mn32s

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit 575e1f5106) - ❌

⏲️ Total pipeline duration: 10mn43s

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@midavadim midavadim enabled auto-merge (squash) June 29, 2023 19:12
@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit 072ada4d4e) - ✅

⏲️ Total pipeline duration: 10mn46s

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit 87f8431072) - ❌

⏲️ Total pipeline duration: 10mn37s

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit 8597d5309c) - ❌

⏲️ Total pipeline duration: 18.07s

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit 8597d5309c) - ❌

⏲️ Total pipeline duration: 17.18s

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit 8597d5309c) - ❌

⏲️ Total pipeline duration: 17.51s

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@github-actions
Copy link
Contributor

Coverage report for source-postgres

There is no coverage information present for the Files changed

Total Project Coverage 67.62% 🍏

@octavia-squidington-iii
Copy link
Collaborator

source-hubspot test report (commit 3f21afa99e) - ✅

⏲️ Total pipeline duration: 10mn43s

Step Result
Validate airbyte-integrations/connectors/source-hubspot/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Code format checks
Connector package install
Build source-hubspot docker image for platform linux/x86_64
Unit tests
Integration tests
Acceptance tests

🔗 View the logs here

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-hubspot test

@midavadim midavadim merged commit 957f21d into master Jun 29, 2023
24 checks passed
@midavadim midavadim deleted the midavadim/26365-hubspot-fix-incremental-sync branch June 29, 2023 22:12
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/documentation Improvements or additions to documentation breaking-change Don't merge me unless you are ready. connectors/source/hubspot
Projects
None yet
6 participants