{"action":"closed","number":711,"pull_request":{"url":"https://api.github.com/repos/lerna/lerna/pulls/711","id":112067450,"html_url":"https://github.com/lerna/lerna/pull/711","diff_url":"https://github.com/lerna/lerna/pull/711.diff","patch_url":"https://github.com/lerna/lerna/pull/711.patch","issue_url":"https://api.github.com/repos/lerna/lerna/issues/711","number":711,"state":"closed","locked":false,"title":"Do not reject detached HEAD when publishing a canary release","user":{"login":"evocateur","id":5605,"avatar_url":"https://avatars0.githubusercontent.com/u/5605?v=3","gravatar_id":"","url":"https://api.github.com/users/evocateur","html_url":"https://github.com/evocateur","followers_url":"https://api.github.com/users/evocateur/followers","following_url":"https://api.github.com/users/evocateur/following{/other_user}","gists_url":"https://api.github.com/users/evocateur/gists{/gist_id}","starred_url":"https://api.github.com/users/evocateur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evocateur/subscriptions","organizations_url":"https://api.github.com/users/evocateur/orgs","repos_url":"https://api.github.com/users/evocateur/repos","events_url":"https://api.github.com/users/evocateur/events{/privacy}","received_events_url":"https://api.github.com/users/evocateur/received_events","type":"User","site_admin":false},"body":"## Motivation and Context\r\nTo facilitate `--canary` publishes in CI, we shouldn't break `lerna publish` when it detects a detached `HEAD` when canary is enabled. We also need to avoid calling `git symbolic-ref` because it breaks in detached `HEAD` situations (which is going to be the case for a vast majority of CI environments). I renamed the `GitUtilities` method `isDetachedHead()` to better express its intent.\r\n\r\nI've also clarified some of the internal flag parsing, creating a new `gitEnabled` instance property that better describes the intent behind `!(this.flags.canary || this.flags.skipGit)`. I was able to simplify some of the conditionals as a result.\r\n\r\nThis fixes #699 \r\n\r\n## How Has This Been Tested?\r\nI reordered the appropriate `ChildProcessUtilities.execSync` stubs, and added a new test for a complicated set of configuration to improve coverage.\r\n\r\n## Types of changes\r\n- [x] Bug fix (non-breaking change which fixes an issue)\r\n\r\n## Checklist:\r\n- [x] My code follows the code style of this project.\r\n- [x] I have read the **CONTRIBUTING** document.\r\n- [x] I have added tests to cover my changes.\r\n- [x] All new and existing tests passed.\r\n","created_at":"2017-03-22T17:30:21Z","updated_at":"2017-03-22T17:57:03Z","closed_at":"2017-03-22T17:57:03Z","merged_at":"2017-03-22T17:57:03Z","merge_commit_sha":"e4b74a63b87cab618d1ae9256d1186104977d6ac","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/lerna/lerna/milestones/1","html_url":"https://github.com/lerna/lerna/milestone/1","labels_url":"https://api.github.com/repos/lerna/lerna/milestones/1/labels","id":2308392,"number":1,"title":"v2.0.0","description":"Release the beta for realsies!","creator":{"login":"doug-wade","id":3477707,"avatar_url":"https://avatars1.githubusercontent.com/u/3477707?v=3","gravatar_id":"","url":"https://api.github.com/users/doug-wade","html_url":"https://github.com/doug-wade","followers_url":"https://api.github.com/users/doug-wade/followers","following_url":"https://api.github.com/users/doug-wade/following{/other_user}","gists_url":"https://api.github.com/users/doug-wade/gists{/gist_id}","starred_url":"https://api.github.com/users/doug-wade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doug-wade/subscriptions","organizations_url":"https://api.github.com/users/doug-wade/orgs","repos_url":"https://api.github.com/users/doug-wade/repos","events_url":"https://api.github.com/users/doug-wade/events{/privacy}","received_events_url":"https://api.github.com/users/doug-wade/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":19,"state":"open","created_at":"2017-02-08T01:37:17Z","updated_at":"2017-03-22T17:57:03Z","due_on":"2017-03-17T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/lerna/lerna/pulls/711/commits","review_comments_url":"https://api.github.com/repos/lerna/lerna/pulls/711/comments","review_comment_url":"https://api.github.com/repos/lerna/lerna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lerna/lerna/issues/711/comments","statuses_url":"https://api.github.com/repos/lerna/lerna/statuses/d708102562979b5fbb5f36983f739312155d7846","head":{"label":"evocateur:relax-git-during-canary","ref":"relax-git-during-canary","sha":"d708102562979b5fbb5f36983f739312155d7846","user":{"login":"evocateur","id":5605,"avatar_url":"https://avatars0.githubusercontent.com/u/5605?v=3","gravatar_id":"","url":"https://api.github.com/users/evocateur","html_url":"https://github.com/evocateur","followers_url":"https://api.github.com/users/evocateur/followers","following_url":"https://api.github.com/users/evocateur/following{/other_user}","gists_url":"https://api.github.com/users/evocateur/gists{/gist_id}","starred_url":"https://api.github.com/users/evocateur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evocateur/subscriptions","organizations_url":"https://api.github.com/users/evocateur/orgs","repos_url":"https://api.github.com/users/evocateur/repos","events_url":"https://api.github.com/users/evocateur/events{/privacy}","received_events_url":"https://api.github.com/users/evocateur/received_events","type":"User","site_admin":false},"repo":{"id":52026918,"name":"lerna","full_name":"evocateur/lerna","owner":{"login":"evocateur","id":5605,"avatar_url":"https://avatars0.githubusercontent.com/u/5605?v=3","gravatar_id":"","url":"https://api.github.com/users/evocateur","html_url":"https://github.com/evocateur","followers_url":"https://api.github.com/users/evocateur/followers","following_url":"https://api.github.com/users/evocateur/following{/other_user}","gists_url":"https://api.github.com/users/evocateur/gists{/gist_id}","starred_url":"https://api.github.com/users/evocateur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evocateur/subscriptions","organizations_url":"https://api.github.com/users/evocateur/orgs","repos_url":"https://api.github.com/users/evocateur/repos","events_url":"https://api.github.com/users/evocateur/events{/privacy}","received_events_url":"https://api.github.com/users/evocateur/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/evocateur/lerna","description":":dragon: A tool for managing JavaScript projects with multiple packages.","fork":true,"url":"https://api.github.com/repos/evocateur/lerna","forks_url":"https://api.github.com/repos/evocateur/lerna/forks","keys_url":"https://api.github.com/repos/evocateur/lerna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evocateur/lerna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evocateur/lerna/teams","hooks_url":"https://api.github.com/repos/evocateur/lerna/hooks","issue_events_url":"https://api.github.com/repos/evocateur/lerna/issues/events{/number}","events_url":"https://api.github.com/repos/evocateur/lerna/events","assignees_url":"https://api.github.com/repos/evocateur/lerna/assignees{/user}","branches_url":"https://api.github.com/repos/evocateur/lerna/branches{/branch}","tags_url":"https://api.github.com/repos/evocateur/lerna/tags","blobs_url":"https://api.github.com/repos/evocateur/lerna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evocateur/lerna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evocateur/lerna/git/refs{/sha}","trees_url":"https://api.github.com/repos/evocateur/lerna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evocateur/lerna/statuses/{sha}","languages_url":"https://api.github.com/repos/evocateur/lerna/languages","stargazers_url":"https://api.github.com/repos/evocateur/lerna/stargazers","contributors_url":"https://api.github.com/repos/evocateur/lerna/contributors","subscribers_url":"https://api.github.com/repos/evocateur/lerna/subscribers","subscription_url":"https://api.github.com/repos/evocateur/lerna/subscription","commits_url":"https://api.github.com/repos/evocateur/lerna/commits{/sha}","git_commits_url":"https://api.github.com/repos/evocateur/lerna/git/commits{/sha}","comments_url":"https://api.github.com/repos/evocateur/lerna/comments{/number}","issue_comment_url":"https://api.github.com/repos/evocateur/lerna/issues/comments{/number}","contents_url":"https://api.github.com/repos/evocateur/lerna/contents/{+path}","compare_url":"https://api.github.com/repos/evocateur/lerna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evocateur/lerna/merges","archive_url":"https://api.github.com/repos/evocateur/lerna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evocateur/lerna/downloads","issues_url":"https://api.github.com/repos/evocateur/lerna/issues{/number}","pulls_url":"https://api.github.com/repos/evocateur/lerna/pulls{/number}","milestones_url":"https://api.github.com/repos/evocateur/lerna/milestones{/number}","notifications_url":"https://api.github.com/repos/evocateur/lerna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evocateur/lerna/labels{/name}","releases_url":"https://api.github.com/repos/evocateur/lerna/releases{/id}","deployments_url":"https://api.github.com/repos/evocateur/lerna/deployments","created_at":"2016-02-18T17:56:20Z","updated_at":"2016-02-18T17:56:21Z","pushed_at":"2017-03-22T17:19:13Z","git_url":"git://github.com/evocateur/lerna.git","ssh_url":"git@github.com:evocateur/lerna.git","clone_url":"https://github.com/evocateur/lerna.git","svn_url":"https://github.com/evocateur/lerna","homepage":"","size":872,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lerna:master","ref":"master","sha":"203f7eb11cdda8b7c7d7a8420113f36cbbbf5011","user":{"login":"lerna","id":19333396,"avatar_url":"https://avatars1.githubusercontent.com/u/19333396?v=3","gravatar_id":"","url":"https://api.github.com/users/lerna","html_url":"https://github.com/lerna","followers_url":"https://api.github.com/users/lerna/followers","following_url":"https://api.github.com/users/lerna/following{/other_user}","gists_url":"https://api.github.com/users/lerna/gists{/gist_id}","starred_url":"https://api.github.com/users/lerna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lerna/subscriptions","organizations_url":"https://api.github.com/users/lerna/orgs","repos_url":"https://api.github.com/users/lerna/repos","events_url":"https://api.github.com/users/lerna/events{/privacy}","received_events_url":"https://api.github.com/users/lerna/received_events","type":"Organization","site_admin":false},"repo":{"id":47394776,"name":"lerna","full_name":"lerna/lerna","owner":{"login":"lerna","id":19333396,"avatar_url":"https://avatars1.githubusercontent.com/u/19333396?v=3","gravatar_id":"","url":"https://api.github.com/users/lerna","html_url":"https://github.com/lerna","followers_url":"https://api.github.com/users/lerna/followers","following_url":"https://api.github.com/users/lerna/following{/other_user}","gists_url":"https://api.github.com/users/lerna/gists{/gist_id}","starred_url":"https://api.github.com/users/lerna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lerna/subscriptions","organizations_url":"https://api.github.com/users/lerna/orgs","repos_url":"https://api.github.com/users/lerna/repos","events_url":"https://api.github.com/users/lerna/events{/privacy}","received_events_url":"https://api.github.com/users/lerna/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lerna/lerna","description":":dragon: A tool for managing JavaScript projects with multiple packages.","fork":false,"url":"https://api.github.com/repos/lerna/lerna","forks_url":"https://api.github.com/repos/lerna/lerna/forks","keys_url":"https://api.github.com/repos/lerna/lerna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lerna/lerna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lerna/lerna/teams","hooks_url":"https://api.github.com/repos/lerna/lerna/hooks","issue_events_url":"https://api.github.com/repos/lerna/lerna/issues/events{/number}","events_url":"https://api.github.com/repos/lerna/lerna/events","assignees_url":"https://api.github.com/repos/lerna/lerna/assignees{/user}","branches_url":"https://api.github.com/repos/lerna/lerna/branches{/branch}","tags_url":"https://api.github.com/repos/lerna/lerna/tags","blobs_url":"https://api.github.com/repos/lerna/lerna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lerna/lerna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lerna/lerna/git/refs{/sha}","trees_url":"https://api.github.com/repos/lerna/lerna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lerna/lerna/statuses/{sha}","languages_url":"https://api.github.com/repos/lerna/lerna/languages","stargazers_url":"https://api.github.com/repos/lerna/lerna/stargazers","contributors_url":"https://api.github.com/repos/lerna/lerna/contributors","subscribers_url":"https://api.github.com/repos/lerna/lerna/subscribers","subscription_url":"https://api.github.com/repos/lerna/lerna/subscription","commits_url":"https://api.github.com/repos/lerna/lerna/commits{/sha}","git_commits_url":"https://api.github.com/repos/lerna/lerna/git/commits{/sha}","comments_url":"https://api.github.com/repos/lerna/lerna/comments{/number}","issue_comment_url":"https://api.github.com/repos/lerna/lerna/issues/comments{/number}","contents_url":"https://api.github.com/repos/lerna/lerna/contents/{+path}","compare_url":"https://api.github.com/repos/lerna/lerna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lerna/lerna/merges","archive_url":"https://api.github.com/repos/lerna/lerna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lerna/lerna/downloads","issues_url":"https://api.github.com/repos/lerna/lerna/issues{/number}","pulls_url":"https://api.github.com/repos/lerna/lerna/pulls{/number}","milestones_url":"https://api.github.com/repos/lerna/lerna/milestones{/number}","notifications_url":"https://api.github.com/repos/lerna/lerna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lerna/lerna/labels{/name}","releases_url":"https://api.github.com/repos/lerna/lerna/releases{/id}","deployments_url":"https://api.github.com/repos/lerna/lerna/deployments","created_at":"2015-12-04T09:36:55Z","updated_at":"2017-03-22T14:43:25Z","pushed_at":"2017-03-22T17:57:03Z","git_url":"git://github.com/lerna/lerna.git","ssh_url":"git@github.com:lerna/lerna.git","clone_url":"https://github.com/lerna/lerna.git","svn_url":"https://github.com/lerna/lerna","homepage":"https://lernajs.io","size":922,"stargazers_count":3715,"watchers_count":3715,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":237,"mirror_url":null,"open_issues_count":160,"forks":237,"open_issues":160,"watchers":3715,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lerna/lerna/pulls/711"},"html":{"href":"https://github.com/lerna/lerna/pull/711"},"issue":{"href":"https://api.github.com/repos/lerna/lerna/issues/711"},"comments":{"href":"https://api.github.com/repos/lerna/lerna/issues/711/comments"},"review_comments":{"href":"https://api.github.com/repos/lerna/lerna/pulls/711/comments"},"review_comment":{"href":"https://api.github.com/repos/lerna/lerna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lerna/lerna/pulls/711/commits"},"statuses":{"href":"https://api.github.com/repos/lerna/lerna/statuses/d708102562979b5fbb5f36983f739312155d7846"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"evocateur","id":5605,"avatar_url":"https://avatars0.githubusercontent.com/u/5605?v=3","gravatar_id":"","url":"https://api.github.com/users/evocateur","html_url":"https://github.com/evocateur","followers_url":"https://api.github.com/users/evocateur/followers","following_url":"https://api.github.com/users/evocateur/following{/other_user}","gists_url":"https://api.github.com/users/evocateur/gists{/gist_id}","starred_url":"https://api.github.com/users/evocateur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evocateur/subscriptions","organizations_url":"https://api.github.com/users/evocateur/orgs","repos_url":"https://api.github.com/users/evocateur/repos","events_url":"https://api.github.com/users/evocateur/events{/privacy}","received_events_url":"https://api.github.com/users/evocateur/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":185,"deletions":76,"changed_files":5}}
{"actor":{"display_login":"evocateur"}}