Github integration and Build Status
Asked by John Medina:

I am attempting to use Compass to monitor the status of the many repositories my company manages using Github. We mainly use Github Actions to run CI/CD pipelines on changes to our repositories and like to be able to track them in Compass.

I have created the \`compass.yml\` files and added them to the repos, but they only provide 3 different kinds of metrics:

1. Deployment Frequency
2. Open Pull Requests
3. PR Cycle Time

I'm looking for a way to update a status/metric of a component based on the conclusions of certain Github Actions. Similar to how build events are tracked using the pre-defined Build Success Rate metric for Bitbucket pipelines.

I was wondering if I could get some guidance on how I could achieve something like this.


Answers:
author: Dave Parrish _Atlassian_
body: Hey John ? It's Dave from the Compass integrations team. Welcome and thanks for this question. Sounds like you're looking to manually push metrics to a component based on the result of a GitHub Action. We've got instructions for setting that up here:

[Push metric values using a cURL command](https://developer.atlassian.com/cloud/compass/components/push-metric-values-using-a-curl-command/)

Meanwhile, we are continually updating our integrations (including GitHub) to \*automatically\* publish key metrics to Compass. So for example, in the near future you will automatically be able to see \*build success rate\* for components with an associated GitHub repo, without you needing to follow the instructions above.

Hopefully this is helpful. Tell me more about the metrics you're looking to publish and I'll make sure you're on the right track!

comments: author: John Medina
body: Hey Dave,

We run builds on every commit pushed as part of our review process and would like to monitor and display the status of all our repositories. What I am trying to achieve for my proof of concept really is to display the current build status of repositories (and if possible, a % Build Success Rate metric compatible with Github repositories).

I have read through that article. Correct me if I'm wrong, but it seems to only support pushing numerical values to the metric, whereas I am looking to push a status (i.e. Pass/Fail).

I have read and attempted to work through the guide to get started with the \`dataprovider\` module because it seems to be the solution to my issues. I am however struggling to understand how data from external sources (this case Github Actions) gets to these \`dataprovider\` modules and is then communicated to the relevant components in Compass.


author: Dave Parrish _Atlassian_
body: Thanks [@John Medina](/t5/user/viewprofilepage/user-id/4996391) for the additional context. We'll be adding native support for build success rate in GitHub very soon, so there's no need for you to dig further into the docs. I'll post a message back here when it's available.


author: John Medina
body: That sounds great!

Are there also any plans on allowing \`Statuses\` to be displayed?


author: Josh Campbell
body: Hey John, we don't have a way to push a status like you're asking (i.e. non-numerical data) using Metrics today. You could use 0 or 1 as a workaround :) or perhaps use a Custom Field and [update that via the API](https://developer.atlassian.com/cloud/compass/graphql/#mutations_updateCustomFieldDefinition) for this. That said, I understand the usecase you're highlighting so you're feedback is heard there.

One followup question: is the concept of a status for a component limited to just build events for you or is that simply the first step you're taking in determining a components status? I guess I am curious what it means for a component to have a "status" in general. Cheers!


author: John Medina
body: This work was mostly got a PoC I had been working on for my company. Ideally, this would have been included as one of the metrics used in a Service Scorecard as a factor to good system health.


Tags: github

metric