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 Google Search Console: accept admin email as input when using service account key #6405

Merged
merged 7 commits into from
Sep 23, 2021

Conversation

sherifnada
Copy link
Contributor

@sherifnada sherifnada commented Sep 23, 2021

What

In many cases to authenticate properly we need to know the email of the admin who the service account should impersonate. This PR allows the user to configure this as input.

How

  1. Change ServiceAccountAuthenticator to extend AuthBase to make it possible to leverage google's since oauth2client was deprecated in 2019
  2. inject the authenticator at instantiation time, without this there was a bug that caused HttpStream to not know how to switch between AuthBase and HttpAuthenticator
  3. Accept admin email as input and use it in the connector
  4. Prettify fields in spec.json to add title fields

Recommended reading order

  1. spec.json
  2. source.py
  3. streams.py
  4. service_account_authenticator.py
    anything else

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 Sep 23, 2021
@sherifnada
Copy link
Contributor Author

sherifnada commented Sep 23, 2021

/test connector=connectors/source-google-search-console

🕑 connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266811414

@jrhizor jrhizor temporarily deployed to more-secrets September 23, 2021 17:22 Inactive
@sherifnada
Copy link
Contributor Author

sherifnada commented Sep 23, 2021

/test connector=connectors/source-google-search-console

🕑 connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266823506
❌ connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266823506
🐛

@jrhizor jrhizor temporarily deployed to more-secrets September 23, 2021 17:26 Inactive
@sherifnada sherifnada temporarily deployed to more-secrets September 23, 2021 17:27 Inactive
@sherifnada sherifnada temporarily deployed to more-secrets September 23, 2021 17:29 Inactive
@sherifnada
Copy link
Contributor Author

sherifnada commented Sep 23, 2021

/test connector=connectors/source-google-search-console

🕑 connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266841440
❌ connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266841440
🐛 https://gradle.com/s/ufkzjx4qdhwt4

@sherifnada sherifnada temporarily deployed to more-secrets September 23, 2021 17:31 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets September 23, 2021 17:32 Inactive
@sherifnada sherifnada linked an issue Sep 23, 2021 that may be closed by this pull request
@sherifnada
Copy link
Contributor Author

sherifnada commented Sep 23, 2021

/test connector=connectors/source-google-search-console

🕑 connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266882484
❌ connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266882484
🐛 https://gradle.com/s/s2nwn7ms7ehgg

@sherifnada sherifnada temporarily deployed to more-secrets September 23, 2021 17:43 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets September 23, 2021 17:45 Inactive
@sherifnada sherifnada temporarily deployed to more-secrets September 23, 2021 17:56 Inactive
@sherifnada
Copy link
Contributor Author

sherifnada commented Sep 23, 2021

/test connector=connectors/source-google-search-console

🕑 connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266934294
✅ connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266934294
Python tests coverage:

	 ---------- 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                        45     45     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              158    109    31%
	 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     25    39%
	 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      75     11    85%
	 ------------------------------------------------------------------------
	 TOTAL                                                  776    430    45%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                            Stmts   Miss  Cover
	 -----------------------------------------------------------------------------------
	 source_google_search_console/__init__.py                            2      0   100%
	 source_google_search_console/service_account_authenticator.py      14      6    57%
	 source_google_search_console/source.py                             36     22    39%
	 source_google_search_console/streams.py                           107     31    71%
	 -----------------------------------------------------------------------------------
	 TOTAL                                                             159     59    63%

@sherifnada sherifnada temporarily deployed to more-secrets September 23, 2021 18:01 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets September 23, 2021 18:02 Inactive
@sherifnada
Copy link
Contributor Author

sherifnada commented Sep 23, 2021

/publish connector=connectors/source-google-search-console

🕑 connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266988956
✅ connectors/source-google-search-console https://github.com/airbytehq/airbyte/actions/runs/1266988956

@jrhizor jrhizor temporarily deployed to more-secrets September 23, 2021 18:18 Inactive
@sherifnada sherifnada merged commit ef6fefc into master Sep 23, 2021
@sherifnada sherifnada deleted the sherif/fix-google-search-console branch September 23, 2021 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source: Google Search Console Bug
2 participants