Skip to content

[SPARK-28354][INFRA] Use JIRA user name instead of JIRA user key - #25120

Closed
dongjoon-hyun wants to merge 1 commit into
apache:masterfrom
dongjoon-hyun:SPARK-28354
Closed

[SPARK-28354][INFRA] Use JIRA user name instead of JIRA user key#25120
dongjoon-hyun wants to merge 1 commit into
apache:masterfrom
dongjoon-hyun:SPARK-28354

Conversation

@dongjoon-hyun

@dongjoon-hyundongjoon-hyun commented Jul 11, 2019

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

dev/merge_spark_pr.py script always fail for some users because they have different name and key.

JIRA Client expects name, but we are using key. This PR fixes it.

# This is JIRA client code `/usr/local/lib/python2.7/site-packages/jira/client.py`defassign_issue(self, issue, assignee):
"""Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic. :param issue: the issue ID or key to assign :param assignee: the user to assign the issue to :type issue: int or str :type assignee: str :rtype: bool """url=self._options['server'] + \
'/rest/api/latest/issue/'+str(issue) +'/assignee'payload= {'name': assignee}
r=self._session.put(
url, data=json.dumps(payload))
raise_on_error(r)
returnTrue

How was this patch tested?

Manual with the committer ID/password.

importjira.clientasf_jira=jira.client.JIRA({'server': 'https://issues.apache.org/jira'}, basic_auth=('yourid', 'passwd'))
asf_jira.assign_issue("SPARK-28354", "q79969786") # This will raise exception.asf_jira.assign_issue("SPARK-28354", "yumwang") # This works.

@dongjoon-hyun

Copy link
Copy Markdown
MemberAuthor

cc @squito , @vanzin , @srowen

@SparkQA

Copy link
Copy Markdown

Test build #107553 has finished for PR 25120 at commit f6c0137.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun

Copy link
Copy Markdown
MemberAuthor

Retest this please.

@srowen

Copy link
Copy Markdown
Member

Sure, if it works better that's good. I consistently get a failure when assigning JIRAs to Yuming Wang -- have you seen that too? maybe this fixes it.

@dongjoon-hyun

dongjoon-hyun commented Jul 12, 2019

Copy link
Copy Markdown
MemberAuthor

Yes. Right. That's the exact reason for this fix. I also hit the failures during merging his PRs. :D

@SparkQA

Copy link
Copy Markdown

Test build #107556 has finished for PR 25120 at commit f6c0137.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon

Copy link
Copy Markdown
Member

Yea .. get the failure to Yuming Wang too ..

@HyukjinKwon

Copy link
Copy Markdown
Member

@wangyum, this PR is for you. hahaha

@HyukjinKwon

Copy link
Copy Markdown
Member

Merged to master.

@wangyum

Copy link
Copy Markdown
Member

Thank you @dongjoon-hyun@srowen@HyukjinKwon

@dongjoon-hyun

Copy link
Copy Markdown
MemberAuthor

Thank you all!

@dongjoon-hyun
dongjoon-hyun deleted the SPARK-28354 branch July 12, 2019 13:57
vinodkc pushed a commit to vinodkc/spark that referenced this pull request Jul 18, 2019
## What changes were proposed in this pull request?
`dev/merge_spark_pr.py` script always fail for some users because they have different `name` and `key`.
- https://issues.apache.org/jira/rest/api/2/user?username=yumwang
JIRA Client expects `name`, but we are using `key`. This PR fixes it.
```python
# This is JIRA client code `/usr/local/lib/python2.7/site-packages/jira/client.py`
def assign_issue(self, issue, assignee):
"""Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic.
:param issue: the issue ID or key to assign
:param assignee: the user to assign the issue to
:type issue: int or str
:type assignee: str
:rtype: bool
"""
url = self._options['server'] + \
'/rest/api/latest/issue/' + str(issue) + '/assignee'
payload = {'name': assignee}
r = self._session.put(
url, data=json.dumps(payload))
raise_on_error(r)
return True
```
## How was this patch tested?
Manual with the committer ID/password.
```python
import jira.client
asf_jira = jira.client.JIRA({'server': 'https://issues.apache.org/jira'}, basic_auth=('yourid', 'passwd'))
asf_jira.assign_issue("SPARK-28354", "q79969786") # This will raise exception.
asf_jira.assign_issue("SPARK-28354", "yumwang") # This works.
```
Closesapache#25120 from dongjoon-hyun/SPARK-28354.
Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@dongjoon-hyun@SparkQA@srowen@HyukjinKwon@wangyum