{"action":"opened","number":22,"pull_request":{"url":"https://api.github.com/repos/bflad/chef-jira/pulls/22","id":47169775,"html_url":"https://github.com/bflad/chef-jira/pull/22","diff_url":"https://github.com/bflad/chef-jira/pull/22.diff","patch_url":"https://github.com/bflad/chef-jira/pull/22.patch","issue_url":"https://api.github.com/repos/bflad/chef-jira/issues/22","number":22,"state":"open","locked":false,"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},"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/\r\n\r\n/cc: @bflad ","created_at":"2015-10-08T15:43:29Z","updated_at":"2015-10-08T15:43:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bflad/chef-jira/pulls/22/commits","review_comments_url":"https://api.github.com/repos/bflad/chef-jira/pulls/22/comments","review_comment_url":"https://api.github.com/repos/bflad/chef-jira/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bflad/chef-jira/issues/22/comments","statuses_url":"https://api.github.com/repos/bflad/chef-jira/statuses/44dea2c669fce7f6548bc7be9170332388dc5917","head":{"label":"legal90:f-derived-attrs","ref":"f-derived-attrs","sha":"44dea2c669fce7f6548bc7be9170332388dc5917","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},"repo":{"id":43893406,"name":"chef-jira","full_name":"legal90/chef-jira","owner":{"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},"private":false,"html_url":"https://github.com/legal90/chef-jira","description":"Chef Cookbook for Atlassian Jira","fork":true,"url":"https://api.github.com/repos/legal90/chef-jira","forks_url":"https://api.github.com/repos/legal90/chef-jira/forks","keys_url":"https://api.github.com/repos/legal90/chef-jira/keys{/key_id}","collaborators_url":"https://api.github.com/repos/legal90/chef-jira/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/legal90/chef-jira/teams","hooks_url":"https://api.github.com/repos/legal90/chef-jira/hooks","issue_events_url":"https://api.github.com/repos/legal90/chef-jira/issues/events{/number}","events_url":"https://api.github.com/repos/legal90/chef-jira/events","assignees_url":"https://api.github.com/repos/legal90/chef-jira/assignees{/user}","branches_url":"https://api.github.com/repos/legal90/chef-jira/branches{/branch}","tags_url":"https://api.github.com/repos/legal90/chef-jira/tags","blobs_url":"https://api.github.com/repos/legal90/chef-jira/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/legal90/chef-jira/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/legal90/chef-jira/git/refs{/sha}","trees_url":"https://api.github.com/repos/legal90/chef-jira/git/trees{/sha}","statuses_url":"https://api.github.com/repos/legal90/chef-jira/statuses/{sha}","languages_url":"https://api.github.com/repos/legal90/chef-jira/languages","stargazers_url":"https://api.github.com/repos/legal90/chef-jira/stargazers","contributors_url":"https://api.github.com/repos/legal90/chef-jira/contributors","subscribers_url":"https://api.github.com/repos/legal90/chef-jira/subscribers","subscription_url":"https://api.github.com/repos/legal90/chef-jira/subscription","commits_url":"https://api.github.com/repos/legal90/chef-jira/commits{/sha}","git_commits_url":"https://api.github.com/repos/legal90/chef-jira/git/commits{/sha}","comments_url":"https://api.github.com/repos/legal90/chef-jira/comments{/number}","issue_comment_url":"https://api.github.com/repos/legal90/chef-jira/issues/comments{/number}","contents_url":"https://api.github.com/repos/legal90/chef-jira/contents/{+path}","compare_url":"https://api.github.com/repos/legal90/chef-jira/compare/{base}...{head}","merges_url":"https://api.github.com/repos/legal90/chef-jira/merges","archive_url":"https://api.github.com/repos/legal90/chef-jira/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/legal90/chef-jira/downloads","issues_url":"https://api.github.com/repos/legal90/chef-jira/issues{/number}","pulls_url":"https://api.github.com/repos/legal90/chef-jira/pulls{/number}","milestones_url":"https://api.github.com/repos/legal90/chef-jira/milestones{/number}","notifications_url":"https://api.github.com/repos/legal90/chef-jira/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/legal90/chef-jira/labels{/name}","releases_url":"https://api.github.com/repos/legal90/chef-jira/releases{/id}","created_at":"2015-10-08T14:18:07Z","updated_at":"2015-10-08T14:18:08Z","pushed_at":"2015-10-08T15:39:34Z","git_url":"git://github.com/legal90/chef-jira.git","ssh_url":"git@github.com:legal90/chef-jira.git","clone_url":"https://github.com/legal90/chef-jira.git","svn_url":"https://github.com/legal90/chef-jira","homepage":null,"size":652,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"bflad:master","ref":"master","sha":"da71ddbf910ff78e94e342babf996d0e9c78dab0","user":{"login":"bflad","id":189114,"avatar_url":"https://avatars.githubusercontent.com/u/189114?v=3","gravatar_id":"","url":"https://api.github.com/users/bflad","html_url":"https://github.com/bflad","followers_url":"https://api.github.com/users/bflad/followers","following_url":"https://api.github.com/users/bflad/following{/other_user}","gists_url":"https://api.github.com/users/bflad/gists{/gist_id}","starred_url":"https://api.github.com/users/bflad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bflad/subscriptions","organizations_url":"https://api.github.com/users/bflad/orgs","repos_url":"https://api.github.com/users/bflad/repos","events_url":"https://api.github.com/users/bflad/events{/privacy}","received_events_url":"https://api.github.com/users/bflad/received_events","type":"User","site_admin":false},"repo":{"id":6552351,"name":"chef-jira","full_name":"bflad/chef-jira","owner":{"login":"bflad","id":189114,"avatar_url":"https://avatars.githubusercontent.com/u/189114?v=3","gravatar_id":"","url":"https://api.github.com/users/bflad","html_url":"https://github.com/bflad","followers_url":"https://api.github.com/users/bflad/followers","following_url":"https://api.github.com/users/bflad/following{/other_user}","gists_url":"https://api.github.com/users/bflad/gists{/gist_id}","starred_url":"https://api.github.com/users/bflad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bflad/subscriptions","organizations_url":"https://api.github.com/users/bflad/orgs","repos_url":"https://api.github.com/users/bflad/repos","events_url":"https://api.github.com/users/bflad/events{/privacy}","received_events_url":"https://api.github.com/users/bflad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bflad/chef-jira","description":"Chef Cookbook for Atlassian Jira","fork":false,"url":"https://api.github.com/repos/bflad/chef-jira","forks_url":"https://api.github.com/repos/bflad/chef-jira/forks","keys_url":"https://api.github.com/repos/bflad/chef-jira/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bflad/chef-jira/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bflad/chef-jira/teams","hooks_url":"https://api.github.com/repos/bflad/chef-jira/hooks","issue_events_url":"https://api.github.com/repos/bflad/chef-jira/issues/events{/number}","events_url":"https://api.github.com/repos/bflad/chef-jira/events","assignees_url":"https://api.github.com/repos/bflad/chef-jira/assignees{/user}","branches_url":"https://api.github.com/repos/bflad/chef-jira/branches{/branch}","tags_url":"https://api.github.com/repos/bflad/chef-jira/tags","blobs_url":"https://api.github.com/repos/bflad/chef-jira/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bflad/chef-jira/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bflad/chef-jira/git/refs{/sha}","trees_url":"https://api.github.com/repos/bflad/chef-jira/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bflad/chef-jira/statuses/{sha}","languages_url":"https://api.github.com/repos/bflad/chef-jira/languages","stargazers_url":"https://api.github.com/repos/bflad/chef-jira/stargazers","contributors_url":"https://api.github.com/repos/bflad/chef-jira/contributors","subscribers_url":"https://api.github.com/repos/bflad/chef-jira/subscribers","subscription_url":"https://api.github.com/repos/bflad/chef-jira/subscription","commits_url":"https://api.github.com/repos/bflad/chef-jira/commits{/sha}","git_commits_url":"https://api.github.com/repos/bflad/chef-jira/git/commits{/sha}","comments_url":"https://api.github.com/repos/bflad/chef-jira/comments{/number}","issue_comment_url":"https://api.github.com/repos/bflad/chef-jira/issues/comments{/number}","contents_url":"https://api.github.com/repos/bflad/chef-jira/contents/{+path}","compare_url":"https://api.github.com/repos/bflad/chef-jira/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bflad/chef-jira/merges","archive_url":"https://api.github.com/repos/bflad/chef-jira/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bflad/chef-jira/downloads","issues_url":"https://api.github.com/repos/bflad/chef-jira/issues{/number}","pulls_url":"https://api.github.com/repos/bflad/chef-jira/pulls{/number}","milestones_url":"https://api.github.com/repos/bflad/chef-jira/milestones{/number}","notifications_url":"https://api.github.com/repos/bflad/chef-jira/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bflad/chef-jira/labels{/name}","releases_url":"https://api.github.com/repos/bflad/chef-jira/releases{/id}","created_at":"2012-11-05T21:51:18Z","updated_at":"2015-09-26T04:02:53Z","pushed_at":"2015-09-10T15:25:44Z","git_url":"git://github.com/bflad/chef-jira.git","ssh_url":"git@github.com:bflad/chef-jira.git","clone_url":"https://github.com/bflad/chef-jira.git","svn_url":"https://github.com/bflad/chef-jira","homepage":null,"size":652,"stargazers_count":39,"watchers_count":39,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":13,"forks":33,"open_issues":13,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bflad/chef-jira/pulls/22"},"html":{"href":"https://github.com/bflad/chef-jira/pull/22"},"issue":{"href":"https://api.github.com/repos/bflad/chef-jira/issues/22"},"comments":{"href":"https://api.github.com/repos/bflad/chef-jira/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/bflad/chef-jira/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/bflad/chef-jira/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bflad/chef-jira/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/bflad/chef-jira/statuses/44dea2c669fce7f6548bc7be9170332388dc5917"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":151,"deletions":147,"changed_files":5}}