H4M5TER / milestone-backlog

MIT License
0 stars 1 forks source link

Feature: automatically add closed issue to backlog and milestone #2

Open shigma opened 2 years ago

shigma commented 2 years ago

When an existing issue is automatically closed due to a commit, add it to the current backlog and milestone.

"Current" refers to the smallest milestone greater than the latest release.

H4M5TER commented 2 years ago

Any idea about knowing if the issue is closed by commit? It's discriminated on the web but there seems no relating events or data. image

H4M5TER commented 2 years ago

The context is all the same.

commit closed context ```json { "payload": { "action": "closed", "issue": { "active_lock_reason": null, "assignee": null, "assignees": [], "author_association": "OWNER", "body": "123", "closed_at": null, "comments": 0, "comments_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/1/comments", "created_at": "2022-05-05T19:18:52Z", "events_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/1/events", "html_url": "https://github.com/H4M5TER/actions-playground/issues/1", "id": 1227081380, "labels": [ { "color": "EFF0B0", "default": false, "description": "", "id": 4102588359, "name": "test", "node_id": "LA_kwDOHScIJs70iIfH", "url": "https://api.github.com/repos/H4M5TER/actions-playground/labels/test" } ], "labels_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/1/labels{/name}", "locked": false, "milestone": { "closed_at": null, "closed_issues": 0, "created_at": "2022-05-05T19:19:20Z", "creator": { "avatar_url": "https://avatars.githubusercontent.com/u/21092951?v=4", "events_url": "https://api.github.com/users/H4M5TER/events{/privacy}", "followers_url": "https://api.github.com/users/H4M5TER/followers", "following_url": "https://api.github.com/users/H4M5TER/following{/other_user}", "gists_url": "https://api.github.com/users/H4M5TER/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/H4M5TER", "id": 21092951, "login": "H4M5TER", "node_id": "MDQ6VXNlcjIxMDkyOTUx", "organizations_url": "https://api.github.com/users/H4M5TER/orgs", "received_events_url": "https://api.github.com/users/H4M5TER/received_events", "repos_url": "https://api.github.com/users/H4M5TER/repos", "site_admin": false, "starred_url": "https://api.github.com/users/H4M5TER/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/H4M5TER/subscriptions", "type": "User", "url": "https://api.github.com/users/H4M5TER" }, "description": "", "due_on": null, "html_url": "https://github.com/H4M5TER/actions-playground/milestone/1", "id": 7948119, "labels_url": "https://api.github.com/repos/H4M5TER/actions-playground/milestones/1/labels", "node_id": "MI_kwDOHScIJs4AeUdX", "number": 1, "open_issues": 4, "state": "open", "title": "test milestone", "updated_at": "2022-05-18T14:45:35Z", "url": "https://api.github.com/repos/H4M5TER/actions-playground/milestones/1" }, "node_id": "I_kwDOHScIJs5JI8ak", "number": 1, "performed_via_github_app": null, "reactions": { "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/1/reactions" }, "repository_url": "https://api.github.com/repos/H4M5TER/actions-playground", "state": "open", "timeline_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/1/timeline", "title": "test issue", "updated_at": "2022-05-16T15:57:43Z", "url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/1", "user": { "avatar_url": "https://avatars.githubusercontent.com/u/21092951?v=4", "events_url": "https://api.github.com/users/H4M5TER/events{/privacy}", "followers_url": "https://api.github.com/users/H4M5TER/followers", "following_url": "https://api.github.com/users/H4M5TER/following{/other_user}", "gists_url": "https://api.github.com/users/H4M5TER/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/H4M5TER", "id": 21092951, "login": "H4M5TER", "node_id": "MDQ6VXNlcjIxMDkyOTUx", "organizations_url": "https://api.github.com/users/H4M5TER/orgs", "received_events_url": "https://api.github.com/users/H4M5TER/received_events", "repos_url": "https://api.github.com/users/H4M5TER/repos", "site_admin": false, "starred_url": "https://api.github.com/users/H4M5TER/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/H4M5TER/subscriptions", "type": "User", "url": "https://api.github.com/users/H4M5TER" } }, "repository": { "allow_forking": true, "archive_url": "https://api.github.com/repos/H4M5TER/actions-playground/{archive_format}{/ref}", "archived": false, "assignees_url": "https://api.github.com/repos/H4M5TER/actions-playground/assignees{/user}", "blobs_url": "https://api.github.com/repos/H4M5TER/actions-playground/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/H4M5TER/actions-playground/branches{/branch}", "clone_url": "https://github.com/H4M5TER/actions-playground.git", "collaborators_url": "https://api.github.com/repos/H4M5TER/actions-playground/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/H4M5TER/actions-playground/comments{/number}", "commits_url": "https://api.github.com/repos/H4M5TER/actions-playground/commits{/sha}", "compare_url": "https://api.github.com/repos/H4M5TER/actions-playground/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/H4M5TER/actions-playground/contents/{+path}", "contributors_url": "https://api.github.com/repos/H4M5TER/actions-playground/contributors", "created_at": "2022-05-05T19:11:58Z", "default_branch": "main", "deployments_url": "https://api.github.com/repos/H4M5TER/actions-playground/deployments", "description": null, "disabled": false, "downloads_url": "https://api.github.com/repos/H4M5TER/actions-playground/downloads", "events_url": "https://api.github.com/repos/H4M5TER/actions-playground/events", "fork": false, "forks": 0, "forks_count": 0, "forks_url": "https://api.github.com/repos/H4M5TER/actions-playground/forks", "full_name": "H4M5TER/actions-playground", "git_commits_url": "https://api.github.com/repos/H4M5TER/actions-playground/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/H4M5TER/actions-playground/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/H4M5TER/actions-playground/git/tags{/sha}", "git_url": "git://github.com/H4M5TER/actions-playground.git", "has_downloads": true, "has_issues": true, "has_pages": false, "has_projects": true, "has_wiki": true, "homepage": null, "hooks_url": "https://api.github.com/repos/H4M5TER/actions-playground/hooks", "html_url": "https://github.com/H4M5TER/actions-playground", "id": 489097254, "is_template": false, "issue_comment_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/events{/number}", "issues_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues{/number}", "keys_url": "https://api.github.com/repos/H4M5TER/actions-playground/keys{/key_id}", "labels_url": "https://api.github.com/repos/H4M5TER/actions-playground/labels{/name}", "language": null, "languages_url": "https://api.github.com/repos/H4M5TER/actions-playground/languages", "license": { "key": "mit", "name": "MIT License", "node_id": "MDc6TGljZW5zZTEz", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit" }, "merges_url": "https://api.github.com/repos/H4M5TER/actions-playground/merges", "milestones_url": "https://api.github.com/repos/H4M5TER/actions-playground/milestones{/number}", "mirror_url": null, "name": "actions-playground", "node_id": "R_kgDOHScIJg", "notifications_url": "https://api.github.com/repos/H4M5TER/actions-playground/notifications{?since,all,participating}", "open_issues": 4, "open_issues_count": 4, "owner": { "avatar_url": "https://avatars.githubusercontent.com/u/21092951?v=4", "events_url": "https://api.github.com/users/H4M5TER/events{/privacy}", "followers_url": "https://api.github.com/users/H4M5TER/followers", "following_url": "https://api.github.com/users/H4M5TER/following{/other_user}", "gists_url": "https://api.github.com/users/H4M5TER/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/H4M5TER", "id": 21092951, "login": "H4M5TER", "node_id": "MDQ6VXNlcjIxMDkyOTUx", "organizations_url": "https://api.github.com/users/H4M5TER/orgs", "received_events_url": "https://api.github.com/users/H4M5TER/received_events", "repos_url": "https://api.github.com/users/H4M5TER/repos", "site_admin": false, "starred_url": "https://api.github.com/users/H4M5TER/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/H4M5TER/subscriptions", "type": "User", "url": "https://api.github.com/users/H4M5TER" }, "private": false, "pulls_url": "https://api.github.com/repos/H4M5TER/actions-playground/pulls{/number}", "pushed_at": "2022-05-18T15:02:41Z", "releases_url": "https://api.github.com/repos/H4M5TER/actions-playground/releases{/id}", "size": 9, "ssh_url": "git@github.com:H4M5TER/actions-playground.git", "stargazers_count": 0, "stargazers_url": "https://api.github.com/repos/H4M5TER/actions-playground/stargazers", "statuses_url": "https://api.github.com/repos/H4M5TER/actions-playground/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/H4M5TER/actions-playground/subscribers", "subscription_url": "https://api.github.com/repos/H4M5TER/actions-playground/subscription", "svn_url": "https://github.com/H4M5TER/actions-playground", "tags_url": "https://api.github.com/repos/H4M5TER/actions-playground/tags", "teams_url": "https://api.github.com/repos/H4M5TER/actions-playground/teams", "topics": [], "trees_url": "https://api.github.com/repos/H4M5TER/actions-playground/git/trees{/sha}", "updated_at": "2022-05-11T15:30:52Z", "url": "https://api.github.com/repos/H4M5TER/actions-playground", "visibility": "public", "watchers": 0, "watchers_count": 0 }, "sender": { "avatar_url": "https://avatars.githubusercontent.com/u/21092951?v=4", "events_url": "https://api.github.com/users/H4M5TER/events{/privacy}", "followers_url": "https://api.github.com/users/H4M5TER/followers", "following_url": "https://api.github.com/users/H4M5TER/following{/other_user}", "gists_url": "https://api.github.com/users/H4M5TER/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/H4M5TER", "id": 21092951, "login": "H4M5TER", "node_id": "MDQ6VXNlcjIxMDkyOTUx", "organizations_url": "https://api.github.com/users/H4M5TER/orgs", "received_events_url": "https://api.github.com/users/H4M5TER/received_events", "repos_url": "https://api.github.com/users/H4M5TER/repos", "site_admin": false, "starred_url": "https://api.github.com/users/H4M5TER/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/H4M5TER/subscriptions", "type": "User", "url": "https://api.github.com/users/H4M5TER" } }, "eventName": "issues", "sha": "c33e70f32b914856c9485897a3cf3c914c87582e", "ref": "refs/heads/main", "workflow": "Milestone Issue Backlog", "action": "__H4M5TER_milestone-backlog", "actor": "H4M5TER", "job": "backlog", "runNumber": 45, "runId": 2346385128, "apiUrl": "https://api.github.com", "serverUrl": "https://github.com", "graphqlUrl": "https://api.github.com/graphql" } ```
manually closed context ```json { "payload": { "action": "closed", "issue": { "active_lock_reason": null, "assignee": null, "assignees": [], "author_association": "OWNER", "body": null, "closed_at": "2022-05-18T15:06:17Z", "comments": 0, "comments_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/4/comments", "created_at": "2022-05-16T15:57:16Z", "events_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/4/events", "html_url": "https://github.com/H4M5TER/actions-playground/issues/4", "id": 1237367089, "labels": [], "labels_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/4/labels{/name}", "locked": false, "milestone": { "closed_at": null, "closed_issues": 2, "created_at": "2022-05-05T19:19:20Z", "creator": { "avatar_url": "https://avatars.githubusercontent.com/u/21092951?v=4", "events_url": "https://api.github.com/users/H4M5TER/events{/privacy}", "followers_url": "https://api.github.com/users/H4M5TER/followers", "following_url": "https://api.github.com/users/H4M5TER/following{/other_user}", "gists_url": "https://api.github.com/users/H4M5TER/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/H4M5TER", "id": 21092951, "login": "H4M5TER", "node_id": "MDQ6VXNlcjIxMDkyOTUx", "organizations_url": "https://api.github.com/users/H4M5TER/orgs", "received_events_url": "https://api.github.com/users/H4M5TER/received_events", "repos_url": "https://api.github.com/users/H4M5TER/repos", "site_admin": false, "starred_url": "https://api.github.com/users/H4M5TER/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/H4M5TER/subscriptions", "type": "User", "url": "https://api.github.com/users/H4M5TER" }, "description": "", "due_on": null, "html_url": "https://github.com/H4M5TER/actions-playground/milestone/1", "id": 7948119, "labels_url": "https://api.github.com/repos/H4M5TER/actions-playground/milestones/1/labels", "node_id": "MI_kwDOHScIJs4AeUdX", "number": 1, "open_issues": 2, "state": "open", "title": "test milestone", "updated_at": "2022-05-18T15:06:17Z", "url": "https://api.github.com/repos/H4M5TER/actions-playground/milestones/1" }, "node_id": "I_kwDOHScIJs5JwLkx", "number": 4, "performed_via_github_app": null, "reactions": { "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/4/reactions" }, "repository_url": "https://api.github.com/repos/H4M5TER/actions-playground", "state": "closed", "timeline_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/4/timeline", "title": "ya test", "updated_at": "2022-05-18T15:06:17Z", "url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/4", "user": { "avatar_url": "https://avatars.githubusercontent.com/u/21092951?v=4", "events_url": "https://api.github.com/users/H4M5TER/events{/privacy}", "followers_url": "https://api.github.com/users/H4M5TER/followers", "following_url": "https://api.github.com/users/H4M5TER/following{/other_user}", "gists_url": "https://api.github.com/users/H4M5TER/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/H4M5TER", "id": 21092951, "login": "H4M5TER", "node_id": "MDQ6VXNlcjIxMDkyOTUx", "organizations_url": "https://api.github.com/users/H4M5TER/orgs", "received_events_url": "https://api.github.com/users/H4M5TER/received_events", "repos_url": "https://api.github.com/users/H4M5TER/repos", "site_admin": false, "starred_url": "https://api.github.com/users/H4M5TER/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/H4M5TER/subscriptions", "type": "User", "url": "https://api.github.com/users/H4M5TER" } }, "repository": { "allow_forking": true, "archive_url": "https://api.github.com/repos/H4M5TER/actions-playground/{archive_format}{/ref}", "archived": false, "assignees_url": "https://api.github.com/repos/H4M5TER/actions-playground/assignees{/user}", "blobs_url": "https://api.github.com/repos/H4M5TER/actions-playground/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/H4M5TER/actions-playground/branches{/branch}", "clone_url": "https://github.com/H4M5TER/actions-playground.git", "collaborators_url": "https://api.github.com/repos/H4M5TER/actions-playground/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/H4M5TER/actions-playground/comments{/number}", "commits_url": "https://api.github.com/repos/H4M5TER/actions-playground/commits{/sha}", "compare_url": "https://api.github.com/repos/H4M5TER/actions-playground/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/H4M5TER/actions-playground/contents/{+path}", "contributors_url": "https://api.github.com/repos/H4M5TER/actions-playground/contributors", "created_at": "2022-05-05T19:11:58Z", "default_branch": "main", "deployments_url": "https://api.github.com/repos/H4M5TER/actions-playground/deployments", "description": null, "disabled": false, "downloads_url": "https://api.github.com/repos/H4M5TER/actions-playground/downloads", "events_url": "https://api.github.com/repos/H4M5TER/actions-playground/events", "fork": false, "forks": 0, "forks_count": 0, "forks_url": "https://api.github.com/repos/H4M5TER/actions-playground/forks", "full_name": "H4M5TER/actions-playground", "git_commits_url": "https://api.github.com/repos/H4M5TER/actions-playground/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/H4M5TER/actions-playground/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/H4M5TER/actions-playground/git/tags{/sha}", "git_url": "git://github.com/H4M5TER/actions-playground.git", "has_downloads": true, "has_issues": true, "has_pages": false, "has_projects": true, "has_wiki": true, "homepage": null, "hooks_url": "https://api.github.com/repos/H4M5TER/actions-playground/hooks", "html_url": "https://github.com/H4M5TER/actions-playground", "id": 489097254, "is_template": false, "issue_comment_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues/events{/number}", "issues_url": "https://api.github.com/repos/H4M5TER/actions-playground/issues{/number}", "keys_url": "https://api.github.com/repos/H4M5TER/actions-playground/keys{/key_id}", "labels_url": "https://api.github.com/repos/H4M5TER/actions-playground/labels{/name}", "language": null, "languages_url": "https://api.github.com/repos/H4M5TER/actions-playground/languages", "license": { "key": "mit", "name": "MIT License", "node_id": "MDc6TGljZW5zZTEz", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit" }, "merges_url": "https://api.github.com/repos/H4M5TER/actions-playground/merges", "milestones_url": "https://api.github.com/repos/H4M5TER/actions-playground/milestones{/number}", "mirror_url": null, "name": "actions-playground", "node_id": "R_kgDOHScIJg", "notifications_url": "https://api.github.com/repos/H4M5TER/actions-playground/notifications{?since,all,participating}", "open_issues": 2, "open_issues_count": 2, "owner": { "avatar_url": "https://avatars.githubusercontent.com/u/21092951?v=4", "events_url": "https://api.github.com/users/H4M5TER/events{/privacy}", "followers_url": "https://api.github.com/users/H4M5TER/followers", "following_url": "https://api.github.com/users/H4M5TER/following{/other_user}", "gists_url": "https://api.github.com/users/H4M5TER/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/H4M5TER", "id": 21092951, "login": "H4M5TER", "node_id": "MDQ6VXNlcjIxMDkyOTUx", "organizations_url": "https://api.github.com/users/H4M5TER/orgs", "received_events_url": "https://api.github.com/users/H4M5TER/received_events", "repos_url": "https://api.github.com/users/H4M5TER/repos", "site_admin": false, "starred_url": "https://api.github.com/users/H4M5TER/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/H4M5TER/subscriptions", "type": "User", "url": "https://api.github.com/users/H4M5TER" }, "private": false, "pulls_url": "https://api.github.com/repos/H4M5TER/actions-playground/pulls{/number}", "pushed_at": "2022-05-18T15:02:41Z", "releases_url": "https://api.github.com/repos/H4M5TER/actions-playground/releases{/id}", "size": 9, "ssh_url": "git@github.com:H4M5TER/actions-playground.git", "stargazers_count": 0, "stargazers_url": "https://api.github.com/repos/H4M5TER/actions-playground/stargazers", "statuses_url": "https://api.github.com/repos/H4M5TER/actions-playground/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/H4M5TER/actions-playground/subscribers", "subscription_url": "https://api.github.com/repos/H4M5TER/actions-playground/subscription", "svn_url": "https://github.com/H4M5TER/actions-playground", "tags_url": "https://api.github.com/repos/H4M5TER/actions-playground/tags", "teams_url": "https://api.github.com/repos/H4M5TER/actions-playground/teams", "topics": [], "trees_url": "https://api.github.com/repos/H4M5TER/actions-playground/git/trees{/sha}", "updated_at": "2022-05-11T15:30:52Z", "url": "https://api.github.com/repos/H4M5TER/actions-playground", "visibility": "public", "watchers": 0, "watchers_count": 0 }, "sender": { "avatar_url": "https://avatars.githubusercontent.com/u/21092951?v=4", "events_url": "https://api.github.com/users/H4M5TER/events{/privacy}", "followers_url": "https://api.github.com/users/H4M5TER/followers", "following_url": "https://api.github.com/users/H4M5TER/following{/other_user}", "gists_url": "https://api.github.com/users/H4M5TER/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/H4M5TER", "id": 21092951, "login": "H4M5TER", "node_id": "MDQ6VXNlcjIxMDkyOTUx", "organizations_url": "https://api.github.com/users/H4M5TER/orgs", "received_events_url": "https://api.github.com/users/H4M5TER/received_events", "repos_url": "https://api.github.com/users/H4M5TER/repos", "site_admin": false, "starred_url": "https://api.github.com/users/H4M5TER/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/H4M5TER/subscriptions", "type": "User", "url": "https://api.github.com/users/H4M5TER" } }, "eventName": "issues", "sha": "c33e70f32b914856c9485897a3cf3c914c87582e", "ref": "refs/heads/main", "workflow": "Milestone Issue Backlog", "action": "__H4M5TER_milestone-backlog", "actor": "H4M5TER", "job": "backlog", "runNumber": 46, "runId": 2346408986, "apiUrl": "https://api.github.com", "serverUrl": "https://github.com", "graphqlUrl": "https://api.github.com/graphql" } ```
shigma commented 2 years ago

Well in that case you can use push event instead?

H4M5TER commented 2 years ago

Do you know what keywords does GitHub use ? such as fix #3 with close #3

shigma commented 2 years ago
H4M5TER commented 2 years ago

okay, do it tomorrow how about merged pull request ?

H4M5TER commented 2 years ago

push event is fine since it carries all the new commit object

shigma commented 2 years ago

Koishi uses squash merge so I don't worry about PRs. 🤣

Also I believe this feature should be optional since others may not want it. Maybe you can add a config, such as commit prefix or commit regexp.