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 Gitlab: add OAuth2.0 authentication support #7506

Merged
merged 45 commits into from
Jan 18, 2023

Conversation

bazarnov
Copy link
Collaborator

@bazarnov bazarnov commented Oct 31, 2021

What

#7480 - Source GitLab: support oauth

How

  • added GitlabAuthenticator class inside of source.py
  • extended spec.json with oauthFlowSpecification
  • added GitlabOauthFlow.java
  • added GitlabOauthFlowTest.java unit_test
  • added GitlabOauthFlowIntegrationTest.java integration_test

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Updating a connector

Community member or Airbyter

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


This change is Reviewable

@bazarnov bazarnov self-assigned this Oct 31, 2021
@bazarnov bazarnov linked an issue Oct 31, 2021 that may be closed by this pull request
@github-actions github-actions bot added the area/connectors Connector related issues label Oct 31, 2021
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Oct 31, 2021
@bazarnov bazarnov requested review from midavadim and antixar October 31, 2021 20:04
@bazarnov bazarnov temporarily deployed to more-secrets October 31, 2021 20:04 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets October 31, 2021 20:12 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets October 31, 2021 20:19 Inactive
@bazarnov
Copy link
Collaborator Author

bazarnov commented Nov 1, 2021

/test connector=connectors/source-gitlab

🕑 connectors/source-gitlab https://github.com/airbytehq/airbyte/actions/runs/1407111797
✅ connectors/source-gitlab https://github.com/airbytehq/airbyte/actions/runs/1407111797
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                        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%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                        Stmts   Miss  Cover
	 -----------------------------------------------
	 source_gitlab/__init__.py       2      2     0%
	 source_gitlab/source.py        46     46     0%
	 source_gitlab/streams.py      220    220     0%
	 -----------------------------------------------
	 TOTAL                         268    268     0%

@jrhizor jrhizor temporarily deployed to more-secrets November 1, 2021 08:33 Inactive
@bazarnov
Copy link
Collaborator Author

bazarnov commented Nov 1, 2021

/test connector=connectors/source-gitlab

🕑 connectors/source-gitlab https://github.com/airbytehq/airbyte/actions/runs/1408454039
✅ connectors/source-gitlab https://github.com/airbytehq/airbyte/actions/runs/1408454039
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                        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                 54     23    57%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  867    422    51%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                        Stmts   Miss  Cover
	 -----------------------------------------------
	 source_gitlab/__init__.py       2      2     0%
	 source_gitlab/source.py        46     46     0%
	 source_gitlab/streams.py      220    220     0%
	 -----------------------------------------------/actions-runner/_work/airbyte/airbyte/airbyte-integrations/connectors/source-gitlab/.venv/lib/python3.8/site-packages/coverage/control.py:761: CoverageWarning: No data was collected. (no-data-collected)
	 -----------------------------------------------
	   self._warn("No data was collected.", slug="no-data-collected")
	 TOTAL                         268    268     0%

@bazarnov bazarnov temporarily deployed to more-secrets November 1, 2021 15:09 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets November 1, 2021 15:10 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets November 2, 2021 13:59 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets November 2, 2021 14:33 Inactive
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.

👏
Feel free to publish, but do not merge before 10AM PST please.

@davydov-d
Copy link
Collaborator

davydov-d commented Jan 18, 2023

/publish connector=connectors/source-gitlab

🕑 Publishing the following connectors:
connectors/source-gitlab
https://github.com/airbytehq/airbyte/actions/runs/3949845143


Connector Did it publish? Were definitions generated?
connectors/source-gitlab

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

@davydov-d davydov-d temporarily deployed to more-secrets January 18, 2023 15:43 — with GitHub Actions Inactive
@davydov-d davydov-d temporarily deployed to more-secrets January 18, 2023 15:43 — with GitHub Actions Inactive
@davydov-d davydov-d temporarily deployed to more-secrets January 18, 2023 15:43 — with GitHub Actions Inactive
@davydov-d davydov-d temporarily deployed to more-secrets January 18, 2023 15:44 — with GitHub Actions Inactive
@davydov-d
Copy link
Collaborator

davydov-d commented Jan 18, 2023

/publish connector=connectors/source-gitlab

🕑 Publishing the following connectors:
connectors/source-gitlab
https://github.com/airbytehq/airbyte/actions/runs/3950510305


Connector Did it publish? Were definitions generated?
connectors/source-gitlab

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

@github-actions
Copy link
Contributor

Airbyte Code Coverage

File Coverage [25.08%]
GitlabOAuthFlow.java 71.15% 🍏
OAuthImplementationFactory.java 0%
Total Project Coverage 26.77% 🍏

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 18, 2023 16:14 — with GitHub Actions Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 18, 2023 16:14 — with GitHub Actions Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 18, 2023 16:14 — with GitHub Actions Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 18, 2023 16:15 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

Airbyte Code Coverage

File Coverage [25.08%]
GitlabOAuthFlow.java 71.15% 🍏
OAuthImplementationFactory.java 0%
Total Project Coverage 26.77% 🍏

@davydov-d davydov-d temporarily deployed to more-secrets January 18, 2023 16:54 — with GitHub Actions Inactive
@davydov-d davydov-d temporarily deployed to more-secrets January 18, 2023 16:55 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

Airbyte Code Coverage

File Coverage [25.08%]
GitlabOAuthFlow.java 71.15% 🍏
OAuthImplementationFactory.java 0%
Total Project Coverage 26.77% 🍏

@tybernstein
Copy link
Contributor

@davydov-d Is this good to merge? This roughly the time we said it would be merged

@davydov-d davydov-d merged commit b69639e into master Jan 18, 2023
@davydov-d davydov-d deleted the bazarnov/7480-gitlab-oauth branch January 18, 2023 17:59
@davydov-d
Copy link
Collaborator

yep! :)

@tybernstein
Copy link
Contributor

Thank you!

@tybernstein
Copy link
Contributor

It appears that the option to OAuth is not available on Cloud and syncs are starting to break. @alafanechere, @brianjlai, and @davydov-d. Can you check this out?
Screenshot 2023-01-18 at 2 43 31 PM

@davydov-d
Copy link
Collaborator

@TBernstein4 the deployment to cloud has not been finished yet. I removed the OAuth config so the previous version should work as usual. Will restore the Oauth config as soon as the deployment succeeds

@davydov-d
Copy link
Collaborator

I'll make you know when the Oauth is on cloud

@tybernstein
Copy link
Contributor

Thank you for doing that @davydov-d!

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 connectors/source/gitlab connectors/sources-api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source GitLab: support oauth