{"action":"created","issue":{"url":"https://api.github.com/repos/afklm/chef_jira/issues/20","labels_url":"https://api.github.com/repos/afklm/chef_jira/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/afklm/chef_jira/issues/20/comments","events_url":"https://api.github.com/repos/afklm/chef_jira/issues/20/events","html_url":"https://github.com/afklm/chef_jira/pull/20","id":110962080,"number":20,"title":"Get rid of derived attributes","user":{"login":"legal90","id":4846154,"avatar_url":"https://avatars.githubusercontent.com/u/4846154?v=3","gravatar_id":"","url":"https://api.github.com/users/legal90","html_url":"https://github.com/legal90","followers_url":"https://api.github.com/users/legal90/followers","following_url":"https://api.github.com/users/legal90/following{/other_user}","gists_url":"https://api.github.com/users/legal90/gists{/gist_id}","starred_url":"https://api.github.com/users/legal90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legal90/subscriptions","organizations_url":"https://api.github.com/users/legal90/orgs","repos_url":"https://api.github.com/users/legal90/repos","events_url":"https://api.github.com/users/legal90/events{/privacy}","received_events_url":"https://api.github.com/users/legal90/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-12T12:12:45Z","updated_at":"2015-10-12T19:23:53Z","closed_at":"2015-10-12T12:32:10Z","pull_request":{"url":"https://api.github.com/repos/afklm/chef_jira/pulls/20","html_url":"https://github.com/afklm/chef_jira/pull/20","diff_url":"https://github.com/afklm/chef_jira/pull/20.diff","patch_url":"https://github.com/afklm/chef_jira/pull/20.patch"},"body":"Includes PRs from the similar cookbook `confluense`:\r\n* Set version dependent attributes in the separated recipe [https://github.com/bflad/chef-confluence/pull/30]\r\n* Stop storing state in attributes [https://github.com/bflad/chef-confluence/issues/62]\r\n\r\nAttributes, which default value depends on the value of another attribute, should be defined in the recipe or library, but not in attribute file.\r\nOtherwise, it is very hard to override such attributes or wrap this cookbook in another one.\r\n\r\nExample:\r\nAttributes `checksum` and `url` depend on the `version` value. If you want to override `version`, then you should override `checksum` and `url` as well, because their default values are calculated on the step of attribute file parsing, e.q. _before_ `version` value will be explored according to the priority.\r\n\r\nThat's why it's better to move this logic to the library. In this case the value of `version` attribute will be calculated correctly. This is so called \"Derived Attributes\" issue, and you can find more detaled explanation of this problem here: https://coderanger.net/derived-attributes/"},"comment":{"url":"https://api.github.com/repos/afklm/chef_jira/issues/comments/147496676","html_url":"https://github.com/afklm/chef_jira/pull/20#issuecomment-147496676","issue_url":"https://api.github.com/repos/afklm/chef_jira/issues/20","id":147496676,"user":{"login":"patcon","id":305339,"avatar_url":"https://avatars.githubusercontent.com/u/305339?v=3","gravatar_id":"","url":"https://api.github.com/users/patcon","html_url":"https://github.com/patcon","followers_url":"https://api.github.com/users/patcon/followers","following_url":"https://api.github.com/users/patcon/following{/other_user}","gists_url":"https://api.github.com/users/patcon/gists{/gist_id}","starred_url":"https://api.github.com/users/patcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patcon/subscriptions","organizations_url":"https://api.github.com/users/patcon/orgs","repos_url":"https://api.github.com/users/patcon/repos","events_url":"https://api.github.com/users/patcon/events{/privacy}","received_events_url":"https://api.github.com/users/patcon/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T19:23:53Z","updated_at":"2015-10-12T19:23:53Z","body":"thanks @legal90! I was procrastinating on this one"}}