alamb opened a new pull request #9598:
URL: https://github.com/apache/arrow/pull/9598


   # Rationale
   Currently all contributors are required to make a JIRA account and do some 
mechanical JIRA creation to create well formed Arrow PRs. This is mindless work 
and people who are used to it may forget the barrier it imposes on casual 
contributions and burden on maintainers to keep JIRA synced. 
   
   Here is a good example of such a PR where we almost lost a potential 
contributor:  https://github.com/apache/arrow/pull/9576#issuecomment-786827957 
(and despite @pierwill and I both working for InfluxData I swear I didn't put 
him up to this :) )
   
   More discussion can be found on this [mailing list 
thread](https://lists.apache.org/thread.html/rd4533c7f882adbfc51061aceafebe8d84ea194fa5108d6cebc3621e1%40%3Cdev.arrow.apache.org%3E)
   
   # Changes
   
   This PR modifies the `merge_pr.py to offer to create a JIRA and link it back 
to github if a pre-existing JIRA can not be found. For the existing workflow 
where the PR title contains the appropriate JIRA reference, there is no change. 
With this change, devs / maintainers would only have to ensure the title of PRs 
started with the correct components, and JIRAs could be automatically created, 
if they so desire
   
   The script requires `ARROW_GITHUB_API_TOKEN` to have been set to some token 
that has the ability to update PR descriptions.
   
   # Current behavior
   If `merge_pr.py` is invoked on a PR without a JIRA ticket reference the 
following error occurs
   
   ```
   (arrow_dev) alamb@MacBook-Pro:~/Software/arrow2/rust$ 
../dev/merge_arrow_pr.py 9594
   ARROW_HOME = /Users/alamb/Software/arrow2/dev
   PROJECT_NAME = arrow
   Restoring head pointer to 0f647261
   Note: switching to '0f647261'.
   ...
   
   HEAD is now at 0f6472610 ARROW-11778: [Rust] Cast from LargeUtf8 to 
Numerical and temporal types
   Traceback (most recent call last):
     File "/Users/alamb/Software/arrow2/rust/../dev/merge_arrow_pr.py", line 
597, in <module>
       cli()
     File "/Users/alamb/Software/arrow2/rust/../dev/merge_arrow_pr.py", line 
566, in cli
       pr = PullRequest(cmd, github_api, PR_REMOTE_NAME, jira_con, pr_num)
     File "/Users/alamb/Software/arrow2/rust/../dev/merge_arrow_pr.py", line 
309, in __init__
       self.jira_issue = self._get_jira()
     File "/Users/alamb/Software/arrow2/rust/../dev/merge_arrow_pr.py", line 
336, in _get_jira
       self.cmd.fail("PR title should be prefixed by a jira id "
     File "/Users/alamb/Software/arrow2/rust/../dev/merge_arrow_pr.py", line 
270, in fail
       raise Exception(msg)
   Exception: PR title should be prefixed by a jira id ARROW-XXX or 
PARQUET-XXX, but found [Rust] Add link to the doc
   ```
   
   # New Behavior
   
   With the changes in this PR, the maintainer is prompted to optionally create 
the JIRA ticket:
   
   ```
   (arrow_dev) alamb@ip-10-0-0-49:~/Software/arrow2$ ./dev/merge_arrow_pr.py 
9594
   ARROW_HOME = /Users/alamb/Software/arrow2/dev
   PROJECT_NAME = arrow
   No JIRA link found
     Looked for PR title prefixed by ARROW-XXX or PARQUET-XXX
   === NEW JIRA ===
   Summary              [Rust] Add link to the doc
   Assignee     NONE
   Components   Rust
   Status               New
   
   Create JIRA and link to PR? (y/n): y
     Created ARROW-11818
   
   === Pull Request #9594 ===
   title        ARROW-11818: [Rust] Add link to the doc
   source       alamb/alamb/test_change
   target       master
   url  https://api.github.com/repos/apache/arrow/pulls/9594
   === JIRA ARROW-11818 ===
   Summary              [Rust] Add link to the doc
   Assignee     NOT ASSIGNED!!!
   Components   Rust
   Status               Open
   URL          https://issues.apache.org/jira/browse/ARROW-11818
   
   Proceed with merging pull request #9594? (y/n):
   ...
   ```
   
   # Follow on Work
   
   1. If this script is accepted, I would like to file a ticket to  improve the 
wording of the message left by the JIRA bot 
[example](https://github.com/apache/arrow/pull/9594#issuecomment-787052762) to 
make it clear that the creation of a JIRA account + ticket is not required 
(though perhaps still encouraged for large changes)
   
   2. Add additional mappings from PR description to components (I only added 
the ones I use and a few others to prove out the idea)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to