Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-6178

[Developer] Don't fail in merge script on bad primary author input in multi-author PRs

    XMLWordPrintableJSON

Details

    Description

      I was going on autopilot in a multi-author PR and this happened

      Switched to branch 'PR_TOOL_MERGE_PR_5000_MASTER'
      Automatic merge went well; stopped before committing as requested
      Author 1: François Saint-Jacques <fsaintjacques@gmail.com>
      Author 2: Wes McKinney <wesm+git@apache.org>
      Enter primary author in the format of "name <email>" [François Saint-Jacques <fsaintjacques@gmail.com>]: y
      fatal: --author '"y"' is not 'Name <email>' and matches no existing author
      Command failed: ['git', 'commit', '--no-verify', '--author="y"', '-m', 'ARROW-6121: [Tools] Improve merge tool ergonomics', '-m', '- merge_arrow_pr.py now accepts the pull-request number as a single optional argument, e.g. `./merge_arrow_pr.py 4921`.\r\n- merge_arrow_pr.py can optionally read a configuration file located in   `~/.config/arrow/merge.conf` which contains options like jira credentials. See the `dev/merge.conf` file as example', '-m', 'Closes #5000 from fsaintjacques/ARROW-6121-merge-ergonomic and squashes the following commits:', '-m', '5298308d7 <Wes McKinney> Handle username/password separately (in case username is set but not password)\n581653735 <François Saint-Jacques> Rename merge.conf to merge.conf.sample\n7c51ca8f0 <François Saint-Jacques> Add license to config file\n1213946bd <François Saint-Jacques> ARROW-6121:  Improve merge tool ergonomics', '-m', 'Lead-authored-by: y\nCo-authored-by: François Saint-Jacques <fsaintjacques@gmail.com>\nCo-authored-by: Wes McKinney <wesm+git@apache.org>\nSigned-off-by: Wes McKinney <wesm+git@apache.org>']
      With output:
      --------------
      b''
      --------------
      Traceback (most recent call last):
        File "dev/merge_arrow_pr.py", line 530, in <module>
          if pr.is_merged:
        File "dev/merge_arrow_pr.py", line 515, in cli
          PROJECT_NAME = os.environ.get('ARROW_PROJECT_NAME') or 'arrow'
        File "dev/merge_arrow_pr.py", line 420, in merge
          '--author="%s"' % primary_author] +
        File "dev/merge_arrow_pr.py", line 89, in run_cmd
          print('--------------')
        File "dev/merge_arrow_pr.py", line 81, in run_cmd
          try:
        File "/home/wesm/miniconda/envs/arrow-3.7/lib/python3.7/subprocess.py", line 395, in check_output
          **kwargs).stdout
        File "/home/wesm/miniconda/envs/arrow-3.7/lib/python3.7/subprocess.py", line 487, in run
          output=stdout, stderr=stderr)
      

      If the input does not match the expected format, we should loop to request input again rather than failing out (which requires messy manual cleanup of temporary branches)

      Attachments

        Issue Links

          Activity

            People

              wesm Wes McKinney
              wesm Wes McKinney
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m