Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions dev/merge_spark_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
# Go to https://issues.apache.org/jira/secure/ViewProfile.jspa -> Personal Access Tokens for
# your own token management.
JIRA_ACCESS_TOKEN = os.environ.get("JIRA_ACCESS_TOKEN")
# Connection timeout (in seconds) for the JIRA client. Raise this if the default is too
# short for your network, e.g. when the TLS handshake goes through a slow proxy.
JIRA_CONNECT_TIMEOUT = float(os.environ.get("JIRA_CONNECT_TIMEOUT", "3.05"))
# OAuth key used for issuing requests against the GitHub API. If this is not defined, then requests
# will be unauthenticated. You should only need to configure this if you find yourself regularly
# exceeding your IP's unauthenticated request rate limit. You can create an OAuth key at
Expand Down Expand Up @@ -562,7 +565,9 @@ def initialize_jira():
print_error("ERROR finding jira library. Run 'pip3 install jira' to install.")
continue_maybe("Continue without jira?")
elif JIRA_ACCESS_TOKEN:
client = jira.client.JIRA(jira_server, token_auth=JIRA_ACCESS_TOKEN, timeout=(3.05, 30))
client = jira.client.JIRA(
jira_server, token_auth=JIRA_ACCESS_TOKEN, timeout=(JIRA_CONNECT_TIMEOUT, 30)
)
try:
# Eagerly check if the token is valid to align with the behavior of username/password
# authn
Expand All @@ -582,7 +587,9 @@ def initialize_jira():
print("Visit https://issues.apache.org/jira/secure/ViewProfile.jspa ")
print("and click 'Personal Access Tokens' menu to manage your own tokens.")
asf_jira = jira.client.JIRA(
jira_server, basic_auth=(JIRA_USERNAME, JIRA_PASSWORD), timeout=(3.05, 30)
jira_server,
basic_auth=(JIRA_USERNAME, JIRA_PASSWORD),
timeout=(JIRA_CONNECT_TIMEOUT, 30),
)
else:
print("Neither JIRA_ACCESS_TOKEN nor JIRA_USERNAME/JIRA_PASSWORD are set.")
Expand Down