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 Confluence: certificate to Beta #23988

Merged
merged 7 commits into from
Mar 22, 2023

Conversation

darynaishchenko
Copy link
Collaborator

@darynaishchenko darynaishchenko commented Mar 13, 2023

@darynaishchenko darynaishchenko self-assigned this Mar 13, 2023
@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/confluence labels Mar 13, 2023
@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Mar 13, 2023

/test connector=connectors/source-confluence

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

Name                            Stmts   Miss  Cover
---------------------------------------------------
source_confluence/__init__.py       2      0   100%
source_confluence/source.py        79     19    76%
---------------------------------------------------
TOTAL                              81     19    77%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical.
======================== 33 passed, 2 skipped in 37.83s ========================

@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Mar 14, 2023

/test connector=connectors/source-confluence

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

Name                            Stmts   Miss  Cover
---------------------------------------------------
source_confluence/__init__.py       2      0   100%
source_confluence/source.py        79      1    99%
---------------------------------------------------
TOTAL                              81      1    99%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical.
======================== 33 passed, 2 skipped in 36.92s ========================

@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Mar 21, 2023

/test connector=connectors/source-confluence

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

Name                            Stmts   Miss  Cover
---------------------------------------------------
source_confluence/__init__.py       2      0   100%
source_confluence/source.py        79      1    99%
---------------------------------------------------
TOTAL                              81      1    99%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical.
======================== 33 passed, 2 skipped in 40.27s ========================

@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Mar 21, 2023

/test connector=connectors/source-confluence

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

Name                            Stmts   Miss  Cover
---------------------------------------------------
source_confluence/__init__.py       2      0   100%
source_confluence/source.py        88      4    95%
---------------------------------------------------
TOTAL                              90      4    96%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical.
======================== 33 passed, 2 skipped in 41.01s ========================

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! Suggested small changes to stream method.

Comment on lines 153 to 159
try:
response = requests.get(url, headers=auth.get_auth_header())
response.raise_for_status()
return [Pages(config), BlogPosts(config), Space(config), Group(config), Audit(config)]
except requests.exceptions.RequestException as e:
logger.warning(f"An exception occurred while trying to access Audit stream: {str(e)}. Skipping this stream.")
return [Pages(config), BlogPosts(config), Space(config), Group(config)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
try:
response = requests.get(url, headers=auth.get_auth_header())
response.raise_for_status()
return [Pages(config), BlogPosts(config), Space(config), Group(config), Audit(config)]
except requests.exceptions.RequestException as e:
logger.warning(f"An exception occurred while trying to access Audit stream: {str(e)}. Skipping this stream.")
return [Pages(config), BlogPosts(config), Space(config), Group(config)]
streams = [Pages(config), BlogPosts(config), Space(config), Group(config), Audit(config)]
try:
response = requests.get(url, headers=auth.get_auth_header())
response.raise_for_status()
except requests.exceptions.RequestException as e:
logger.warning(f"An exception occurred while trying to access Audit stream: {str(e)}. Skipping this stream.")
streams.pop()
finally:
return streams

Copy link
Collaborator

Choose a reason for hiding this comment

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

Above described more pythonic way to Audit validation. But better way is add validation method what return bool value and depend on that we will add Audit stream to our streams list.

P-Code:

def account_plan_validation(self, config, auth):
    url = f"https://{config['domain_name']}/wiki/rest/api/audit?limit=1"
    is_primium_or_standard_plan = False
    try:
            response = requests.get(url, headers=auth.get_auth_header())
            response.raise_for_status()
            is_primium_or_standard_plan = True
    except requests.exceptions.RequestException as e:
            logger.warning(f"An exception occurred while trying to access Audit stream: {str(e)}. Skipping this stream.")
    finally:
            return is_primium_or_standard_plan

 def streams(self, config: Mapping[str, Any]) -> List[Stream]:
    ...
    streams = [Pages(config), BlogPosts(config), Space(config), Group(config)]
    if self.account_plan_validation(config, auth):
        streams.append(Audit(config))
    return streams

@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Mar 22, 2023

/test connector=connectors/source-confluence

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

Name                            Stmts   Miss  Cover
---------------------------------------------------
source_confluence/__init__.py       2      0   100%
source_confluence/source.py        94      3    97%
---------------------------------------------------
TOTAL                              96      3    97%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: not found in the config.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical.
======================== 33 passed, 2 skipped in 38.47s ========================

@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Mar 22, 2023

/publish connector=connectors/source-confluence

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


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

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

@darynaishchenko darynaishchenko merged commit af369de into master Mar 22, 2023
@darynaishchenko darynaishchenko deleted the daryna/source-confluence/update-to-beta branch March 22, 2023 10:32
erohmensing pushed a commit that referenced this pull request Mar 22, 2023
* added view and storage to pages, updated SAT

* added unittests

* added changelog, fixed type in docs

* added checking for stream Audit to skip it if user doesn't have permissions

* refactored plan validation

* auto-bump connector version

---------

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
erohmensing pushed a commit that referenced this pull request Mar 22, 2023
* added view and storage to pages, updated SAT

* added unittests

* added changelog, fixed type in docs

* added checking for stream Audit to skip it if user doesn't have permissions

* refactored plan validation

* auto-bump connector version

---------

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.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 connectors/source/confluence
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source Confluence - Add page body in confluence connector
3 participants