{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/build/issues/236","labels_url":"https://api.github.com/repos/nodejs/build/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/build/issues/236/comments","events_url":"https://api.github.com/repos/nodejs/build/issues/236/events","html_url":"https://github.com/nodejs/build/issues/236","id":114701435,"number":236,"title":"Posting build progress to github ","user":{"login":"jbergstroem","id":176984,"avatar_url":"https://avatars.githubusercontent.com/u/176984?v=3","gravatar_id":"","url":"https://api.github.com/users/jbergstroem","html_url":"https://github.com/jbergstroem","followers_url":"https://api.github.com/users/jbergstroem/followers","following_url":"https://api.github.com/users/jbergstroem/following{/other_user}","gists_url":"https://api.github.com/users/jbergstroem/gists{/gist_id}","starred_url":"https://api.github.com/users/jbergstroem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbergstroem/subscriptions","organizations_url":"https://api.github.com/users/jbergstroem/orgs","repos_url":"https://api.github.com/users/jbergstroem/repos","events_url":"https://api.github.com/users/jbergstroem/events{/privacy}","received_events_url":"https://api.github.com/users/jbergstroem/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-11-02T22:45:10Z","updated_at":"2015-12-06T09:01:42Z","closed_at":null,"body":"I've been tinkering with a set of scripts that posts feedback to github. Here's a quick outline on how it works:\r\n\r\n- There's a boolean called `POST_STATUS_TO_PR` in the  `node-test-pull-request` job. Make sure that's checked and enter your PR.\r\n- Each worker as part of the `node-test-commit` will ping github and say they've started building/testing (as of now, see #229 for improvements in this regard). These workers are currently: `ci/linter`, `ci/freebsd`, `ci/smartos`, `ci/linux`, `ci/plinux`, `ci/windows-fanned`, `ci/osx` `ci/arm` and `ci/arm-fanned`.\r\n- Once the test suite completes we're checking if the test suite returned either unstable or success status. If that's the case we post a success and a text mentioning total tests run plus any skips (linter accts differently plus needs more work since we need tap output; see [this example pr for work in progress](https://github.com/jbergstroem/node/pull/1)).\r\n- If the suite has any other status (currently only supports failed tests) we post the number of failed tests, skipped and total.\r\n\r\nIn order to achieve above I had to install a new jenkins plugin that gives us access to execute logic as part of the post-build phase. I'm using the xml api and parse output in python (for portability) when needed.\r\n\r\nHave a look at a few of the above jobs (edit in jenkins) for how it currently works. There's a few things that still needs to be done, where at least one would be up for discussion:\r\n - port bash stuff to windows\r\n - unfold build steps (#229) so we can distinguish between a compile and test error.\r\n - land changes to linter can output tap (https://github.com/nodejs/node/pull/3448 and wip PR for eslint)\r\n - figure out how to safely store github credentials (currently using the personal token)\r\n\r\nSo, the last one is a bit of a tricky problem. Since we can't really trust input from a PR this is an issue. Jenkins has a few ways of storing passwords (credential store and global passwords) and tries to mask it in some cases; but that sandbox was pretty easy to escape from."},"comment":{"url":"https://api.github.com/repos/nodejs/build/issues/comments/162289614","html_url":"https://github.com/nodejs/build/issues/236#issuecomment-162289614","issue_url":"https://api.github.com/repos/nodejs/build/issues/236","id":162289614,"user":{"login":"Starefossen","id":968267,"avatar_url":"https://avatars.githubusercontent.com/u/968267?v=3","gravatar_id":"","url":"https://api.github.com/users/Starefossen","html_url":"https://github.com/Starefossen","followers_url":"https://api.github.com/users/Starefossen/followers","following_url":"https://api.github.com/users/Starefossen/following{/other_user}","gists_url":"https://api.github.com/users/Starefossen/gists{/gist_id}","starred_url":"https://api.github.com/users/Starefossen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starefossen/subscriptions","organizations_url":"https://api.github.com/users/Starefossen/orgs","repos_url":"https://api.github.com/users/Starefossen/repos","events_url":"https://api.github.com/users/Starefossen/events{/privacy}","received_events_url":"https://api.github.com/users/Starefossen/received_events","type":"User","site_admin":false},"created_at":"2015-12-06T09:01:42Z","updated_at":"2015-12-06T09:01:42Z","body":"> * jenkins has an guesstimation for job length; we can use that as part of our \"polling interval frequency algoritm\"\r\n\r\nGood suggestion!\r\n\r\n> * the job definition probably needs to be thought through; it can contain things like what input is expected to launch a poller against a job (looking up through shasum might not be impossible since that information is available in the node-test-commit sub-task)\r\n\r\nFrom the `node-test-pull-request` action parameters we can query the GitHub API to get the commits for the given pull request. We can also use the `POST_STATUS_TO_PR` parameter to control whether the service should post statuses to GitHub or not. \r\n\r\n```json\r\n  \"actions\": [\r\n    {\r\n      \"parameters\": [\r\n        {\r\n          \"name\": \"TARGET_GITHUB_ORG\",\r\n          \"value\": \"nodejs\"\r\n        },\r\n        {\r\n          \"name\": \"TARGET_REPO_NAME\",\r\n          \"value\": \"node\"\r\n        },\r\n        {\r\n          \"name\": \"PR_ID\",\r\n          \"value\": \"4116\"\r\n        },\r\n        {\r\n          \"name\": \"POST_STATUS_TO_PR\",\r\n          \"value\": true\r\n```"}}