-
Notifications
You must be signed in to change notification settings - Fork 20
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
Remove OAuth authentication for GitHub #159
Conversation
6a6bfc2
to
1ecfe7c
Compare
@Carlos-Muniz @kdmccormick These changes make the bot work well for the openedx organization. |
1ecfe7c
to
cd36b44
Compare
The move from edx to openedx broke the OAuth authentication because the edx org had no OAuth restrictions, but the openedx org does. We don't need OAuth, so just use the personal access token.
ca70542
to
7e4943e
Compare
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.
There is some coverage missing. Can tests be written for these?
try: | ||
ret = pull_request_changed(pull_request) | ||
log_rate_limit() | ||
except Exception as exc: | ||
logger.exception("Couldn't pull_request_changed_task") | ||
raise | ||
|
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.
Missing coverage
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.
Oh snap! :)
except Exception as exc: | ||
req = response.request | ||
logger.exception(f"HTTP request failed: {req.method} {req.url}. Response body: {response.content}") | ||
raise |
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.
Missing coverage
rate = get_github_session().get("/rate_limit").json()['rate'] | ||
reset = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(rate['reset'])) | ||
logger.info(f"Rate limit: {rate['limit']}, used {rate['used']}, remaining {rate['remaining']}. Reset is at {reset}") |
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.
Missing coverage
if callable(callback): | ||
callback(resp) |
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.
Missing Coverage
974fde6
to
6dd1e3d
Compare
Also, improve the error handling to be sure we can see what's happening when an exception occurs.