{"action":"created","issue":{"url":"https://api.github.com/repos/chain/chain/issues/184","repository_url":"https://api.github.com/repos/chain/chain","labels_url":"https://api.github.com/repos/chain/chain/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/chain/chain/issues/184/comments","events_url":"https://api.github.com/repos/chain/chain/issues/184/events","html_url":"https://github.com/chain/chain/pull/184","id":188655738,"number":184,"title":"cored: add release version to compile","user":{"login":"jeffomatic","id":464857,"avatar_url":"https://avatars.githubusercontent.com/u/464857?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffomatic","html_url":"https://github.com/jeffomatic","followers_url":"https://api.github.com/users/jeffomatic/followers","following_url":"https://api.github.com/users/jeffomatic/following{/other_user}","gists_url":"https://api.github.com/users/jeffomatic/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffomatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffomatic/subscriptions","organizations_url":"https://api.github.com/users/jeffomatic/orgs","repos_url":"https://api.github.com/users/jeffomatic/repos","events_url":"https://api.github.com/users/jeffomatic/events{/privacy}","received_events_url":"https://api.github.com/users/jeffomatic/received_events","type":"User","site_admin":false},"labels":[{"id":467470339,"url":"https://api.github.com/repos/chain/chain/labels/PTAL","name":"PTAL","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-11T00:26:53Z","updated_at":"2016-11-11T01:01:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chain/chain/pulls/184","html_url":"https://github.com/chain/chain/pull/184","diff_url":"https://github.com/chain/chain/pull/184.diff","patch_url":"https://github.com/chain/chain/pull/184.patch"},"body":"This commit proposes a method for including version information into the\r\ncored binary.\r\n\r\nA new global constant, \"version\", is present in the cored executable.\r\nIt is returned by the /info endpoint.\r\n\r\nWhen we have decided that the main branch contains the features and\r\nbugfixes sufficient for a new release, we add a new commit that updates\r\nthe version constant. Initially, the version will be set to \"?\", but we\r\nshould schedule an uptick to 1.0.1 as soon as possible.\r\n\r\nFor posterity, we will also annotate this commit with the git tag\r\n\"cmd/cored-<VERSION>\". (If we want a nice, public UI to navigate the\r\nrelease history, we might consider using GitHub's releases feature to\r\nperform the tagging).\r\n\r\nWhen preparing new installers, we can refer back to these tags to get a\r\nprecise state of the repository.\r\n\r\nWorth noting: the version constant is useful for tagging public releases\r\nand communicating with outside users. However, it is not very useful for\r\nour internal development process, since the value of the version\r\nconstant will change infrequently. In these cases, other means of\r\ncommunicating the source version (such as the buildcommit expvar, or the\r\nlocal HEAD ref) should be used."},"comment":{"url":"https://api.github.com/repos/chain/chain/issues/comments/259853646","html_url":"https://github.com/chain/chain/pull/184#issuecomment-259853646","issue_url":"https://api.github.com/repos/chain/chain/issues/184","id":259853646,"user":{"login":"jeffomatic","id":464857,"avatar_url":"https://avatars.githubusercontent.com/u/464857?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffomatic","html_url":"https://github.com/jeffomatic","followers_url":"https://api.github.com/users/jeffomatic/followers","following_url":"https://api.github.com/users/jeffomatic/following{/other_user}","gists_url":"https://api.github.com/users/jeffomatic/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffomatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffomatic/subscriptions","organizations_url":"https://api.github.com/users/jeffomatic/orgs","repos_url":"https://api.github.com/users/jeffomatic/repos","events_url":"https://api.github.com/users/jeffomatic/events{/privacy}","received_events_url":"https://api.github.com/users/jeffomatic/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T01:01:36Z","updated_at":"2016-11-11T01:01:36Z","body":"> The only thing that's not great about this is that, as you point out, during our own devleopment process the version string will be wrong almost always. That's why we were inserting the build tag during linking, so that a simple go install would not pick up a stale value.\r\n\r\nRight, I see that. So the original workflow would be that we rely fully on tagging to track our version history (as opposed to packing the version data into the commits themselves). The build scripts for our installers would do something like:\r\n\r\n```\r\ngit checkout $VERSION\r\ncommit=`git rev-parse HEAD`\r\ndate=`date +%s`\r\nldflags=\"-X main.buildTag=$VERSION -X main.buildCommit=$commit -X main.buildDate=$date\"\r\ngo build -ldflags ldflags ...\r\n```\r\n\r\nI'm down with changing fewer things if what we've got provides this mechanism already. How would you feel about simply renaming \"buildTag\" to \"version\" or \"buildVersion\", so there is more alignment to how the value will be presented to users?"}}
{"actor":{"display_login":"jeffomatic"}}