{"action":"created","issue":{"url":"https://api.github.com/repos/smarkets/marge-bot/issues/88","repository_url":"https://api.github.com/repos/smarkets/marge-bot","labels_url":"https://api.github.com/repos/smarkets/marge-bot/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/smarkets/marge-bot/issues/88/comments","events_url":"https://api.github.com/repos/smarkets/marge-bot/issues/88/events","html_url":"https://github.com/smarkets/marge-bot/issues/88","id":301741976,"number":88,"title":"Support of the branch name where merge request should be merged into","user":{"login":"alexandear","id":3228886,"avatar_url":"https://avatars2.githubusercontent.com/u/3228886?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandear","html_url":"https://github.com/alexandear","followers_url":"https://api.github.com/users/alexandear/followers","following_url":"https://api.github.com/users/alexandear/following{/other_user}","gists_url":"https://api.github.com/users/alexandear/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandear/subscriptions","organizations_url":"https://api.github.com/users/alexandear/orgs","repos_url":"https://api.github.com/users/alexandear/repos","events_url":"https://api.github.com/users/alexandear/events{/privacy}","received_events_url":"https://api.github.com/users/alexandear/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-02T11:51:35Z","updated_at":"2018-03-02T16:27:25Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"It does not always merge request should be merged into `master`. E.g., in some git workflows, MR should be merged into `develop` branch. I propose to add configuration parameter `--branch-name-merge-into <string name>` for such situations."},"comment":{"url":"https://api.github.com/repos/smarkets/marge-bot/issues/comments/369972776","html_url":"https://github.com/smarkets/marge-bot/issues/88#issuecomment-369972776","issue_url":"https://api.github.com/repos/smarkets/marge-bot/issues/88","id":369972776,"user":{"login":"alexandear","id":3228886,"avatar_url":"https://avatars2.githubusercontent.com/u/3228886?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandear","html_url":"https://github.com/alexandear","followers_url":"https://api.github.com/users/alexandear/followers","following_url":"https://api.github.com/users/alexandear/following{/other_user}","gists_url":"https://api.github.com/users/alexandear/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandear/subscriptions","organizations_url":"https://api.github.com/users/alexandear/orgs","repos_url":"https://api.github.com/users/alexandear/repos","events_url":"https://api.github.com/users/alexandear/events{/privacy}","received_events_url":"https://api.github.com/users/alexandear/received_events","type":"User","site_admin":false},"created_at":"2018-03-02T16:27:25Z","updated_at":"2018-03-02T16:27:25Z","author_association":"CONTRIBUTOR","body":"Yes, there are two places where `master` is hardcoded:\r\n\r\n```\r\n.git.py\r\n\r\ndef remove_branch(self, branch):\r\n    assert branch != 'master'\r\n    self.git('checkout', 'master', '--')\r\n    self.git('branch', '-D', branch)\r\n```\r\n\r\n```\r\njob.py\r\n\r\nif source_branch != 'master':\r\n    repo.remove_branch(source_branch)\r\nelse:\r\n    assert source_repo_url is not None\r\n```\r\n\r\n### How to reproduce\r\n\r\nCreate MR in GitLab. Target branch is not `master`, e.g. `3.10`.\r\n\r\n![image](https://user-images.githubusercontent.com/3228886/36909419-91593488-1e46-11e8-9b66-2b0660be7d4e.png)\r\n\r\nThen assign MR to Marge Bot.\r\n\r\n### Expected result\r\n\r\nMarge Bot merges source branch into target branch `3.10`.\r\n\r\n### Current result\r\n\r\nException occured:\r\n\r\n```\r\n2018-03-02 18:17:25,096 INFO Running git clone --origin=origin git@gitlab/MessagesTransceiver.git 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1'\r\n2018-03-02 18:18:31,330 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' config user.email marge-bot@example.com\r\n2018-03-02 18:18:31,957 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' config user.name 'Marge Bot'\r\n2018-03-02 18:18:31,981 INFO Processing !8 - 'Remove using namespace'\r\n2018-03-02 18:18:32,188 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' fetch --prune origin\r\n2018-03-02 18:18:35,721 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' checkout -B refactor/removeUsingNamespace origin/refactor/removeUsingNamespace --\r\n2018-03-02 18:18:35,892 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' rebase origin/3.10\r\n2018-03-02 18:18:43,460 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' rev-parse HEAD\r\n2018-03-02 18:18:43,568 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' checkout refactor/removeUsingNamespace --\r\n2018-03-02 18:18:43,596 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' diff-index --quiet HEAD\r\n2018-03-02 18:18:43,628 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' ls-files --others\r\n2018-03-02 18:18:43,740 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' push --force origin refactor/removeUsingNamespace\r\n2018-03-02 18:18:45,010 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' rev-parse origin/3.10\r\n2018-03-02 18:18:45,032 INFO Running git -C 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmp81lxjhwu\\tmp59d9phm1' checkout master --\r\n2018-03-02 18:18:45,071 WARNING git returned 128\r\n2018-03-02 18:18:45,071 WARNING stdout: b''\r\n2018-03-02 18:18:45,071 WARNING stderr: b'fatal: invalid reference: master\\n'\r\n2018-03-02 18:18:45,071 ERROR Unexpected Git error\r\nTraceback (most recent call last):\r\n  File \"C:\\marge-bot\\marge\\git.py\", line 163, in git\r\n    return _run(*command, env=env, check=True, timeout=timeout_seconds)\r\n  File \"C:\\marge-bot\\marge\\git.py\", line 189, in _run\r\n    retcode, process.args, output=stdout, stderr=stderr,\r\nsubprocess.CalledProcessError: Command '('git', '-C', 'C:\\\\Users\\\\ADMINI~1\\\\AppData\\\\Local\\\\Temp\r\n```"}}
{"actor":{"display_login":"alexandear"}}