GitHub integration for Orbit for anyone with multiple communities

Floor Drees - Nov 24 '21 - - Dev Community

Orbit is "mission control for your community", a single, shared view of members and activity.

For my work for k6 I've been adding integrations to our Orbit "workspace" so that I can make correlations between data points, and to act accordingly.

For instance: this person asking a question on Twitter, posted the same question in our Discourse, let's link to our explanation in our reply. Discourse after all allows for more characters than Twitter, and anyone passing by might learn about our community Discourse and check it out.

I've used the GitHub Actions workflow for this, which is just adding a bunch of YAML files and "secrets" to a personal repo.

YAML files in a repository

Next I wanted to hook up our public repositories on GitHub, to scan those for activity, and I ran into an issue. k6 was recently acquired by Grafana Labs, and in August we moved all k6 repositories under the Grafana Labs organization on GitHub. Grafana uses Orbit to listen to all the repos in that organization, and it seems Orbit can't send data from one organization to two different workspaces.

Nicolas Goutay, Sr. Software Engineer, Ben Greenberg, (their former) Developer Advocate, and Josh Dzielak, Co-Founder & CTO, responded unanimously to my request: it's just not possible. Yet.

Now I think Orbit should give this feature request some priority, because I think that many larger (open source) players have multiple product communities they support - Grafana has Prometheus, Grafana itself, Tempo, etc, Red Hat has OpenShift, OpenStack, Ansible, HashiCorp has Consul, Terraform, Vagrant. Currently information on all these different project feed into one workspace and I can imagine the signal-to-noise ratio is... not great.

Colleague, and Tempo maintainer, Daniel González Lopes to the rescue! Part of the SRE team at k6, Daniel helped me (ab)use the GitHub API to search GitHub for public Grafana repos with "k6" in the name, and get all the recent events for each one of them.

From those events we create new members (or update them if they already exist), and create new activities for each one of them. While functional in the first iteration, Daniel spent some time to update the activity types to be more legible / without all the breadcrumb info.

Before:
Activity graph before

After:
Activity graph after

We're hoping tags in Orbit Activities will help to filter by repo in the future. But in Orbit's reference material tags are marked as "experimental". In all caps.

Anyway, the idea is that we for this as well use GitHub Actions. We'll let the implementation simmer for a few weeks, make tweaks here and there, and the gradually add the other integrations. With every integration we add we expect to see duplication, and I'd rather deal with those on a case by case basis, than to go through 300+ possible matches at once.

"Fun" anecdote: Daniel thought it'd be neat to use "starring a repo" as an activity as well, which exposed some rate limits on Orbit's end. We plan to run the script hourly, to avoid big data (not to be confused with Big Data) imports moving forward.

Orbit's reports / graphs are pretty rudimentary, so I would love to see someone create an Orbit data source plugin for Grafana. Imagine being able to view community data with your other project's health metrics... Looking at Marcus Olsson 👀

Our little integration lives on GitHub for you to fork, copy, or take inspiration from.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .