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

badges: Add percentage of no retests to the No Retests badge #72

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

brianmcarey
Copy link
Member

What this PR does / why we need it:

Rather than leaving the user calculate the percentage of No Retests - lets add it to the badge

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

/cc @dhiller

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note:


@kubevirt-bot kubevirt-bot requested a review from dhiller December 12, 2024 09:05
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XS labels Dec 12, 2024
Copy link
Contributor

@dhiller dhiller left a comment

Choose a reason for hiding this comment

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

/approve

@@ -259,7 +259,7 @@ func (d *RunningAverageDataItem) String() string {
}

func (d *RunningAverageDataItem) SimpleBadgeString() string {
return fmt.Sprintf(constants.NoRetestBadgeDataFormat, d.NoRetest, d.Number)
return fmt.Sprintf(constants.NoRetestBadgeDataFormat, d.NoRetest, d.Number, (d.NoRetest/d.Number)*100, "%")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: if d.Number is zero this will do a NaN, but I don't think it will harm

Copy link
Member Author

Choose a reason for hiding this comment

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

if we have no PRs merged in 7 days we will have bigger problems 😆

@brianmcarey brianmcarey merged commit 2694998 into main Dec 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants