-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Source Confluence: certificate to Beta #23988
Conversation
darynaishchenko
commented
Mar 13, 2023
•
edited
Loading
edited
- resolved Source Confluence - Add page body in confluence connector #22410
- increased test coverage
/test connector=connectors/source-confluence
Build PassedTest summary info:
|
/test connector=connectors/source-confluence
Build PassedTest summary info:
|
/test connector=connectors/source-confluence
Build PassedTest summary info:
|
/test connector=connectors/source-confluence
Build PassedTest summary info:
|
There was a problem hiding this 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.
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)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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
/test connector=connectors/source-confluence
Build PassedTest summary info:
|
/publish connector=connectors/source-confluence
if you have connectors that successfully published but failed definition generation, follow step 4 here |
* 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>
* 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>