When issues are closed by a commit, the status should be set to "Fixed in Code Base" instead of the general "Closed" status.
This is gonna mean figuring out if the issue/pull webhook payloads send some kind of data to flag this. Otherwise we're going to have to get creative.
The only other thing I can think of for that then is listening for the push
API event and trying to match things up.
Here is closing push payload. The only connection with issues is commit message. We can in fact parse it for keywords like close
and fix
and get issue number also as it always comes with #
. Not sure about this.
{
"ref": "refs/heads/master",
"before": "dd78cdb9abf0d3cdd2d350e3512b2e117038cf4a",
"after": "bf69fe881af2c063fb9ae8305ce7bf1acde2d658",
"created": false,
"deleted": false,
"forced": false,
"base_ref": null,
"compare": "https://github.com/b2z/jissues-test/compare/dd78cdb9abf0...bf69fe881af2",
"commits": [
{
"id": "bf69fe881af2c063fb9ae8305ce7bf1acde2d658",
"distinct": true,
"message": "Close #2",
"timestamp": "2015-07-09T21:39:10+03:00",
"url": "https://github.com/b2z/jissues-test/commit/bf69fe881af2c063fb9ae8305ce7bf1acde2d658",
"author": {
"name": "Dmitry Rekun",
"email": "bzzjuka [ at ] gmail.com",
"username": "b2z"
},
"committer": {
"name": "Dmitry Rekun",
"email": "bzzjuka [ at ] gmail.com",
"username": "b2z"
},
"added": [
],
"removed": [
],
"modified": [
"README.md"
]
}
],
"head_commit": {
"id": "bf69fe881af2c063fb9ae8305ce7bf1acde2d658",
"distinct": true,
"message": "Close #2",
"timestamp": "2015-07-09T21:39:10+03:00",
"url": "https://github.com/b2z/jissues-test/commit/bf69fe881af2c063fb9ae8305ce7bf1acde2d658",
"author": {
"name": "Dmitry Rekun",
"email": "bzzjuka [ at ] gmail.com",
"username": "b2z"
},
"committer": {
"name": "Dmitry Rekun",
"email": "bzzjuka [ at ] gmail.com",
"username": "b2z"
},
"added": [
],
"removed": [
],
"modified": [
"README.md"
]
},
"repository": {
"id": 35725598,
"name": "jissues-test",
"full_name": "b2z/jissues-test",
"owner": {
"name": "b2z",
"email": "bzzjuka [ at ] gmail.com"
},
"private": false,
"html_url": "https://github.com/b2z/jissues-test",
"description": "Joomla! Issue Tracker Application testing repo",
"fork": false,
"url": "https://github.com/b2z/jissues-test",
"forks_url": "https://api.github.com/repos/b2z/jissues-test/forks",
"keys_url": "https://api.github.com/repos/b2z/jissues-test/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/b2z/jissues-test/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/b2z/jissues-test/teams",
"hooks_url": "https://api.github.com/repos/b2z/jissues-test/hooks",
"issue_events_url": "https://api.github.com/repos/b2z/jissues-test/issues/events{/number}",
"events_url": "https://api.github.com/repos/b2z/jissues-test/events",
"assignees_url": "https://api.github.com/repos/b2z/jissues-test/assignees{/user}",
"branches_url": "https://api.github.com/repos/b2z/jissues-test/branches{/branch}",
"tags_url": "https://api.github.com/repos/b2z/jissues-test/tags",
"blobs_url": "https://api.github.com/repos/b2z/jissues-test/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/b2z/jissues-test/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/b2z/jissues-test/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/b2z/jissues-test/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/b2z/jissues-test/statuses/{sha}",
"languages_url": "https://api.github.com/repos/b2z/jissues-test/languages",
"stargazers_url": "https://api.github.com/repos/b2z/jissues-test/stargazers",
"contributors_url": "https://api.github.com/repos/b2z/jissues-test/contributors",
"subscribers_url": "https://api.github.com/repos/b2z/jissues-test/subscribers",
"subscription_url": "https://api.github.com/repos/b2z/jissues-test/subscription",
"commits_url": "https://api.github.com/repos/b2z/jissues-test/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/b2z/jissues-test/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/b2z/jissues-test/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/b2z/jissues-test/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/b2z/jissues-test/contents/{+path}",
"compare_url": "https://api.github.com/repos/b2z/jissues-test/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/b2z/jissues-test/merges",
"archive_url": "https://api.github.com/repos/b2z/jissues-test/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/b2z/jissues-test/downloads",
"issues_url": "https://api.github.com/repos/b2z/jissues-test/issues{/number}",
"pulls_url": "https://api.github.com/repos/b2z/jissues-test/pulls{/number}",
"milestones_url": "https://api.github.com/repos/b2z/jissues-test/milestones{/number}",
"notifications_url": "https://api.github.com/repos/b2z/jissues-test/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/b2z/jissues-test/labels{/name}",
"releases_url": "https://api.github.com/repos/b2z/jissues-test/releases{/id}",
"created_at": 1431784423,
"updated_at": "2015-05-16T13:54:17Z",
"pushed_at": 1436467159,
"git_url": "git://github.com/b2z/jissues-test.git",
"ssh_url": "git@github.com:b2z/jissues-test.git",
"clone_url": "https://github.com/b2z/jissues-test.git",
"svn_url": "https://github.com/b2z/jissues-test",
"homepage": null,
"size": 285,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_downloads": true,
"has_wiki": false,
"has_pages": false,
"forks_count": 1,
"mirror_url": null,
"open_issues_count": 18,
"forks": 1,
"open_issues": 18,
"watchers": 0,
"default_branch": "master",
"stargazers": 0,
"master_branch": "master"
},
"pusher": {
"name": "b2z",
"email": "bzzjuka [ at ] gmail.com"
},
"sender": {
"login": "b2z",
"id": 3051676,
"avatar_url": "https://avatars.githubusercontent.com/u/3051676?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/b2z",
"html_url": "https://github.com/b2z",
"followers_url": "https://api.github.com/users/b2z/followers",
"following_url": "https://api.github.com/users/b2z/following{/other_user}",
"gists_url": "https://api.github.com/users/b2z/gists{/gist_id}",
"starred_url": "https://api.github.com/users/b2z/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/b2z/subscriptions",
"organizations_url": "https://api.github.com/users/b2z/orgs",
"repos_url": "https://api.github.com/users/b2z/repos",
"events_url": "https://api.github.com/users/b2z/events{/privacy}",
"received_events_url": "https://api.github.com/users/b2z/received_events",
"type": "User",
"site_admin": false
}
}
Geeze, they really don't make it easy to link a closed issue to a commit that closed it.
True
Labels |
Added:
enhancement
|
Considering I'm finally getting most of the charts working, figuring out something to do with this is going to be beneficial at some point as one of the charts displays a count of items closed by fixing them. I still have no idea what that something is (maybe it really does end up turning into parsing commit messages, yuck).
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-20 15:51:06 |
Closed_By | ⇒ | mbabker |
Just made a test. Here is the payload data. Seems that nothing there :(
b2z/jissues-test#1