Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 13 commits into from
Apr 8, 2024

Conversation

IsaacMilarky
Copy link
Collaborator

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

Signed-off-by: Isaac Milarsky <[email protected]>
Signed-off-by: Isaac Milarsky <[email protected]>
@IsaacMilarky
Copy link
Collaborator Author

This addresses Issue #8

@IsaacMilarky IsaacMilarky marked this pull request as ready for review April 5, 2024 19:11
@IsaacMilarky IsaacMilarky added the enhancement New feature or request label Apr 5, 2024
Signed-off-by: Isaac Milarsky <[email protected]>
Signed-off-by: Isaac Milarsky <[email protected]>
Signed-off-by: Isaac Milarsky <[email protected]>
Signed-off-by: Isaac Milarsky <[email protected]>
@IsaacMilarky IsaacMilarky linked an issue Apr 8, 2024 that may be closed by this pull request
Copy link
Collaborator

@natalialuzuriaga natalialuzuriaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I changed the location of the badge so it's under the title. There's a lot of spacing between the letters though... going to see if I can do some adjustments

Screenshot 2024-04-08 at 11 03 55 AM Screenshot 2024-04-08 at 11 27 25 AM

@IsaacMilarky
Copy link
Collaborator Author

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

Signed-off-by: Natalia Luzuriaga <[email protected]>
Signed-off-by: Natalia Luzuriaga <[email protected]>
Copy link
Collaborator

@natalialuzuriaga natalialuzuriaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@IsaacMilarky
Copy link
Collaborator Author

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!

Copy link
Collaborator

@natalialuzuriaga natalialuzuriaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, LGTM ✅

@IsaacMilarky IsaacMilarky merged commit 82f4bbd into dev Apr 8, 2024
2 checks passed
@IsaacMilarky IsaacMilarky deleted the add-nadia-labeling branch April 8, 2024 22:38
Copy link
Contributor

@decause-gov decause-gov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repo Categorization; "Roads and Bridges"
3 participants