{"action":"created","comment":{"url":"https://api.github.com/repos/gocd/gocd/pulls/comments/26638603","id":26638603,"diff_hunk":"@@ -164,7 +168,11 @@ private void validateStageNameUniqueness() {\n \n     private void validateLabelTemplate() {\n         if (XmlUtils.doesNotMatchUsingXsdRegex(LABEL_TEMPLATE_FORMAT_REGEX, labelTemplate)) {\n-            addError(\"labelTemplate\", \"Invalid label. Label should be composed of alphanumeric text, it should contain material revision or ${COUNT}, or use params as #{<param-name>}.\");\n+            addError(\"labelTemplate\",","path":"config/config-api/src/com/thoughtworks/go/config/PipelineConfig.java","position":27,"original_position":27,"commit_id":"bf94e39f958e36cf7639c6ffc82efd104738c720","original_commit_id":"91cb99046faa04dce9678ef6a4e8fb752e702b44","user":{"login":"srinivasupadhya","id":1587661,"avatar_url":"https://avatars.githubusercontent.com/u/1587661?v=3","gravatar_id":"","url":"https://api.github.com/users/srinivasupadhya","html_url":"https://github.com/srinivasupadhya","followers_url":"https://api.github.com/users/srinivasupadhya/followers","following_url":"https://api.github.com/users/srinivasupadhya/following{/other_user}","gists_url":"https://api.github.com/users/srinivasupadhya/gists{/gist_id}","starred_url":"https://api.github.com/users/srinivasupadhya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srinivasupadhya/subscriptions","organizations_url":"https://api.github.com/users/srinivasupadhya/orgs","repos_url":"https://api.github.com/users/srinivasupadhya/repos","events_url":"https://api.github.com/users/srinivasupadhya/events{/privacy}","received_events_url":"https://api.github.com/users/srinivasupadhya/received_events","type":"User","site_admin":false},"body":"could be help text [here](https://github.com/gocd/gocd/blob/master/server/webapp/WEB-INF/rails.new/app/views/admin/pipelines/general.html.erb#L16)?","created_at":"2015-03-18T05:10:45Z","updated_at":"2015-03-18T05:10:45Z","html_url":"https://github.com/gocd/gocd/pull/947#discussion_r26638603","pull_request_url":"https://api.github.com/repos/gocd/gocd/pulls/947","_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments/26638603"},"html":{"href":"https://github.com/gocd/gocd/pull/947#discussion_r26638603"},"pull_request":{"href":"https://api.github.com/repos/gocd/gocd/pulls/947"}}},"pull_request":{"url":"https://api.github.com/repos/gocd/gocd/pulls/947","id":30996433,"html_url":"https://github.com/gocd/gocd/pull/947","diff_url":"https://github.com/gocd/gocd/pull/947.diff","patch_url":"https://github.com/gocd/gocd/pull/947.patch","issue_url":"https://api.github.com/repos/gocd/gocd/issues/947","number":947,"state":"open","locked":false,"title":"Fix for #101 (short git rev)","user":{"login":"alexschwartz","id":307101,"avatar_url":"https://avatars.githubusercontent.com/u/307101?v=3","gravatar_id":"","url":"https://api.github.com/users/alexschwartz","html_url":"https://github.com/alexschwartz","followers_url":"https://api.github.com/users/alexschwartz/followers","following_url":"https://api.github.com/users/alexschwartz/following{/other_user}","gists_url":"https://api.github.com/users/alexschwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/alexschwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexschwartz/subscriptions","organizations_url":"https://api.github.com/users/alexschwartz/orgs","repos_url":"https://api.github.com/users/alexschwartz/repos","events_url":"https://api.github.com/users/alexschwartz/events{/privacy}","received_events_url":"https://api.github.com/users/alexschwartz/received_events","type":"User","site_admin":false},"body":"## Implementation for #101 - Support for short git hash\r\n\r\nAs discussed in issue #101 and on the dev list (https://groups.google.com/forum/#!topic/go-cd-dev/ZfHNkoumdB0) I implemented support for the following syntax:\r\n\r\n  `pipelineLabel = \"${COUNT}-${git[:7]}\"`\r\n\r\nThis would truncate the material revision of the material names 'git' such that the first 7 characters are used in the label.\r\n\r\nAs pointed out by @paulclarkin the short git hash sum can be shorter than 7 character:\r\n> Note, the Git short hash isn't just the long hash sliced, it attempts to be unique.\r\n> See https://www.kernel.org/pub/software/scm/git/docs/git-rev-parse.html under --short.\r\n> The length of the short hash can vary as git tries to find a unique hash that's as short as possible.\r\n>> Instead of outputting the full SHA1 values of object names try to abbreviate them to a shorter unique name. When no length is specified 7 is used. The minimum length is 4.\r\n\r\nFrom my point of the view the truncation is valid to be used in pipeline labels.\r\n\r\n\r\n##### Implementation details\r\nMost of the logic that was changed is in [PipelineLabel.java](config/config-api/src/com/thoughtworks/go/domain/label/PipelineLabel.java).\r\nIt is worth to point out that there was a need to change regular expressions in three independent files:\r\n  * config/config-api/src/com/thoughtworks/go/domain/label/PipelineLabel.java\r\n  * config/config-api/src/com/thoughtworks/go/config/PipelineConfig.java\r\n  * config/config-server/resources/cruise-config.xsd\r\n\r\n##### TODOs left\r\n* Adapt documentation\r\n","created_at":"2015-03-11T23:41:53Z","updated_at":"2015-03-18T05:10:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df93ef1b613066b6bd17dc74d26424eb75e5f715","assignee":{"login":"srinivasupadhya","id":1587661,"avatar_url":"https://avatars.githubusercontent.com/u/1587661?v=3","gravatar_id":"","url":"https://api.github.com/users/srinivasupadhya","html_url":"https://github.com/srinivasupadhya","followers_url":"https://api.github.com/users/srinivasupadhya/followers","following_url":"https://api.github.com/users/srinivasupadhya/following{/other_user}","gists_url":"https://api.github.com/users/srinivasupadhya/gists{/gist_id}","starred_url":"https://api.github.com/users/srinivasupadhya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srinivasupadhya/subscriptions","organizations_url":"https://api.github.com/users/srinivasupadhya/orgs","repos_url":"https://api.github.com/users/srinivasupadhya/repos","events_url":"https://api.github.com/users/srinivasupadhya/events{/privacy}","received_events_url":"https://api.github.com/users/srinivasupadhya/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/gocd/gocd/pulls/947/commits","review_comments_url":"https://api.github.com/repos/gocd/gocd/pulls/947/comments","review_comment_url":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/947/comments","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/bf94e39f958e36cf7639c6ffc82efd104738c720","head":{"label":"alexschwartz:feat_101_short_gitrev__rebased","ref":"feat_101_short_gitrev__rebased","sha":"bf94e39f958e36cf7639c6ffc82efd104738c720","user":{"login":"alexschwartz","id":307101,"avatar_url":"https://avatars.githubusercontent.com/u/307101?v=3","gravatar_id":"","url":"https://api.github.com/users/alexschwartz","html_url":"https://github.com/alexschwartz","followers_url":"https://api.github.com/users/alexschwartz/followers","following_url":"https://api.github.com/users/alexschwartz/following{/other_user}","gists_url":"https://api.github.com/users/alexschwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/alexschwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexschwartz/subscriptions","organizations_url":"https://api.github.com/users/alexschwartz/orgs","repos_url":"https://api.github.com/users/alexschwartz/repos","events_url":"https://api.github.com/users/alexschwartz/events{/privacy}","received_events_url":"https://api.github.com/users/alexschwartz/received_events","type":"User","site_admin":false},"repo":{"id":19112928,"name":"gocd","full_name":"alexschwartz/gocd","owner":{"login":"alexschwartz","id":307101,"avatar_url":"https://avatars.githubusercontent.com/u/307101?v=3","gravatar_id":"","url":"https://api.github.com/users/alexschwartz","html_url":"https://github.com/alexschwartz","followers_url":"https://api.github.com/users/alexschwartz/followers","following_url":"https://api.github.com/users/alexschwartz/following{/other_user}","gists_url":"https://api.github.com/users/alexschwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/alexschwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexschwartz/subscriptions","organizations_url":"https://api.github.com/users/alexschwartz/orgs","repos_url":"https://api.github.com/users/alexschwartz/repos","events_url":"https://api.github.com/users/alexschwartz/events{/privacy}","received_events_url":"https://api.github.com/users/alexschwartz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexschwartz/gocd","description":"Main repository for Go Continuous Delivery","fork":true,"url":"https://api.github.com/repos/alexschwartz/gocd","forks_url":"https://api.github.com/repos/alexschwartz/gocd/forks","keys_url":"https://api.github.com/repos/alexschwartz/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexschwartz/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexschwartz/gocd/teams","hooks_url":"https://api.github.com/repos/alexschwartz/gocd/hooks","issue_events_url":"https://api.github.com/repos/alexschwartz/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/alexschwartz/gocd/events","assignees_url":"https://api.github.com/repos/alexschwartz/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/alexschwartz/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/alexschwartz/gocd/tags","blobs_url":"https://api.github.com/repos/alexschwartz/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexschwartz/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexschwartz/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexschwartz/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexschwartz/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/alexschwartz/gocd/languages","stargazers_url":"https://api.github.com/repos/alexschwartz/gocd/stargazers","contributors_url":"https://api.github.com/repos/alexschwartz/gocd/contributors","subscribers_url":"https://api.github.com/repos/alexschwartz/gocd/subscribers","subscription_url":"https://api.github.com/repos/alexschwartz/gocd/subscription","commits_url":"https://api.github.com/repos/alexschwartz/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexschwartz/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexschwartz/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexschwartz/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexschwartz/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/alexschwartz/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexschwartz/gocd/merges","archive_url":"https://api.github.com/repos/alexschwartz/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexschwartz/gocd/downloads","issues_url":"https://api.github.com/repos/alexschwartz/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/alexschwartz/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/alexschwartz/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/alexschwartz/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexschwartz/gocd/labels{/name}","releases_url":"https://api.github.com/repos/alexschwartz/gocd/releases{/id}","created_at":"2014-04-24T15:06:44Z","updated_at":"2015-03-11T23:21:29Z","pushed_at":"2015-03-16T17:17:32Z","git_url":"git://github.com/alexschwartz/gocd.git","ssh_url":"git@github.com:alexschwartz/gocd.git","clone_url":"https://github.com/alexschwartz/gocd.git","svn_url":"https://github.com/alexschwartz/gocd","homepage":null,"size":198674,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gocd:master","ref":"master","sha":"db70c652aa38048a2b0c500b67e96ed6e2cf39da","user":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"repo":{"id":15155534,"name":"gocd","full_name":"gocd/gocd","owner":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gocd/gocd","description":"Main repository for Go Continuous Delivery","fork":false,"url":"https://api.github.com/repos/gocd/gocd","forks_url":"https://api.github.com/repos/gocd/gocd/forks","keys_url":"https://api.github.com/repos/gocd/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gocd/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gocd/gocd/teams","hooks_url":"https://api.github.com/repos/gocd/gocd/hooks","issue_events_url":"https://api.github.com/repos/gocd/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/gocd/gocd/events","assignees_url":"https://api.github.com/repos/gocd/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/gocd/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/gocd/gocd/tags","blobs_url":"https://api.github.com/repos/gocd/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gocd/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gocd/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/gocd/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/gocd/gocd/languages","stargazers_url":"https://api.github.com/repos/gocd/gocd/stargazers","contributors_url":"https://api.github.com/repos/gocd/gocd/contributors","subscribers_url":"https://api.github.com/repos/gocd/gocd/subscribers","subscription_url":"https://api.github.com/repos/gocd/gocd/subscription","commits_url":"https://api.github.com/repos/gocd/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/gocd/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/gocd/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/gocd/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/gocd/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/gocd/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gocd/gocd/merges","archive_url":"https://api.github.com/repos/gocd/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gocd/gocd/downloads","issues_url":"https://api.github.com/repos/gocd/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/gocd/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/gocd/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/gocd/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gocd/gocd/labels{/name}","releases_url":"https://api.github.com/repos/gocd/gocd/releases{/id}","created_at":"2013-12-13T05:26:16Z","updated_at":"2015-03-18T03:52:17Z","pushed_at":"2015-03-17T19:59:49Z","git_url":"git://github.com/gocd/gocd.git","ssh_url":"git@github.com:gocd/gocd.git","clone_url":"https://github.com/gocd/gocd.git","svn_url":"https://github.com/gocd/gocd","homepage":null,"size":242436,"stargazers_count":1351,"watchers_count":1351,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":226,"mirror_url":null,"open_issues_count":371,"forks":226,"open_issues":371,"watchers":1351,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/947"},"html":{"href":"https://github.com/gocd/gocd/pull/947"},"issue":{"href":"https://api.github.com/repos/gocd/gocd/issues/947"},"comments":{"href":"https://api.github.com/repos/gocd/gocd/issues/947/comments"},"review_comments":{"href":"https://api.github.com/repos/gocd/gocd/pulls/947/comments"},"review_comment":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gocd/gocd/pulls/947/commits"},"statuses":{"href":"https://api.github.com/repos/gocd/gocd/statuses/bf94e39f958e36cf7639c6ffc82efd104738c720"}}}}