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 Pipedrive: add oAuth support #6821

Merged
merged 4 commits into from
Oct 12, 2021

Conversation

gaart
Copy link
Contributor

@gaart gaart commented Oct 5, 2021

What

Closes #6821

Pre-merge Checklist

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
  • Connector version bumped like described here

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
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here

@github-actions github-actions bot added the area/connectors Connector related issues label Oct 5, 2021
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Oct 5, 2021
@gaart gaart temporarily deployed to more-secrets October 5, 2021 21:59 Inactive
@gaart gaart linked an issue Oct 6, 2021 that may be closed by this pull request
params = {"api_token": self._api_token, "limit": self.page_size, **next_page_token}
params = {"limit": self.page_size, **next_page_token}

if isinstance(self.authenticator, NoAuth):
Copy link
Contributor

@keu keu Oct 6, 2021

Choose a reason for hiding this comment

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

looks weird, why can't we create an authenticator inherited from AuthBase? ParamAuthenticator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@keu We can, but we're trying to add new features for OAuth without changing existing ones. Should I find another solution?

Copy link
Contributor

@keu keu left a comment

Choose a reason for hiding this comment

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

see comments

@@ -135,6 +135,8 @@ jobs:
MYSQL_SSH_PWD_TEST_CREDS: ${{ secrets.MYSQL_SSH_PWD_TEST_CREDS }}
POSTHOG_TEST_CREDS: ${{ secrets.POSTHOG_TEST_CREDS }}
PIPEDRIVE_INTEGRATION_TESTS_CREDS: ${{ secrets.PIPEDRIVE_INTEGRATION_TESTS_CREDS }}
PIPEDRIVE_INTEGRATION_TESTS_CREDS_OAUTH: ${{ secrets.PIPEDRIVE_INTEGRATION_TESTS_CREDS_OAUTH }}
PIPEDRIVE_INTEGRATION_TESTS_CREDS_OLD: ${{ secrets.PIPEDRIVE_INTEGRATION_TESTS_CREDS_OLD }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
PIPEDRIVE_INTEGRATION_TESTS_CREDS_OLD: ${{ secrets.PIPEDRIVE_INTEGRATION_TESTS_CREDS_OLD }}
PIPEDRIVE_INTEGRATION_TESTS_CREDS_TOKEN: ${{ secrets.PIPEDRIVE_INTEGRATION_TESTS_CREDS_TOKEN }}

@sherifnada if we going to support both,

Copy link
Contributor

Choose a reason for hiding this comment

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

I think _OLD is the legacy format of the config and is present to make sure backwards compat is working

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct

@@ -106,7 +106,9 @@ write_standard_creds source-paypal-transaction "$PAYPAL_TRANSACTION_CREDS"
write_standard_creds source-mysql "$MYSQL_SSH_KEY_TEST_CREDS" "ssh-key-config.json"
write_standard_creds source-mysql "$MYSQL_SSH_PWD_TEST_CREDS" "ssh-pwd-config.json"
write_standard_creds source-posthog "$POSTHOG_TEST_CREDS"
write_standard_creds source-pipedrive "$PIPEDRIVE_INTEGRATION_TESTS_CREDS"
write_standard_creds source-pipedrive "$PIPEDRIVE_INTEGRATION_TESTS_CREDS" "config.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

why there are 3 different configs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1 - new style config for OAuth
2 - new style config for Token auth
3 - old style config for Token auth

@gaart
Copy link
Contributor Author

gaart commented Oct 7, 2021

/test connector=connectors/source-pipedrive

🕑 connectors/source-pipedrive https://github.com/airbytehq/airbyte/actions/runs/1317062829
❌ connectors/source-pipedrive https://github.com/airbytehq/airbyte/actions/runs/1317062829
🐛

@jrhizor jrhizor temporarily deployed to more-secrets October 7, 2021 16:32 Inactive
@gaart gaart requested a review from keu October 7, 2021 16:37
@gaart
Copy link
Contributor Author

gaart commented Oct 11, 2021

/test connector=connectors/source-pipedrive

🕑 connectors/source-pipedrive https://github.com/airbytehq/airbyte/actions/runs/1329381344
❌ connectors/source-pipedrive https://github.com/airbytehq/airbyte/actions/runs/1329381344
🐛

@gaart gaart temporarily deployed to more-secrets October 11, 2021 14:30 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets October 11, 2021 14:31 Inactive
@gaart
Copy link
Contributor Author

gaart commented Oct 12, 2021

/test connector=connectors/source-pipedrive

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

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 /actions-runner/_work/airbyte/airbyte/airbyte-integrations/connectors/source-pipedrive/.venv/lib/python3.8/site-packages/coverage/control.py:761: CoverageWarning: No data was collected. (no-data-collected)
	 Name                           Stmts   Miss  Cover
	   self._warn("No data was collected.", slug="no-data-collected")
	 --------------------------------------------------
	 source_pipedrive/__init__.py       2      2     0%
	 source_pipedrive/source.py        36     36     0%
	 source_pipedrive/streams.py       75     75     0%
	 --------------------------------------------------
	 TOTAL                            113    113     0%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 /actions-runner/_work/airbyte/airbyte/airbyte-integrations/connectors/source-pipedrive/.venv/lib/python3.8/site-packages/coverage/control.py:761: CoverageWarning: No data was collected. (no-data-collected)
	 Name                           Stmts   Miss  Cover
	   self._warn("No data was collected.", slug="no-data-collected")
	 --------------------------------------------------
	 source_pipedrive/__init__.py       2      2     0%
	 source_pipedrive/source.py        36     36     0%
	 source_pipedrive/streams.py       75     75     0%
	 --------------------------------------------------
	 TOTAL                            113    113     0%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        74      8    89%
	 source_acceptance_test/conftest.py                     108    108     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              200     94    53%
	 source_acceptance_test/tests/test_full_refresh.py       18     11    39%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  41     24    41%
	 source_acceptance_test/utils/compare.py                 47     20    57%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  860    419    51%

@jrhizor jrhizor temporarily deployed to more-secrets October 12, 2021 06:19 Inactive
@gaart
Copy link
Contributor Author

gaart commented Oct 12, 2021

/publish connector=connectors/source-pipedrive

🕑 connectors/source-pipedrive https://github.com/airbytehq/airbyte/actions/runs/1331891848
✅ connectors/source-pipedrive https://github.com/airbytehq/airbyte/actions/runs/1331891848

@jrhizor jrhizor temporarily deployed to more-secrets October 12, 2021 06:28 Inactive
@gaart gaart merged commit 99b1e91 into master Oct 12, 2021
@gaart gaart deleted the gaart/6278-source-pipedrive-oauth-support branch October 12, 2021 06:45
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
* Add oauth support

* Upd changelog

* Update airbyte-integrations/connectors/source-pipedrive/source_pipedrive/spec.json

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source Pipedrive: support oauth
4 participants