{"action":"opened","number":284,"pull_request":{"url":"https://api.github.com/repos/SpongePowered/Sponge/pulls/284","id":36462357,"html_url":"https://github.com/SpongePowered/Sponge/pull/284","diff_url":"https://github.com/SpongePowered/Sponge/pull/284.diff","patch_url":"https://github.com/SpongePowered/Sponge/pull/284.patch","issue_url":"https://api.github.com/repos/SpongePowered/Sponge/issues/284","number":284,"state":"open","locked":false,"title":"Add constraints to @Overwrite methods in mixins","user":{"login":"Mumfrey","id":1147071,"avatar_url":"https://avatars.githubusercontent.com/u/1147071?v=3","gravatar_id":"","url":"https://api.github.com/users/Mumfrey","html_url":"https://github.com/Mumfrey","followers_url":"https://api.github.com/users/Mumfrey/followers","following_url":"https://api.github.com/users/Mumfrey/following{/other_user}","gists_url":"https://api.github.com/users/Mumfrey/gists{/gist_id}","starred_url":"https://api.github.com/users/Mumfrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mumfrey/subscriptions","organizations_url":"https://api.github.com/users/Mumfrey/orgs","repos_url":"https://api.github.com/users/Mumfrey/repos","events_url":"https://api.github.com/users/Mumfrey/events{/privacy}","received_events_url":"https://api.github.com/users/Mumfrey/received_events","type":"User","site_admin":false},"body":"I'm pull-requesting this rather than committing directly because I'd like to get some feedback on the constraint ranges I've added here.\r\n\r\nIn a nutshell, constraints allow hard failures to be raised at both build and run time which have particular purposes:\r\n\r\n* Forces us to keep on top of `@Overwrite` methods when bumping forge versions. Having a hard declaration on the annotation means that a contract is baked directly into the code which says \"this overwrite is valid for this version and, say, the next 10 versions\".\r\n\r\n* Causes a hard crash when a user tries to run the coremod in a version of Forge which is just too far away from the version we built against for comfort. Basically we want to avoid the scenario where something is patched/fixed/improved in Forge, and our boistrous coremod comes along and just blithely overwrites the new stuff.\r\n\r\nThus the overwrite constraints aren't hard-and-fast, they're going to depend - on a per-method basis - on the anticipated volatility of the method in question, both in terms of how severe our changes are, and how often we anticipate the target method itself will change. Given we may know about the future (if working against an older forge version like we are right now, then we can even impose a hard upper bound on overwrites when we know the build number of a future breaking change).\r\n\r\nConstraints use a pretty straightforward syntax, for a quick into consult the [Constraint javadoc](http://jenkins.liteloader.com/job/Mixin/javadoc/org/spongepowered/asm/util/ConstraintParser.Constraint.html) which gives a bunch of examples.\r\n\r\nFor the constraints defined here, I've gone with a pretty straightforward approach of `1371+` (meaning 1371 and any later version) where I feel it's safe to do so. `1371 +10` for particularly hairy bits of code, and longer constraints varying between 50 and 100 for less critical bits of code which should nevertheless be periodically reviewed.\r\n\r\nI suggest we make it a policy to never author a **new** constraint with a version lower than the version we're building against, but can feel free to let constraints trail a little bit when bumping forge versions depending on anticipated code volatility.\r\n\r\nWelcome feedback and suggested adjustments to these values. I should mention that I [already committed](https://github.com/SpongePowered/Sponge/commit/d0e57450bdaa510c5c476bfc52f9dc7744d682b1) changes which provide a nice user-facing message when a constraint violation is encountered, which tells the user exactly what happens and suggests remedial actions.","created_at":"2015-05-28T23:47:52Z","updated_at":"2015-05-28T23:47:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SpongePowered/Sponge/pulls/284/commits","review_comments_url":"https://api.github.com/repos/SpongePowered/Sponge/pulls/284/comments","review_comment_url":"https://api.github.com/repos/SpongePowered/Sponge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpongePowered/Sponge/issues/284/comments","statuses_url":"https://api.github.com/repos/SpongePowered/Sponge/statuses/ed7da0430474da23316db95535e7b206b4305270","head":{"label":"SpongePowered:feature/overwrite_constraints","ref":"feature/overwrite_constraints","sha":"ed7da0430474da23316db95535e7b206b4305270","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":23774298,"name":"Sponge","full_name":"SpongePowered/Sponge","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/Sponge","description":"A Forge mod that implements SpongeAPI","fork":false,"url":"https://api.github.com/repos/SpongePowered/Sponge","forks_url":"https://api.github.com/repos/SpongePowered/Sponge/forks","keys_url":"https://api.github.com/repos/SpongePowered/Sponge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/Sponge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/Sponge/teams","hooks_url":"https://api.github.com/repos/SpongePowered/Sponge/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/Sponge/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/Sponge/events","assignees_url":"https://api.github.com/repos/SpongePowered/Sponge/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/Sponge/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/Sponge/tags","blobs_url":"https://api.github.com/repos/SpongePowered/Sponge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/Sponge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/Sponge/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/Sponge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/Sponge/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/Sponge/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/Sponge/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/Sponge/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/Sponge/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/Sponge/subscription","commits_url":"https://api.github.com/repos/SpongePowered/Sponge/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/Sponge/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/Sponge/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/Sponge/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/Sponge/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/Sponge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/Sponge/merges","archive_url":"https://api.github.com/repos/SpongePowered/Sponge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/Sponge/downloads","issues_url":"https://api.github.com/repos/SpongePowered/Sponge/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/Sponge/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/Sponge/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/Sponge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/Sponge/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/Sponge/releases{/id}","created_at":"2014-09-08T00:01:33Z","updated_at":"2015-05-28T13:28:20Z","pushed_at":"2015-05-28T23:32:17Z","git_url":"git://github.com/SpongePowered/Sponge.git","ssh_url":"git@github.com:SpongePowered/Sponge.git","clone_url":"https://github.com/SpongePowered/Sponge.git","svn_url":"https://github.com/SpongePowered/Sponge","homepage":"http://www.spongepowered.org/","size":14780,"stargazers_count":798,"watchers_count":798,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":341,"mirror_url":null,"open_issues_count":25,"forks":341,"open_issues":25,"watchers":798,"default_branch":"master"}},"base":{"label":"SpongePowered:master","ref":"master","sha":"d0e57450bdaa510c5c476bfc52f9dc7744d682b1","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":23774298,"name":"Sponge","full_name":"SpongePowered/Sponge","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/Sponge","description":"A Forge mod that implements SpongeAPI","fork":false,"url":"https://api.github.com/repos/SpongePowered/Sponge","forks_url":"https://api.github.com/repos/SpongePowered/Sponge/forks","keys_url":"https://api.github.com/repos/SpongePowered/Sponge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/Sponge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/Sponge/teams","hooks_url":"https://api.github.com/repos/SpongePowered/Sponge/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/Sponge/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/Sponge/events","assignees_url":"https://api.github.com/repos/SpongePowered/Sponge/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/Sponge/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/Sponge/tags","blobs_url":"https://api.github.com/repos/SpongePowered/Sponge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/Sponge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/Sponge/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/Sponge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/Sponge/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/Sponge/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/Sponge/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/Sponge/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/Sponge/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/Sponge/subscription","commits_url":"https://api.github.com/repos/SpongePowered/Sponge/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/Sponge/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/Sponge/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/Sponge/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/Sponge/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/Sponge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/Sponge/merges","archive_url":"https://api.github.com/repos/SpongePowered/Sponge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/Sponge/downloads","issues_url":"https://api.github.com/repos/SpongePowered/Sponge/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/Sponge/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/Sponge/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/Sponge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/Sponge/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/Sponge/releases{/id}","created_at":"2014-09-08T00:01:33Z","updated_at":"2015-05-28T13:28:20Z","pushed_at":"2015-05-28T23:32:17Z","git_url":"git://github.com/SpongePowered/Sponge.git","ssh_url":"git@github.com:SpongePowered/Sponge.git","clone_url":"https://github.com/SpongePowered/Sponge.git","svn_url":"https://github.com/SpongePowered/Sponge","homepage":"http://www.spongepowered.org/","size":14780,"stargazers_count":798,"watchers_count":798,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":341,"mirror_url":null,"open_issues_count":25,"forks":341,"open_issues":25,"watchers":798,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/Sponge/pulls/284"},"html":{"href":"https://github.com/SpongePowered/Sponge/pull/284"},"issue":{"href":"https://api.github.com/repos/SpongePowered/Sponge/issues/284"},"comments":{"href":"https://api.github.com/repos/SpongePowered/Sponge/issues/284/comments"},"review_comments":{"href":"https://api.github.com/repos/SpongePowered/Sponge/pulls/284/comments"},"review_comment":{"href":"https://api.github.com/repos/SpongePowered/Sponge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpongePowered/Sponge/pulls/284/commits"},"statuses":{"href":"https://api.github.com/repos/SpongePowered/Sponge/statuses/ed7da0430474da23316db95535e7b206b4305270"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":20,"deletions":16,"changed_files":8}}