{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/miq_bot/issues/331","repository_url":"https://api.github.com/repos/ManageIQ/miq_bot","labels_url":"https://api.github.com/repos/ManageIQ/miq_bot/issues/331/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/miq_bot/issues/331/comments","events_url":"https://api.github.com/repos/ManageIQ/miq_bot/issues/331/events","html_url":"https://github.com/ManageIQ/miq_bot/pull/331","id":211522430,"number":331,"title":"Stale issue/PR marker","user":{"login":"chrisarcand","id":2430490,"avatar_url":"https://avatars1.githubusercontent.com/u/2430490?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisarcand","html_url":"https://github.com/chrisarcand","followers_url":"https://api.github.com/users/chrisarcand/followers","following_url":"https://api.github.com/users/chrisarcand/following{/other_user}","gists_url":"https://api.github.com/users/chrisarcand/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisarcand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisarcand/subscriptions","organizations_url":"https://api.github.com/users/chrisarcand/orgs","repos_url":"https://api.github.com/users/chrisarcand/repos","events_url":"https://api.github.com/users/chrisarcand/events{/privacy}","received_events_url":"https://api.github.com/users/chrisarcand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"Fryguy","id":52120,"avatar_url":"https://avatars0.githubusercontent.com/u/52120?v=3","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false},"assignees":[{"login":"Fryguy","id":52120,"avatar_url":"https://avatars0.githubusercontent.com/u/52120?v=3","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-03-02T21:24:57Z","updated_at":"2017-03-02T21:32:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/miq_bot/pulls/331","html_url":"https://github.com/ManageIQ/miq_bot/pull/331","diff_url":"https://github.com/ManageIQ/miq_bot/pull/331.diff","patch_url":"https://github.com/ManageIQ/miq_bot/pull/331.patch"},"body":"Inspired by rails-bot (which in this case is nothing more than [a manual script](https://github.com/rafaelfranca/rails-tools/blob/master/bin/mark_stale_issues) run by Rafael every few months), this worker takes out the trash over the weekend and helps clean up old issues and pull requests in every enabled repo.\r\n\r\n![](http://screenshots.chrisarcand.com/4zbep.jpg)\r\n\r\n### Details\r\n\r\n* A pull request or issue that hasn't been updated (commented on, whatever) in the last **3 months** is considered stale.\r\n* Stale *issues* are marked with the 'stale' label and commented on.\r\n* Stale *pull requests* are closed and commented on. \r\n* As with rails-bot, issues/pull requests can be 'pinned' - that is, if the label 'pinned' (or any other label that we deem worthy) is present on the issue, it will not be marked as stale or closed even if it's extremely old. This is useful for longstanding things that we know are a continuing issue but take a really long time to fix. \r\n* The StaleIssueMarker is run every Saturday, specifically, as it potentially uses a fair number of queries and not many people are working on a Saturday. Freshens up the repos for a lovely Monday morning 🌅 ☕️ \r\n* This worker is a little different in that I've split the concept of 'the worker that does the thing' and 'the worker that schedules the action to be taken with multiple workers'. That is, there's a `StaleIssueMarker` and a `Schedulers::StaleIssueMarker`. We should probably follow a pattern more like this with other things we do to do more things asynchronously. Thoughts?\r\n\r\n*Why are you labeling issues but closing PRs?*  \r\n* As assumed with rails-bot, issues should probably be at least glanced at before actually closed. If an issue is marked as 'stale', the developer of the issue should assume that unless they take action soon, a committer can come along and just close it without having to spend the time to explain themselves too much. \r\n* Pull requests, on the other hand, have a true shelf life. If a PR isn't touched for months, there's a *very high* probability that it isn't even mergable and the contributor will probably just close it anyway - and even if it were to be eventually worked on again, it will probably be changed enough that the contributor should just make a brand new pull request anyway.\r\n\r\n### Deployment\r\n\r\nThis includes tests, but even still, changing the state of hundreds of issues/PRs on the core repo is scary stuff 👻  Therefore, I'll run this on the miq_bot repo first to make sure it doesn't cause a chaos monkey 🐒 "},"comment":{"url":"https://api.github.com/repos/ManageIQ/miq_bot/issues/comments/283788578","html_url":"https://github.com/ManageIQ/miq_bot/pull/331#issuecomment-283788578","issue_url":"https://api.github.com/repos/ManageIQ/miq_bot/issues/331","id":283788578,"user":{"login":"miq-bot","id":7806257,"avatar_url":"https://avatars2.githubusercontent.com/u/7806257?v=3","gravatar_id":"","url":"https://api.github.com/users/miq-bot","html_url":"https://github.com/miq-bot","followers_url":"https://api.github.com/users/miq-bot/followers","following_url":"https://api.github.com/users/miq-bot/following{/other_user}","gists_url":"https://api.github.com/users/miq-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/miq-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miq-bot/subscriptions","organizations_url":"https://api.github.com/users/miq-bot/orgs","repos_url":"https://api.github.com/users/miq-bot/repos","events_url":"https://api.github.com/users/miq-bot/events{/privacy}","received_events_url":"https://api.github.com/users/miq-bot/received_events","type":"User","site_admin":false},"created_at":"2017-03-02T21:32:20Z","updated_at":"2017-03-02T21:32:20Z","body":"<rubocop />Checked commit https://github.com/chrisarcand/miq_bot/commit/ec07e31a0d7d4457111e86b5de947b27ef30a9f6 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0\n4 files checked, 11 offenses detected\n\n**app/workers/stale_issue_marker.rb**\n- [ ] :exclamation: - [Line 10](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/app/workers/stale_issue_marker.rb#L10), Col 22 - [Style/MutableConstant](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Style/MutableConstant) - Freeze mutable objects assigned to constants.\n- [ ] :exclamation: - [Line 12](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/app/workers/stale_issue_marker.rb#L12), Col 25 - [Style/MutableConstant](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Style/MutableConstant) - Freeze mutable objects assigned to constants.\n- [ ] :exclamation: - [Line 19](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/app/workers/stale_issue_marker.rb#L19), Col 25 - [Style/MutableConstant](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Style/MutableConstant) - Freeze mutable objects assigned to constants.\n- [ ] :exclamation: - [Line 33](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/app/workers/stale_issue_marker.rb#L33), Col 13 - [Style/ExtraSpacing](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Style/ExtraSpacing) - Unnecessary spacing detected.\n- [ ] :exclamation: - [Line 33](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/app/workers/stale_issue_marker.rb#L33), Col 15 - [Style/SpaceAroundOperators](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Style/SpaceAroundOperators) - Operator `=` should be surrounded by a single space.\n- [ ] :exclamation: - [Line 46](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/app/workers/stale_issue_marker.rb#L46), Col 9 - [Style/Next](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Style/Next) - Use `next` to skip iteration.\n- [ ] :exclamation: - [Line 47](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/app/workers/stale_issue_marker.rb#L47), Col 38 - [Rails/TimeZone](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Rails/TimeZone) - Do not use `Time.now` without zone. Use one of `Time.zone.now`, `Time.current`, `Time.now.in_time_zone`, `Time.now.utc`, `Time.now.getlocal`, `Time.now.iso8601`, `Time.now.jisx0301`, `Time.now.rfc3339`, `Time.now.to_i`, `Time.now.to_f` instead.\n- [ ] :exclamation: - [Line 57](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/app/workers/stale_issue_marker.rb#L57), Col 34 - [Rails/TimeZone](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Rails/TimeZone) - Do not use `Time.now` without zone. Use one of `Time.zone.now`, `Time.current`, `Time.now.in_time_zone`, `Time.now.utc`, `Time.now.getlocal`, `Time.now.iso8601`, `Time.now.jisx0301`, `Time.now.rfc3339`, `Time.now.to_i`, `Time.now.to_f` instead.\n- [ ] :exclamation: - [Line 8](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/app/workers/stale_issue_marker.rb#L8), Col 22 - [Style/MutableConstant](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Style/MutableConstant) - Freeze mutable objects assigned to constants.\n\n**spec/workers/stale_issue_marker.rb**\n- [ ] :exclamation: - [Line 12](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/spec/workers/stale_issue_marker.rb#L12), Col 30 - [Style/WordArray](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Style/WordArray) - Use `%w` or `%W` for an array of words.\n- [ ] :exclamation: - [Line 57](https://github.com/chrisarcand/miq_bot/blob/ec07e31a0d7d4457111e86b5de947b27ef30a9f6/spec/workers/stale_issue_marker.rb#L57), Col 30 - [Style/WordArray](http://rubydoc.info/gems/rubocop/0.47.1/RuboCop/Cop/Style/WordArray) - Use `%w` or `%W` for an array of words.\n"}}
{"actor":{"display_login":"miq-bot"}}