-
Notifications
You must be signed in to change notification settings - Fork 846
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
Change log statements in contributor resolution to match new policy #2862
Conversation
Signed-off-by: Isaac Milarsky <[email protected]>
continue | ||
|
||
#logger.info(f"Returned dict: {response_data}") | ||
success = True | ||
break | ||
elif type(response_data) == list: |
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.
[pylint] reported by reviewdog 🐶
C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
success = True | ||
break | ||
elif type(response_data) == list: | ||
logger.warning("Wrong type returned, trying again...") | ||
logger.info(f"Returned list: {response_data}") | ||
logger.debug(f"Returned list: {response_data}") | ||
elif type(response_data) == str: |
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.
[pylint] reported by reviewdog 🐶
C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
@@ -25,8 +25,6 @@ | |||
# Returns None on failure. | |||
# NOTE: This function is being deprecated in favor of retrieve_dict_from_endpoint | |||
def request_dict_from_endpoint(logger, session, url, timeout_wait=10): |
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.
[pylint] reported by reviewdog 🐶
R0912: Too many branches (14/12) (too-many-branches)
@@ -95,7 +92,6 @@ def request_dict_from_endpoint(logger, session, url, timeout_wait=10): | |||
|
|||
|
|||
def create_endpoint_from_email(email): | |||
#self.logger.info(f"Trying to resolve contributor from email: {email}") | |||
# Note: I added "+type:user" to avoid having user owned organizations be returned | |||
# Also stopped splitting per note above. | |||
url = 'https://api.github.com/search/users?q={}+in:email+type:user'.format( |
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.
[pylint] reported by reviewdog 🐶
C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
@@ -215,8 +206,6 @@ def resolve_if_login_existing(logger, contributor): | |||
return True | |||
|
|||
# If not found, return false | |||
logger.info( | |||
f"Contributor not found in contributors table but can be added. Adding...") | |||
return False | |||
""" |
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.
[pylint] reported by reviewdog 🐶
W0105: String statement has no effect (pointless-string-statement)
@@ -293,9 +281,9 @@ def fetch_username_from_email(logger, auth, commit): | |||
|
|||
# Check if the email result got anything, if it failed try a name search. | |||
if login_json is None or 'total_count' not in login_json or login_json['total_count'] == 0: |
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.
[pylint] reported by reviewdog 🐶
R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
@@ -57,7 +57,7 @@ def process_commit_metadata(logger, auth, contributorQueue, repo_id, platform_id | |||
login = get_login_with_commit_hash(logger, auth, contributor, repo_id) | |||
|
|||
if login == None or login == "": |
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.
[pylint] reported by reviewdog 🐶
R1714: Consider merging these comparisons with 'in' by using 'login in (None, '')'. Use a set instead if elements are hashable. (consider-using-in)
@@ -57,7 +57,7 @@ def process_commit_metadata(logger, auth, contributorQueue, repo_id, platform_id | |||
login = get_login_with_commit_hash(logger, auth, contributor, repo_id) | |||
|
|||
if login == None or login == "": |
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.
[pylint] reported by reviewdog 🐶
C0121: Comparison 'login == None' should be 'login is None' (singleton-comparison)
Description
Make logging statements in the contributor resolution logic follow new policy: #2848
This PR fixes #2856
Signed commits