DSACMS / metrics

Experimentations in Open Source Repository Metrics
https://dsacms.github.io/metrics/
Other
6 stars 2 forks source link

Add Metric to Gather Badge URL for Nadia Asparouhova's Project Types #98

Closed IsaacMilarky closed 3 months ago

IsaacMilarky commented 3 months ago

Add Metric to Gather Badge URL for Nadia Asparouhova's Project Types

Problem

We are not utilizing the upstream Augur Nadia categorization endpoint as well as the shield badging endpoint in order to show a badge on our metrics repo report page.

Solution

I have added a new CustomMetric to accomplish this task. The metric hits the augur endpoint to retrieve the category the repository belongs to and then plugs the resulting arguments into a url to generate a badge from a shields endpoint. Here is an example: https://img.shields.io/static/v1?label=project+type&message=Midsize&color=red.

Result

In order for this badge to display we should embed the svg tag found in the resulting recorded shield url.

Here are what the badges look like:

project_type_Midsize project type club project type toy project type stadium project type federation

IsaacMilarky commented 3 months ago

This addresses Issue #8

IsaacMilarky commented 3 months ago

Oh yeah I didn't notice the spacing issue. I think that should be fixable with altering those text configuration options. I think those are all dynamically generated by the shields api that we pulled from.

If it proves to be difficult to fix the text bug, then we should just embed the image from the url that we save in the metrics data. @natalialuzuriaga

IsaacMilarky commented 3 months ago

Alright, I was able to make the adjustments with the text configs! Just a couple of minor tweaks need to be made with the nadia label variables in the metrics data and this is good to go!

Made the requested changes. Let me know if it all looks good to merge!