airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From san...@apache.org
Subject incubator-airflow git commit: [AIRFLOW-616][AIRFLOW-617] Minor fixes to PR tool UX
Date Fri, 04 Nov 2016 22:43:46 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master 4fb86f920 -> fa977b60a


[AIRFLOW-616][AIRFLOW-617] Minor fixes to PR tool UX

[AIRFLOW-616] Store credentials for life of script

[AIRFLOW-617] Fix redundant prompt text in PR tool

Closes #1868 from jlowin/pr-tool-fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/fa977b60
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/fa977b60
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/fa977b60

Branch: refs/heads/master
Commit: fa977b60ad1c19f7ca139ede6fec9ae11ff8b850
Parents: 4fb86f9
Author: jlowin <jlowin@apache.org>
Authored: Fri Nov 4 15:43:13 2016 -0700
Committer: Siddharth Anand <siddharthanand@yahoo.com>
Committed: Fri Nov 4 15:43:19 2016 -0700

----------------------------------------------------------------------
 dev/airflow-pr | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/fa977b60/dev/airflow-pr
----------------------------------------------------------------------
diff --git a/dev/airflow-pr b/dev/airflow-pr
index 21af558..cf8c0cb 100755
--- a/dev/airflow-pr
+++ b/dev/airflow-pr
@@ -75,6 +75,7 @@ JIRA_API_BASE = "https://issues.apache.org/jira"
 # Prefix added to temporary branches
 BRANCH_PREFIX = "PR_TOOL"
 
+TMP_CREDENTIALS = {}
 
 class PRToolError(Exception):
     pass
@@ -526,9 +527,13 @@ def resolve_jira_issue(comment=None, jira_id=None, merge_branches=None):
         merge_branches = []
 
     # ASF JIRA username
-    JIRA_USERNAME = os.environ.get("JIRA_USERNAME", "")
+    JIRA_USERNAME = os.environ.get("JIRA_USERNAME", '')
+    if not JIRA_USERNAME:
+        JIRA_USERNAME = TMP_CREDENTIALS.get('JIRA_USERNAME', '')
     # ASF JIRA password
-    JIRA_PASSWORD = os.environ.get("JIRA_PASSWORD", "")
+    JIRA_PASSWORD = os.environ.get("JIRA_PASSWORD", '')
+    if not JIRA_PASSWORD:
+        JIRA_PASSWORD = TMP_CREDENTIALS.get('JIRA_PASSWORD', '')
 
     if not JIRA_USERNAME:
         JIRA_USERNAME = click.prompt(
@@ -536,6 +541,7 @@ def resolve_jira_issue(comment=None, jira_id=None, merge_branches=None):
             type=str)
         click.echo(
             'Set a JIRA_USERNAME env var to avoid this prompt in the future.')
+        TMP_CREDENTIALS['JIRA_USERNAME'] = JIRA_USERNAME
     if not JIRA_PASSWORD:
         JIRA_PASSWORD = click.prompt(
             click.style('Password for Airflow JIRA', fg='blue', bold=True),
@@ -543,6 +549,7 @@ def resolve_jira_issue(comment=None, jira_id=None, merge_branches=None):
             hide_input=True)
         click.echo(
             'Set a JIRA_PASSWORD env var to avoid this prompt in the future.')
+        TMP_CREDENTIALS['JIRA_PASSWORD'] = JIRA_PASSWORD
 
     try:
         asf_jira = jira.client.JIRA(
@@ -583,7 +590,7 @@ def resolve_jira_issue(comment=None, jira_id=None, merge_branches=None):
         "summary:\t%s\nassignee:\t%s\nstatus:\t\t%s\nurl:\t\t%s/%s\n" % (
             cur_summary, cur_assignee, cur_status, JIRA_BASE, jira_id))
     if not click.confirm(click.style(
-            'Proceed with AIRFLOW-{}?'.format(jira_id), fg='blue', bold=True)):
+            'Proceed with {}?'.format(jira_id), fg='blue', bold=True)):
         return
 
     if comment is None:


Mime
View raw message