{"action":"created","issue":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/21064","repository_url":"https://api.github.com/repos/code-dot-org/code-dot-org","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/21064/labels{/name}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/21064/comments","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/21064/events","html_url":"https://github.com/code-dot-org/code-dot-org/pull/21064","id":302925998,"number":21064,"title":"add pre-push git hook to detect circle config changes","user":{"login":"wjordan","id":56541,"avatar_url":"https://avatars3.githubusercontent.com/u/56541?v=4","gravatar_id":"","url":"https://api.github.com/users/wjordan","html_url":"https://github.com/wjordan","followers_url":"https://api.github.com/users/wjordan/followers","following_url":"https://api.github.com/users/wjordan/following{/other_user}","gists_url":"https://api.github.com/users/wjordan/gists{/gist_id}","starred_url":"https://api.github.com/users/wjordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjordan/subscriptions","organizations_url":"https://api.github.com/users/wjordan/orgs","repos_url":"https://api.github.com/users/wjordan/repos","events_url":"https://api.github.com/users/wjordan/events{/privacy}","received_events_url":"https://api.github.com/users/wjordan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-07T01:00:40Z","updated_at":"2018-03-07T01:19:03Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/21064","html_url":"https://github.com/code-dot-org/code-dot-org/pull/21064","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/21064.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/21064.patch"},"body":"This PR moves the `circle_yml_changed` logic from `bin/circle/merge-base` into the `GitUtils` module, and reuses it in a new [`pre-push`](https://git-scm.com/docs/githooks#_pre_push) Git commit hook.\r\n\r\nThe purpose of duplicating this check in a `pre-push` hook is to catch any issue with outdated circle-config files _before_ the CircleCI run begins (when a commit is pushed to GitHub), in addition to _after_ the commit makes it to GitHub.\r\n\r\nBecause the logic makes several assumptions about the exact structure of the push being attempted (a single push of the current branch to a remote named `origin`), the script includes several early-exit checks (printing a warning to standard-error and allowing the push to proceed), unless the structure of the attempted push is exactly what the script expects.\r\n\r\nI figured it would be better to just leave any edge-case pushes untouched rather than requiring all pushes to conform exactly to what this check expects, or spending extra time refactoring the check to handle all kinds of possible obscure edge-case pushes. I'm open to discussion on how exactly to structure this though."},"comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments/370988471","html_url":"https://github.com/code-dot-org/code-dot-org/pull/21064#issuecomment-370988471","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/21064","id":370988471,"user":{"login":"wjordan","id":56541,"avatar_url":"https://avatars3.githubusercontent.com/u/56541?v=4","gravatar_id":"","url":"https://api.github.com/users/wjordan","html_url":"https://github.com/wjordan","followers_url":"https://api.github.com/users/wjordan/followers","following_url":"https://api.github.com/users/wjordan/following{/other_user}","gists_url":"https://api.github.com/users/wjordan/gists{/gist_id}","starred_url":"https://api.github.com/users/wjordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjordan/subscriptions","organizations_url":"https://api.github.com/users/wjordan/orgs","repos_url":"https://api.github.com/users/wjordan/repos","events_url":"https://api.github.com/users/wjordan/events{/privacy}","received_events_url":"https://api.github.com/users/wjordan/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T01:19:03Z","updated_at":"2018-03-07T01:19:03Z","author_association":"OWNER","body":"> Can I skip this check with --no-verify, and if so can we include that in the command line output?\r\n\r\nYes, I'll include mention of `--no-verify` in the error message. (I was considering doing so already)\r\n\r\nNote that the error message will show up when `git push` is run from the terminal, but the message doesn't seem to be captured anywhere in `RubyMine`'s Git integration unfortunately. If this ends up being an ongoing issue for anyone getting blocked by this hook, I'd recommend either always leaving the 'run git hooks' button un-checked in the 'push' dialog, or reverting this PR / removing this hook."}}
{"actor":{"display_login":"wjordan"}}