<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Thu, Apr 4, 2019 at 9:57 AM Cristian Morales Vega <<a href="mailto:christian.morales.vega@gmail.com" target="_blank">christian.morales.vega@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I see the PR has already been merged. I guess I could take the latest<br>
Docker Hub image and just try it? Not sure of the exact steps needed,<br>
though.<br>
<br>
Do I need to add a Webhook to my GitHub repository? Just push or any<br>
event? What does happen when CDash receives the POST request from<br>
GitHub? Since in my setup right now Jenkins is basically in charge of<br>
everything and CDash doesn't really know about anything until it<br>
receives the results from Jenkins I'm unsure how all the pieces fit<br>
together.<br></blockquote><div><br></div><div>Yes, this feature is now available.</div><div><br></div><div>I was going to write up a blog post announcing it & how to use it, but we would also like to add support for GitHub Checks, so I'm going to hold off on official publication until that's ready too.</div><div><br></div><div>But since you asked, here's how to get CDash to post statuses on your GitHub commits.</div><div><br></div><div>Step 1: <a href="https://developer.github.com/apps/building-github-apps/creating-a-github-app/" target="_blank">Register a GitHub App</a> for your CDash instance.</div><div>You can skip this step if you're using a public, Kitware hosted CDash instance like <a href="http://open.cdash.org" target="_blank">open.cdash.org</a>.</div><div>Here's what to enter for the various fields on this form.<br></div><div><div><ul><li>Homepage URL: the base URL of your CDash installation (<a href="http://open.cdash.org" target="_blank">http://open.cdash.org</a>)</li><li>User authorization callback URL: user.php on this CDash instance (<a href="https://open.cdash.org/user.php" target="_blank">https://open.cdash.org/user.php</a>)</li><li>Setup URL: leave blank</li><li>Redirect on update: leave unchecked</li><li>Webhook URL: /api/v1/noop.php (<a href="https://open.cdash.org/api/v1/noop.php" target="_blank">https://open.cdash.org/api/v1/noop.php</a>). This will need to be updated to our new GitHub webhook API endpoint once our support for "GitHub Checks" is ready.</li><li>Webhook secret: leave blank for now</li></ul></div><div>Permissions:</div><div><ul><li>Repository contents: read only (to be able to compare commits)</li><li>Commit statuses: read and write (this is the main feature we're after)</li><li>You might also want to give it read & write permissions for Checks now, just so you don't have to update it later once this feature is ready.</li></ul></div><div>For now leave "User Permissions" and "Subscribe to events" blank.<br></div><div>Update a logo, we recommend cdash.png in the public/img folder.<br></div><div><br></div><div>For "Where can this GitHub App be installed?", we recommend "any account" depending on who will be submitting to this CDash.</div></div><div><br></div><div><div>Now you can finally click "Create GitHub app". Record your APP ID. this will go in your config.local.php file as $CDASH_GITHUB_APP_ID. Also generate a private key and upload this to config/github.pem.</div></div><div><br></div><div><br></div><div>Step 2: Install the app on your repository / organization.</div><div>From <a href="https://github.com/settings/apps/" target="_blank">https://github.com/settings/apps/</a><my-app-name> click the "Install App" link in the sidebar and follow the instructions. This will give you an installation ID.</div><div><br></div><div><br></div><div>Step 3: Add the installation ID to your CDash project</div><div><ul><li>Login to CDash as a project admin.</li><li>Navigate to Settings -> Project -> Repository</li><li>Make sure your project's GitHub URL is filled in under the Repository field.</li><li>Input your installation ID under the "username" field</li></ul></div><div><br></div><div><br></div><div>Step 4: update your builds to specify a "status context" (<a href="https://github.com/Kitware/CDash/blob/master/.circleci/ctest_driver_script.cmake">example here</a>)</div><div><br></div><div><div>The idea here is that you might not necessarily want every single build of a commit to be publishing its status to GitHub. So we make this feature opt-in on a per-build basis. This also gives us the opportunity to specify a context for this build, so we can differentiate between multiple builds posting status on a single commit. Rather than adding another CTest variable to hold this information, we decided to use the relatively new "build properties" feature in CDash. This allows you to upload arbitrary key/value pairs (in JSON format) that will be associated with a build.</div></div><div><br></div><div>When testing CDash itself on CircleCI we do two builds, one for MySQL and one for Postgres. <a href="https://github.com/Kitware/CDash/pull/821">Here's an example of what this looks like on GitHub</a> (click the green checkmark on the last commit)</div></div></div></div></div></div></div>